|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33805 simplexml_load_file() decodes the file name
Submitted: 2005-07-21 14:38 UTC Modified: 2005-07-21 14:49 UTC
From: phpbugs at pureftpd dot org Assigned:
Status: Not a bug Package: SimpleXML related
PHP Version: 5.0.4 OS: Any
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: phpbugs at pureftpd dot org
New email:
PHP Version: OS:


 [2005-07-21 14:38 UTC] phpbugs at pureftpd dot org
simplexml_load_file() decodes the argument that is supposed to 
be a file name.

It can be a security flaw. I was able to bypass the Overture 
adult filter of the search engine of a by 
abusing this.

Reproduce code:
simplexml_load_file('' . urlencode('b&c'));

It loads (which means that the value of 'a' is 'b' not 'b&c' as intended by the urlencode() call).

simplexml_load_file(rawurlencode('' . urlencode('b&c')));

Does the expected behavior and fetches the correct URL.

Expected result:
Either fix the documentation (the argument is not a file name, 
but a rawurlencoded one), or the function to behave like fopen
(), file_get_contents() and other similar functions.

Actual result:
URLs are decoded.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-07-21 14:49 UTC]
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Dec 08 10:01:28 2023 UTC