From blind XXE to root-level file read access
An XML endpoint was vulnerable to blind XXE, allowing the attacker to read local files, enumerate internal hosts and ports, and reach internal services. By routing requests through an unpatched internal Confluence server, the attacker gained error-based file read access and could list the root user's home directory.
Published on honoki.net
On a recent bug bounty adventure, I came across an XML endpoint that responded interestingly to attempted XXE exploitation. The endpoint was largely undocumented, and the only reference to it that I could find was an early 2016 post from a distraught developer in difficulties.
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 had external entity loading enabled and returned verbose parser errors to the client, combined with weak network segmentation and an unpatched internal Confluence server.
Impact
The attacker could read local files including the root user's home directory contents, enumerate internal hosts and open ports, and reach internal services, though outgoing traffic was blocked by a firewall until an internal Confluence server was used as a relay.
What the attacker needed
Network access to the XML endpoint; internal Confluence server reachable; attacker-hosted DTD file
The fix
The vulnerability was fixed after the report, and the write-up recommends patching internal servers, segmenting the network, and keeping detailed errors out of HTTP responses.
How it was found
- Send a POST request with an XML content type and an invalid XML body to confirm the endpoint parses XML.
- Include a DOCTYPE with an external entity pointing to a local file to test whether external entities are loaded.
- Point an external entity at an internal host to confirm internal network traffic is allowed.
- Route a request through the internal Confluence OAuth icon-uri endpoint to reach an attacker-controlled file.
- Use a crafted external DTD to place file contents into an error message and read them.
- List the root user's home directory to confirm root-level read access.
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 lets a document refer to outside resources, and a parser that follows those references can be tricked into fetching local files or internal addresses. Here the server never showed the file contents directly, but its detailed error messages leaked them, and an internal wiki server was abused as a relay to reach the attacker's own site.
What is XXE?
An XML parser resolves entities the attacker defines, reading local files or making the server send requests.