Answer the question
In order to leave comments, you need to log in
Is it possible to read xml file from different domains/directories?
My colleague, a "programmer", is spitting and trying to prove to me that it is not safe to read from his site and process an xml file located on his other site.
Both sites are on the same ftp account on the same hosting.
The xml file is located on site 1 in the xml folder, and information from it is displayed on site 2.
The file is read-only with rights 644
"programmer" writes to me:
Attackers will get access to the file and then they can slip you a script that will substitute your users. You can solve this problem in this way: move the xml file to the site where the information is displayed.
Answer the question
In order to leave comments, you need to log in
if 2 sites are trying to communicate with one file, then it is logical to move it outside the public zones and work with it there. php is perfectly able to work within its working directory. You can generally wrap all this in an api on the third domain and give json. But the very idea of one site accessing another is dangerous because of their connection, not hacks.
Your colleague is right. It's a kind of XSS hole.
And you laugh out of stupidity, not even realizing that they are LOCAL rights and do not play a role at all if it has webserera rights. Simply put, if the php script has access (should do something with it), then that's all, that's enough.
Перемещение файла однозначно ничем не поможет. если получить доступ к 1 то можно и получить доступ ко 2. Тем более в этом случае разумнее будет внедрить код в содержимое исполняемых файлов, а не в xml.
Зависит от того где получается на клиенте / сервере, какие операции над файлом, но вообще следует всегда валидировать содержимое(не доверять источнику) приводить к типу, фильтровать на потенциальные xss. зависит от использования данные.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question