Out of Band XXE Injection Via gopher
An Oracle XML parser endpoint accepted XML containing an external entity, allowing an attacker to make the server fetch a remote DTD and then exfiltrate local files. By using a gopher URI in the crafted DTD, the attacker could send the contents of /etc/passwd to their own server.
medium.com
Published on medium.com
{{media:0}}
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the XML parser allowed external entity resolution and did not restrict outbound network requests, enabling out-of-band data exfiltration.
What the attacker needed
Access to the vulnerable XML endpoint; attacker-controlled server for DTD and exfiltration
How it was found
- Send a SOAP request to the XML service with an external entity pointing to a collaborator domain.
- Observe DNS and HTTP interactions on the collaborator to confirm out-of-band XXE.
- Host a malicious DTD that defines an entity to read a local file and send it to an attacker-controlled server.
- Send a second request referencing the malicious DTD.
- Use a gopher URI in the DTD to exfiltrate the full file contents, capturing them with tcpdump.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
XML allows a document to define 'entities' that pull in content from elsewhere. If a server processes XML without disabling this, an attacker can make it read local files and send them out. Here the attacker used a special URL scheme (gopher) to leak the file contents.
What is XXE?
An XML parser resolves entities the attacker defines, reading local files or making the server send requests.