Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2025-66516-POC — A POC for the CVE-2025-66516 Apache Tika Vulnerability for educational purposes only | Kitploit
Tools/GitHubGitHub/sid6224/cve-2025-66516-poc
Payload GenerationVulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingLearning & Education
GitHubsid6224/cve-2025-66516-poc

CVE-2025-66516-POC

A POC for the CVE-2025-66516 Apache Tika Vulnerability for educational purposes only

View Repository
616710 months agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

⚠️ READ DISCLAIMER BEFORE USE ⚠️

Educational/Authorized Testing Only | License | Security Policy


CVE Tika Severity XXE License Platform Java


About This POC

This repository contains a proof-of-concept (POC) exploit for CVE-2025-66516, an XML External Entity (XXE) injection vulnerability in Apache Tika versions prior to 3.2.2. The vulnerability affects the XFA (XML Forms Architecture) parser in the tika-parser-pdf-module component, allowing attackers to read local files and exfiltrate sensitive data through maliciously crafted PDF documents.

What is CVE-2025-66516?

CVE-2025-66516 is a critical security vulnerability in Apache Tika's PDF parsing functionality. When processing PDF files with embedded XFA forms, Tika versions before 3.2.2 fail to properly restrict external entity processing in XML parsers. This allows attackers to:

  • Read arbitrary files from the server filesystem (local file disclosure)
  • Exfiltrate sensitive data to external servers (out-of-band XXE)
  • Perform SSRF attacks by triggering requests to internal network resources
  • Bypass security controls in applications that rely on Tika for document processing

Vulnerability Details

  • CVE ID: CVE-2025-66516
  • Affected Component: Apache Tika tika-parser-pdf-module
  • Affected Versions: Apache Tika < 3.2.2
  • Patched Version: Apache Tika 3.2.2 and later
  • Attack Vector: Maliciously crafted PDF with XFA forms containing XXE payloads
  • Impact: Confidentiality breach, data exfiltration, server-side request forgery (SSRF)
  • CVSS Severity: High
  • Related CVE: CVE-2025-32370 (similar XXE vulnerability in Tika)

Repository Contents

This repository includes:

  • gen_poc.py - Python script to generate malicious PDFs for local file read XXE attacks
  • gen_oob_poc.py - Python script to generate PDFs for out-of-band data exfiltration
  • http_listener.py - HTTP server to demonstrate OOB XXE data exfiltration
  • DocumentProcessor.java - Sample Java application showing vulnerable Tika integration
  • Complete step-by-step reproduction guide with expected outputs
  • Technical analysis comparing vulnerable vs patched versions
  • Attack flow documentation explaining the exploitation mechanism

Keywords

Apache Tika XXE, CVE-2025-66516 exploit, Tika security vulnerability, XML External Entity attack, PDF XXE injection, Tika 3.2.1 vulnerability, out-of-band XXE, OOB XXE, security research, penetration testing, POC exploit, vulnerability disclosure, XFA parser vulnerability, tika-parser-pdf-module, file disclosure vulnerability, data exfiltration, SSRF attack, secure coding, vulnerability analysis, security testing, ethical hacking, infosec, cybersecurity research, Apache Tika exploit code, XXE payload, PDF security, document parser vulnerability


Tested Environment

Note: This POC has been tested and verified on:

  • Apache Tika Versions: 3.2.1 (vulnerable) and 3.2.2 (patched)
  • Operating System: Linux - Ubuntu 24.04.3 LTS
  • Java Version: OpenJDK 17.0.17

Setup POC Directory

First, create a dedicated directory for the POC to keep all files organized.

mkdir apache_tika_poc
cd apache_tika_poc

Environment Verification

Before proceeding with the POC, verify your environment has the required dependencies. These commands will display your Java compiler/runtime versions and OS details, which are important for reproducing the vulnerability.

# Check Java version
java -version
javac -version

# Check OS version
lsb_release -a

Expected Output: You should see Java version information (e.g., OpenJDK 17.x.x) and Ubuntu version details (24.04.3 LTS).

Download Apache Tika JARs

Download both the vulnerable (3.2.1) and patched (3.2.2) versions of Apache Tika. We need both versions to demonstrate that the XXE vulnerability exists in 3.2.1 and is fixed in 3.2.2. The tika-app JAR is an all-in-one executable that includes all Tika parsers and dependencies.

# Download vulnerable Tika version
wget https://repo1.maven.org/maven2/org/apache/tika/tika-app/3.2.1/tika-app-3.2.1.jar

# Download patched Tika version  
wget https://repo1.maven.org/maven2/org/apache/tika/tika-app/3.2.2/tika-app-3.2.2.jar

Expected Output: Two JAR files will be downloaded - tika-app-3.2.1.jar (~75MB) and tika-app-3.2.2.jar (~75MB).

Verify Component Versions

Verify the exact versions by inspecting the JAR manifest files. This confirms we have the correct vulnerable and patched versions before testing.

# Check vulnerable version manifest
unzip -p tika-app-3.2.1.jar META-INF/MANIFEST.MF

# Check patched version manifest
unzip -p tika-app-3.2.2.jar META-INF/MANIFEST.MF

Expected Output: Manifest files showing Implementation-Version: 3.2.1 and 3.2.2 respectively, along with build timestamps and other metadata.

List Component POM Properties

If we look at the Project Object Models (Maven's POM properties define a project's dependencies, build configuration, and metadata.), we see there are no separate tika-parsers as mentioned in the security advisories - could be a version related thing and the assumption is in versions 3.2.1 and 3.2.2, which are part of the POC, the tika-parsers module were replaced by individual parser modules.

# List all component pom.properties files for both versions
unzip -l tika-app-3.2.1.jar | grep pom.properties | grep tika
unzip -l tika-app-3.2.2.jar | grep pom.properties | grep tika

Expected Output: A list of all Tika component modules including tika-core, tika-parser-pdf-module, tika-xmp, etc. You'll notice individual parser modules rather than a single tika-parsers module.

Check Tika Component Versions

Extract and display the version information for core Tika components. This helps us understand the internal module structure and confirm that both the core library and PDF parser module are at the expected versions.

# Check tika-core, tika-parser-pdf-module, and tika-app versions for 3.2.1
unzip -p tika-app-3.2.1.jar META-INF/maven/org.apache.tika/tika-core/pom.properties && echo "---" && unzip -p tika-app-3.2.1.jar META-INF/maven/org.apache.tika/tika-parser-pdf-module/pom.properties && echo "---" && unzip -p tika-app-3.2.1.jar META-INF/maven/org.apache.tika/tika-app/pom.properties

# Check tika-core, tika-parser-pdf-module, and tika-app versions for 3.2.2
unzip -p tika-app-3.2.2.jar META-INF/maven/org.apache.tika/tika-core/pom.properties && echo "---" && unzip -p tika-app-3.2.2.jar META-INF/maven/org.apache.tika/tika-parser-pdf-module/pom.properties && echo "---" && unzip -p tika-app-3.2.2.jar META-INF/maven/org.apache.tika/tika-app/pom.properties

Expected Output: POM properties showing version=3.2.1 or version=3.2.2 for each component, separated by ---. All three components (tika-core, tika-parser-pdf-module, tika-app) should match the overall version.

Create Target File for XXE Exploitation

Create a fake secrets file that will be the target of our XXE attack. This file simulates sensitive data (like API keys or credentials) that an attacker might try to exfiltrate through the XXE vulnerability.

# Create target secret file
echo "INTERNAL_SERVER_KEY=EXPOSED" > fake-secrets.txt
Download Tool