Skip to content
XXE Write-up Advanced

h1{Error based XXE - bug bounty writeup}

An XML parser on a public application had external entity processing enabled, allowing an attacker to read local files. The attacker used error-based techniques and a local DTD file to exfiltrate file contents without outbound HTTP requests.

f4d3 Follow

Published on f4d3.io

During my usual recon, I’ve found something very interesting on the “ZOOOOOOOOM” application of XXX company.

f4d3 (@f4d3_cl), on f4d3.io

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 was configured to allow custom DOCTYPE declarations and external entities, which is insecure.

Impact

An attacker could read arbitrary files on the server, potentially leading to further compromise.

What the attacker needed

XML parser with external entities enabled; Ability to send XML requests; Outbound FTP allowed (for initial exfiltration)

The fix

The issue was fixed by the vendor.

How it was found

  1. Send an XML request with a DOCTYPE that defines an external entity pointing to a controlled domain.
  2. Observe that only a DNS request is made, indicating external entity processing is enabled but HTTP is blocked.
  3. Upload a malicious DTD file to a world-readable location on the target server.
  4. Send an XML request that references the uploaded DTD and attempts to exfiltrate a local file via FTP.
  5. Use the jar protocol to trigger an error that includes the file contents.
  6. Later, use a local DTD file to perform the attack without external interaction.

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 is a data format that can include special instructions called entities. If a server processes these entities without restrictions, an attacker can make it read files from the server and send them elsewhere. This is called an XML External Entity (XXE) attack.

What is XXE?

An XML parser resolves entities the attacker defines, reading local files or making the server send requests.

Similar reports

View all

Same bug class and techniques, clearest first.

XML external entities (XXE)

The lesson behind this report.

An XML parser resolves entities the attacker defines, reading local files or making the server send requests.