A Tale of Two Formats: Exploiting Insecure XML and ZIP File Parsers to Create a Web Shell
The app processed a ZIP containing an XML manifest; naive XML and ZIP parsing could enable file disclosure and path traversal, potentially leading to a web shell.
Published on spaceraccoon.dev
While researching a bug bounty target, I came across a web application that processed a custom file type. Let’s call it .xyz.
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 had external entity processing enabled by default, and the ZIP extraction library did not sanitise file paths, allowing directory traversal.
Impact
Naive handling of the ZIP and XML formats could create additional security issues, though the text does not detail specific impact.
What the attacker needed
Ability to upload a package file
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.
The app lets you upload a ZIP containing an XML file. If the XML and ZIP parsers use default settings, they may handle external entities and file paths unsafely.
What is XXE?
An XML parser resolves entities the attacker defines, reading local files or making the server send requests.