Metadata and iXML
WordPress's Media Library parsed iXML metadata in uploaded WAVE files with an XML parser that allowed external entities, so an authenticated author could upload a crafted file to read local files and make server-side requests. The report demonstrates a blind XXE that exfiltrates file contents to an attacker-controlled server.
blog.wpsec.com
Published on blog.wpsec.com
WordPress versions 5.7, 5.6.2, 5.6.1, 5.6, 5.0.11 are affected to XML eXternal Entity vulnerability where an authenticated user with the ability to upload files in the Media Library can upload a malicious WAVE file that could lead to remote arbitrary file disclosure and server-side request forgery (SSRF).
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 iXML metadata from an uploaded WAVE file was passed to simplexml_load_string() without disabling external entity loading, so attacker-supplied XML could define entities that read local files or fetch remote DTDs.
Impact
An authenticated author could read arbitrary files on the server and make server-side requests; the report notes the vulnerability only affects WordPress running on PHP 8.
What the attacker needed
Authenticated user with upload rights; WordPress on PHP 8; attacker-controlled web server
How it was found
- Create a WAVE file whose iXML chunk contains an XML document that references an external DTD.
- Host the external DTD on an attacker-controlled web server; the DTD defines entities that read a local file and send it back.
- Upload the crafted WAVE file to the WordPress Media Library as an authenticated author.
- Observe the HTTP request arriving at the attacker server with the base64-encoded file content in a query parameter.
- Decode the parameter to read the file contents.
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.
When you upload an audio file, WordPress reads extra information stored inside it, called metadata. The bug is that WordPress treated that metadata as XML and allowed it to pull in outside files or web addresses, so a malicious audio file could make the server read its own files and send them to the attacker. This is called XXE, or XML External Entity injection.
What is XXE?
An XML parser resolves entities the attacker defines, reading local files or making the server send requests.