Skip to content
XXE Write-up Beginner

Critical XXE Vulnerability Found in an Indian Government Website

An XML endpoint on a government website parsed user-supplied XML with external entities enabled, so a crafted document could make the server read local files. The author states this gave access to files stored on the server.

dharineeshj2 Follow

Published on medium.com

During a routine security assessment, I discovered a critical XML External Entity (XXE) Injection vulnerability in an Indian government website. This vulnerability allowed access to all the files stored on the server and posed a significant risk to the system’s confidentiality and integrity.

Hack-Bat, on medium.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 was left with external entity resolution and DTD processing enabled, so entity declarations in the request were expanded against the local filesystem.

Impact

An attacker could read arbitrary files on the server, which the author says exposed all files stored there and put confidentiality and integrity at risk.

What the attacker needed

Network access to the endpoint; endpoint accepts XML request bodies

The fix

The parser should be configured to disable DTDs and external entity resolution, and XML input should be validated; the text does not say whether a fix was applied.

How it was found

  1. Identify the Autodiscover XML endpoint on the target.
  2. Send a POST request with an XML content type and a document that declares an external entity pointing at a local file.
  3. Resend with the correct Autodiscover namespace so the application processes the request body.
  4. Observe the contents of the local file reflected in the response.

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.

Some web services accept XML, a text format for structured data. XML can declare 'entities', which are shortcuts that get replaced by other content, and a careless parser will happily fetch a file from the server's own disk when asked. Here the server did that, so an attacker could read files it should never expose.

What is XXE?

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

More by dharineeshj2

View all

5 more disclosed reports, best first.

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.