Gotenberg's patch for CVE-2026-40893 ships on April 13, 2026 as commit 46e1909, titled fix(exiftool): remove System: prefixes. The functional change is six lines added to one loop in pkg/modules/exiftool/exiftool.go: strip everything before the last colon in each metadata key, then case-fold the result, then compare against the dangerous-tag blocklist. Before April 13, the comparison ran on the raw key, and strings.EqualFold("System:FileName", "FileName") is false. ExifTool's documentation, on the page Gotenberg's source comment links to, has said for years that "a tag name may include leading group names separated by colons." The blocklist asked ExifTool nothing. ExifTool's parser did not need to ask the blocklist anything.
CVE-2026-40893: Gotenberg's Dangerous-Tag Blocklist Asked ExifTool Nothing
vendor
patterns
cve
proof of concept
The patch strips, then compares
The pre-patch loop in (*ExifTool).WriteMetadata ran the dangerous-tag check against the raw map key:
dangerousTags := []string{
"FileName", // Writing this triggers a file rename in ExifTool
"Directory", // Writing this triggers a file move in ExifTool
"HardLink", // Writing this creates a hard link in ExifTool
"SymLink", // Writing this creates a symbolic link in ExifTool
}
for key := range metadata {
for _, tag := range dangerousTags {
if strings.EqualFold(key, tag) {
delete(metadata, key)
}
}
}The April 13 commit replaces the comparison side of the inner if:
for key := range metadata {
+ // Strip ExifTool group prefixes (e.g., "System:FileName" -->
+ // "FileName") before comparing. ExifTool allows leading group
+ // names separated by colons, and treats the prefixed and bare
+ // forms identically.
+ bare := key
+ if i := strings.LastIndex(key, ":"); i >= 0 {
+ bare = key[i+1:]
+ }
for _, tag := range dangerousTags {
- if strings.EqualFold(key, tag) {
+ if strings.EqualFold(bare, tag) {
delete(metadata, key)
}
}
}The same commit grows the dangerousTags slice by one entry:
dangerousTags := []string{
- "FileName", // Writing this triggers a file rename in ExifTool
- "Directory", // Writing this triggers a file move in ExifTool
- "HardLink", // Writing this creates a hard link in ExifTool
- "SymLink", // Writing this creates a symbolic link in ExifTool
+ "FileName", // Writing this triggers a file rename in ExifTool
+ "Directory", // Writing this triggers a file move in ExifTool
+ "HardLink", // Writing this creates a hard link in ExifTool
+ "SymLink", // Writing this creates a symbolic link in ExifTool
+ "FilePermissions", // Writing this changes the file's permissions
}The CVE description names "move, rename, and change permissions for arbitrary files." Before April 13, the rename, move, and link variants were reachable through any group-prefixed alias (System:FileName, Composite:Directory, EXIF:System:SymLink), and the permissions variant was reachable directly by name. FilePermissions was not in the blocklist at all. strings.EqualFold("FilePermissions", "FileName") is false, EqualFold("FilePermissions", "Directory") is false, and so on for the other three entries. An HTTP client that sent {"FilePermissions":"777"} got a chmod(2) for free.
ExifTool's documentation, in the table the source comment links to, lists FileName, Directory, HardLink, SymLink, and FilePermissions together in its "Extra" tags group, each annotated with the syscall it performs. The April 13 commit's title says remove System: prefixes. The diff also added the fifth name to the slice. The commit message did not mention it.
The exploit primitive
The vulnerable endpoint is POST /forms/pdfengines/metadata/write, registered in pkg/modules/pdfengines/routes.go. Gotenberg's API has no authentication by default; the flag that enables it, api-enable-basic-auth, defaults to false. Any HTTP client that can reach the container can call this route.
The request is multipart/form-data with a files field carrying one or more PDFs and a metadata field carrying a JSON object. The handler unmarshals the JSON into a Go map[string]any and hands it to buildExifToolWriteArgs, which composes exiftool -overwrite_original -<key>=<value> ... <path> from the map, skipping any key the blocklist matches.
Against an unpatched Gotenberg (v8.29.0 through v8.30.x), the chain is one request:
curl -X POST http://gotenberg.internal:3000/forms/pdfengines/metadata/write \
-F '[email protected]' \
-F 'metadata={"System:FileName":"/var/lib/gotenberg/spool/inbox.pdf"}'cover.pdf is the file Gotenberg copies into a per-request temp directory. ExifTool resolves System:FileName to the FileName pseudo-tag, which it documents as performing a rename(2) of the file it is operating on. The temp PDF is now at /var/lib/gotenberg/spool/inbox.pdf. The attacker controls the source (their upload, whose bytes are entirely theirs) and the destination (their JSON), within the bounds of the gotenberg process's filesystem access.
System:HardLink does the same with link(2). System:SymLink does the same with symlink(2). System:Directory moves the file across directories. FilePermissions calls chmod(2). The advisory phrases this as "move, rename, and change permissions for arbitrary files." It is closer to "the attacker selects which *at(2) syscall the gotenberg process makes, with both arguments under their control, in one HTTP request, without authentication."
A blocklist's grammar versus ExifTool's grammar
The blocklist is a Go string slice. The check is strings.EqualFold, written by someone who has read ExifTool's documentation enough to add four (and now five) entries to the slice. The check fires when the request key, as a string, equals one of those entries under case folding.
ExifTool resolves tag names through a parser. The parser accepts the bare form, a group prefix, multiple group prefixes separated by colons, and the same forms in any case. The April 13 patch closes one of those resolution paths by stripping everything before the last colon. The blocklist still does not consult ExifTool; the post-patch loop strips the prefix and case-folds the result, then checks the resulting string against five hard-coded names. ExifTool's parser is unaware that this check has run, and the patch's strings.LastIndex is unaware of any future extension to ExifTool's tag-name grammar.
This is gate-before-canonicalize in our catalog. The check inspects the input for a forbidden form; the downstream subsystem canonicalizes the same input into that forbidden form. The patch does the right thing structurally: it canonicalizes (strips the group prefix, folds the case) before checking. The shape of the bug, before the patch, is that ExifTool's Image::ExifTool::DoSetTag did the canonicalization and Gotenberg's for key := range metadata did the checking, and they did not share a grammar.
Gotenberg has been here before. CVE-2026-40280 was the URL-scheme variant of the same pattern: the default outbound deny-list compiled ^https?://(10\.|...) as a case-sensitive byte-pattern match, and net/url.Parse lowercased the scheme inside the dial path, so HTTPS://169.254.169.254/ cleared the gate as written and reached the IMDS endpoint as parsed. CVE-2026-42596 was the host-form variant: [::ffff:127.0.0.1] did not appear in any of the deny-list's character classes, but net/netip.ParseAddr unmapped it to the loopback IPv4 the regex was written to block. CVE-2026-40893 is the same pattern, on a different parser, in the same product. Three gates, three canonicalizers downstream, three CVEs.
Five patches in sixteen days
The dangerous-tag blocklist arrived on March 28, 2026 in commit 043b158, titled fix(exiftool): arbitrary file write. It had two entries (FileName, Directory) and was implemented as delete(metadata, "FileName") and delete(metadata, "Directory"). delete on a Go map is case-sensitive. delete(metadata, "filename") does nothing when the key is filename. ExifTool processes the lowercase form just fine.
The bypass arrived three days later. Commit 15050a3 on March 31, fix(exiftool): case-insensitive comparison and expanded blocklist, switched the loop to strings.EqualFold and added HardLink and SymLink. The advisory for this fix is GHSA-qmwh-9m9c-h36m, published alongside Gotenberg v8.30.0. The same advisory notes that the original v8.29.0 blocklist had also omitted the link-creation tags entirely; the writer had read the FileName and Directory pages of the ExifTool documentation and not the adjacent ones.
The next bypass arrived on April 6, in commit 405f106 (fix(exitool): prevent control characters). At the time, Gotenberg's WriteMetadata was implemented through the go-exiftool library, which speaks ExifTool's line-based stdin protocol: one tag assignment per line. A newline embedded in a metadata key splits into two stdin lines. The first carried whatever the attacker named the key; the second carried whatever the attacker put after the newline. The commit's own source comment, on the regex it adds, says it out loud:
An attacker who controls a metadata value but not the key could otherwise inject pseudo-tags like
-FileName=,-Directory=,-SymLink=, or-HardLink=and trigger arbitrary filesystem side effects.
The same bypass arrived again on April 11, in commit 55d1952 (fix(exiftool): prevent line breaks), this time on the value side. The April 6 patch had rejected control characters in keys; values still flowed through unfiltered. A newline in a value did the same line-splitting trick.
And then April 13 brought commit 46e1909, sixteen days after the blocklist's first commit. Five distinct patches. One blocklist. Each patch closed the bypass the previous bypass-finder reported. The bypass-finder kept finding new ones because the blocklist's grammar was a finite list and ExifTool's grammar was a parser.
The blocklist was the wrong shape
The recurring fix shape, across all five patches, is "add another exception to the blocklist." Case-insensitivity is one exception, applied through strings.EqualFold. Newline-injection in keys is another, applied through safeKeyPattern. Newline-injection in values is another, applied through validateMetadataValue. Group prefixes are another, applied through strings.LastIndex(key, ":"). A missing entry for FilePermissions is another, applied by appending one more string. Each patch is a faithful response to a specific bypass. None of them changes the shape: enumerate a set of dangerous tag forms, reject inputs that match, pass the rest to ExifTool.
The alternative is an allowlist of metadata namespaces. PDF metadata lives in a finite, documented surface: the XMP packets XMP-dc, XMP-pdf, XMP-pdfx, XMP-xmp, and a handful of EXIF and IPTC tags that real PDF tooling sets. A list of accepted tag-name prefixes is on the order of thirty entries, all of them documented by Adobe and the PDF/A consortium, none of them connected to a filesystem syscall. An allowlist closes the class on the day it ships. A blocklist closes one bypass at a time.
The catalog name for "patches address symptoms; the design holds the primitive" is design-debt-driver. The component is the dangerous-tag blocklist itself. The primitive is "user JSON keys reach ExifTool's tag parser, and ExifTool's tag parser has more grammar than any enumeration will cover."
What v8.31.0 actually changed
The April 13 patch is correct for the bypasses it names. System:FileName no longer reaches ExifTool. Composite:HardLink no longer reaches ExifTool. Main:System:Directory no longer reaches ExifTool (the patch uses LastIndex, so any number of group prefixes collapse to the bare name). Bare FilePermissions no longer reaches ExifTool. On the specific surfaces Anurag Bathani reported, the patch holds.
It does not change the relationship. The current pkg/modules/exiftool/exiftool.go still has a dangerousTags slice, now five entries, checked against the post-canonicalized key. The next bypass, if one exists, will arrive on whatever ExifTool grammar feature this loop does not yet know about. The bypass will be reported, the loop will grow another line, the next minor release will close it, and the loop will still be a loop.
PoC: GHSA-62p3-hvxx-fxg4
The blocklist learned one new dangerous shape per bypass. ExifTool's grammar did not run out of shapes.