CVE-2026-40281·Docker vulnerability
Gotenberg 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.
- Severity
- critical
- Software
- Docker
- Fixed in
- 8.31.0
- Published
- 2026-05-06
Affected versions
Until: 8.31.0
Fixed in: 8.31.0
How to fix this CVE
Update Docker to version 8.31.0 or later to patch the metadata value sanitization bypass in Gotenberg. The vulnerability allows unauthenticated attackers to inject arbitrary ExifTool commands through unsanitized metadata values, potentially leading to arbitrary file operations within the container. Immediately apply this critical patch to all systems running vulnerable versions of Docker with Gotenberg.
sudo dnf update docker-ce --releasever=latest -yDefensia detects this vulnerability
What an exploitation attempt looks like
Sample log line indicative of exploitation attempts:
POST /api/metadata with payload containing newline characters (\n or URL-encoded %0a) in metadata values followed by ExifTool pseudo-tags (-FileName, -Directory, -SymLink, -HardLink) in subsequent log entriesWAF mitigation (if patching is not yet possible)
Add this rule to your WAF to block exploitation attempts while you schedule the patch.
Implement input validation rules blocking HTTP POST requests to metadata endpoints containing unencoded newline characters or URL-encoded %0a sequences in request bodies. Additionally, restrict ExifTool pseudo-tag patterns in metadata values using regex blacklist: (?i)(^-FileName|^-Directory|^-SymLink|^-HardLink)How to check if you are affected
- Step 1: Check installed Docker version with: docker --version
- Step 2: Identify Gotenberg containers with: docker ps --filter ancestor=gotenberg --all
- Step 3: Search container logs for metadata API requests with newline characters: docker logs <container_id> | grep -E '(\\n|%0a)' | grep -i metadata
- Step 4: Verify patch by confirming Gotenberg version in running container: docker inspect <container_id> --format='{{.Config.Image}}' and cross-reference with upstream Gotenberg changelog
FAQ
What is CVE-2026-40281?
CVE-2026-40281 is a critical vulnerability in Gotenberg (Docker-based PDF API) where metadata values are not properly sanitized, allowing attackers to inject ExifTool commands via newline characters. This enables arbitrary file operations such as renaming, moving, and creating symlinks within the container filesystem without authentication.
Is CVE-2026-40281 being actively exploited?
No, CVE-2026-40281 is not currently listed on the CISA Known Exploited Vulnerabilities (KEV) catalog and no public exploits are available. However, the vulnerability's high impact and ease of exploitation make proactive patching essential.
What versions of Docker are affected by CVE-2026-40281?
All versions of Gotenberg up to and including 8.30.1 are affected. The vulnerability was introduced due to an incomplete key-sanitization fix in v8.30.1. Version 8.31.0 and later contain the complete fix.
How do I check if my server is vulnerable to CVE-2026-40281?
Run: docker ps --format '{{.Image}}:{{.ID}}' to list running containers, then docker inspect <container_id> --format='{{.Config.Image}}' to identify Gotenberg instances. Compare the image tag against version 8.31.0 — if it is earlier, your system is vulnerable.
Does Defensia detect CVE-2026-40281?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If Docker is installed on a monitored server, CVE-2026-40281 will appear in your dashboard with remediation steps.
Related Docker CVEs
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-40281. Free for 1 server.
Get started free