Skip to content
XXE Write-up Advanced

Data exfiltration using XXE on a hardened server

The XML parser on the server was vulnerable to XXE, but a WAF blocked outbound HTTP traffic and file upload was unavailable. The attacker used a local DTD file already present on the server to trigger an error-based XXE, causing the parser to include the contents of a local file in an error message.

Ritik Singh Follow

Published on infosecwriteups.com

XXE stands for XML External Entity. This is part of the Security misconfiguration of the OWASP Top Ten.

Ritik Singh, on infosecwriteups.com

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 expansion and the application returned detailed parsing errors, while a WAF blocked outbound HTTP but not local file access.

What the attacker needed

XML parser accepts external entities; WAF blocks outbound HTTP but not local file access; A local DTD file with an injectable entity exists; No file upload functionality available

How it was found

  1. Detect blind XXE by sending a payload with an interactsh URL and observing a DNS lookup.
  2. Switch to error-based XXE by referencing a local DTD file using the file protocol.
  3. Enumerate local DTD files by supplying various file paths and checking error messages.
  4. Identify an injectable entity in a present DTD file, such as %constant in fonts.dtd.
  5. Craft a payload that uses the local DTD to read a target file and trigger an error containing its contents.
  6. Send the payload and read the sensitive data from the parsing error.

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 accepts XML from users and processes those entities without care, an attacker can make the server read local files. Here, the attacker used a file already on the server to trick the parser into revealing a file's contents in an error message.

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.