CVE-2026-42589 Gotenberg: Unauthenticated RCE via ExifTool Metadata Key Injection
Unauthenticated attackers can execute arbitrary OS commands via ExifTool flag injection in the metadata write endpoint.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2026-42589?
CVE-2026-42589 is a critical command injection vulnerability in gotenberg, published on 14 May 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official 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.
Weakness: CWE-78
Which versions are affected by CVE-2026-42589?
4 open source packages ship an affected version, including github.com/gotenberg/gotenberg/v8 and github.com/gotenberg/gotenberg/v7. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
github.com/gotenberg/gotenberg/v8 Go | All versions | None |
github.com/gotenberg/gotenberg/v8 Go | All versions | None |
github.com/gotenberg/gotenberg/v8 Go | All versions | None |
github.com/gotenberg/gotenberg/v7 Go | All versions | None |
Products include Thecodingmachine Gotenberg.
How do I fix CVE-2026-42589?
Upgrade to a fixed version.
Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.
Is CVE-2026-42589 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-42589 exists.
Public exploit code: 1 Nuclei template and 3 proofs of concept on GitHub.
Other vulnerabilities in gotenberg
- CVE-2026-40281 Gotenberg vulnerable to argument injection via newlines in ExifTool metadata values
- CVE-2020-13450 Path traversal in n/a
- CVE-2020-13451 Code injection in n/a
- CVE-2020-13452 Privilege escalation in n/a
- CVE-2026-42596 Gotenberg: Unauthenticated SSRF via default deny-list bypass in downloadFrom and webhook
Sources
Also known as GHSA-rqgh-gxv4-6657, GO-2026-5636.