CVE-2025–66516 & 54988: Breaking Apache Tika with Malicious PDF
Apache Tika versions up to 2.8.0 parse uploaded PDFs with an embedded XML external entity payload, so a crafted PDF causes the server to read local files and return their contents in the parsed output. The author demonstrates this in a local lab and shows a Windows system file being disclosed.
Published on systemweakness.com
First, let’s explain what Apache Tika is, what it is used for, and how certain vulnerable dependency versions can allow Apache Tika to parse content from uploaded files in an unsafe way.
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 bundled PDF/XML parser in tika-core resolves external entities in untrusted uploaded content instead of disabling them.
Impact
An attacker who can upload a file could read local files on the server and potentially expose operating system-level data; the demo only shows a single local file being disclosed.
What the attacker needed
Ability to upload a file to the app; app uses vulnerable Tika version
The fix
Upgrade Apache Tika to 2.9.0 or later, keep dependencies current, and add file size limits and parser restrictions around untrusted uploads.
How it was found
- Build a small Spring Boot app that uses the vulnerable Tika library and exposes an upload form.
- Start the app locally and confirm the upload page loads.
- Create a PDF containing an embedded XXE payload aimed at the local system.
- Upload the crafted PDF through the form.
- Observe the parsed output containing the contents of a local system 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.
Apache Tika is a Java library that reads the text out of uploaded files such as PDFs. Older versions let a file tell the parser to fetch extra content from the server itself, so a malicious PDF can make the server open a local file and paste its contents into the reply. This trick is called XXE, short for XML external entity.
What is XXE?
An XML parser resolves entities the attacker defines, reading local files or making the server send requests.