An application has an "import from XML" feature. Someone uploads a file, the server parses it and shows the result. If the parser is on default settings, that feature may be vulnerable to XML External Entity injection.
The mechanism
XML lets a document declare entities in a DOCTYPE. Some entities point outward, to a file or a URL. If the parser resolves them and the application returns parsed content, whatever the entity pointed at ends up in the response.
A safe way to test it
Run this only against a lab or a system you are authorised to test. The document declares an entity for a harmless local file and references it in a field the page echoes back:
<?xml version="1.0"?> <!DOCTYPE item [ <!ENTITY probe SYSTEM "file:///etc/hostname"> ]> <item><name> &probe; </name></item>
Enter fullscreen mode
Exit fullscreen mode
If the hostname appears where the name should be, the parser resolved the external entity. That is the finding.…