critical CVSS 9.8

CVE-2026-42589·Docker vulnerability

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.

Severity
critical
Software
Docker
Fixed in
8.31.0
Published
2026-05-14

Affected versions

Until: 8.31.0

Fixed in: 8.31.0

How to fix this CVE

Upgrade Docker to version 8.31.0 or later to patch the metadata endpoint input validation flaw that allows command injection through ExifTool. If you are running Gotenberg within Docker, ensure the container image is rebuilt with the patched version. Immediate patching is critical as this vulnerability permits unauthenticated remote code execution with minimal detection.

sudo dnf update docker-ce

Defensia detects this vulnerability

What an exploitation attempt looks like

Sample log line indicative of exploitation attempts:

POST /forms/pdfengines/metadata/write.*\n.*-if|POST /forms/pdfengines/metadata/write.*Content-Type: application/json.*\\n.*(?:perl|system|exec)

WAF mitigation (if patching is not yet possible)

Add this rule to your WAF to block exploitation attempts while you schedule the patch.

Block POST requests to /forms/pdfengines/metadata/write with JSON payloads containing literal newline characters (\n) or URL-encoded newlines (%0A, %0D%0A) in JSON keys. Implement strict JSON schema validation to reject keys with control characters.

How to check if you are affected

  1. Check installed Docker version: docker --version or docker version | grep -i version
  2. Identify Gotenberg containers: docker ps --filter 'ancestor=gotenberg*' --format '{{.Image}} {{.ID}}'
  3. Inspect Gotenberg image tag: docker inspect <container_id> | grep -i 'Image.*gotenberg'
  4. Verify patch installation: docker exec <container_id> /gotenberg --version and confirm version >= 8.31.0

FAQ

What is CVE-2026-42589?

CVE-2026-42589 is a critical unauthenticated remote code execution vulnerability in Gotenberg's PDF metadata endpoint that fails to sanitize JSON keys, allowing newline injection to bypass ExifTool argument parsing and execute arbitrary Perl expressions.

Is CVE-2026-42589 being actively exploited?

No, this vulnerability is not currently listed on the CISA Known Exploited Vulnerabilities catalog and no public exploit code is available, but the low complexity of the attack makes it a high-priority remediation target.

What versions of Docker are affected by CVE-2026-42589?

All versions of Gotenberg prior to 8.31.0 are affected; the vulnerability exists in the /forms/pdfengines/metadata/write endpoint regardless of Docker version, but depends on Gotenberg being deployed as a container.

How do I check if my server is vulnerable to CVE-2026-42589?

Run `docker images | grep gotenberg` and check the tag version; if it is below 8.31.0, pull the latest image with `docker pull gotenberg:latest` and redeploy the container.

Does Defensia detect CVE-2026-42589?

Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If Docker or Gotenberg is installed on a monitored server, CVE-2026-42589 will appear in your dashboard with remediation steps.

Related Docker CVEs

CVE-2026-57572CVSS 10Crawl4AI is an open-source LLM-friendly web crawler and scraper. Prior to 0.9.0, the Docker API server accepted request-supplied browser_config.extra_args, which flowed into Chromium's launch arguments. An attacker could inject Chromium switches that replace a child-process launch command together with --no-zygote, causing Chromium to fork or exec an attacker-controlled command as the container's runtime user. The Docker API is unauthenticated by default, so a single request yields arbitrary command execution. This issue is fixed in version 0.9.0.
CVE-2026-26216CVSS 10Crawl4AI versions prior to 0.8.0 contain a remote code execution vulnerability in the Docker API deployment. The /crawl endpoint accepts a hooks parameter containing Python code that is executed using exec(). The __import__ builtin was included in the allowed builtins, allowing unauthenticated remote attackers to import arbitrary modules and execute system commands. Successful exploitation allows full server compromise, including arbitrary command execution, file read and write access, sensitive data exfiltration, and lateral movement within internal networks.
CVE-2026-44329CVSS 10free5GC is an open-source implementation of the 5G core network. Prior to 4.2.2, free5GC's SMF mounts the UPI management route group without OAuth2/bearer-token authorization middleware. A network attacker who can reach SMF on the SBI can hit UPI endpoints with no Authorization header at all, and the requests reach the SMF business handlers. In the running Docker lab this was directly demonstrated for read (GET /upi/v1/upNodesLinks), write (POST /upi/v1/upNodesLinks with attacker-controlled UP-node and link payload), and delete (DELETE /upi/v1/upNodesLinks/{nodeID}) operations. This vulnerability is fixed in 4.2.2.
CVE-2026-42298CVSS 10Postiz is an AI social media scheduling tool. Prior to commit da44801, a "Pwn Request" vulnerability in the Build and Publish PR Docker Image workflow (.github/workflows/pr-docker-build.yml) allows any unauthenticated user to execute arbitrary code during the Docker build process and exfiltrate a highly privileged GITHUB_TOKEN (write-all permissions). This can be achieved simply by opening a Pull Request from a fork with a maliciously modified Dockerfile.dev. This issue has been patched via commit da44801.
CVE-2026-40281CVSS 10Gotenberg is a Docker-powered stateless API for PDF files. In versions 8.30.1 and earlier, the metadata write endpoint validates metadata keys for control characters but leaves metadata values unsanitized. A newline character in a metadata value splits the ExifTool stdin line into two separate arguments, allowing injection of arbitrary ExifTool pseudo-tags such as -FileName, -Directory, -SymLink, and -HardLink. This is a bypass of the incomplete key-sanitization fix introduced in v8.30.1. An unauthenticated attacker can rename or move any PDF being processed to an arbitrary path in the container filesystem, overwrite arbitrary files, or create symlinks and hard links at arbitrary paths.

References

Track CVEs across your fleet automatically

Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2026-42589. Free for 1 server.

Get started free