XML External Entity (XXE) Injection in Apache Batik Library [CVE-2015-0250]
The Apache Batik library parsed XML input with external entity expansion enabled by default, so untrusted XML could reference external resources. An attacker could use this to read files, cause a denial of service, or inject script code.
insinuator.net
Published on insinuator.net
During one of our latest web application code review projects I came across a vulnerability for which I think it is worth to speak about. It is an injection based attack against XML parsers which uses a rarely required feature called external entity expansion.
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 expansion enabled, so it resolved entity references to external resources in untrusted input.
Impact
A successful attack could allow access to the file system, cause a denial of service, or inject script code such as JavaScript for an XSS attack.
What the attacker needed
Untrusted XML input is parsed; parser allows external entities
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 files can define shortcuts called entities that point to other resources. If a parser follows those pointers without checking, an attacker can make it fetch local files or other unwanted content. This is called an XML external entity attack, or XXE.
What is XXE?
An XML parser resolves entities the attacker defines, reading local files or making the server send requests.