GHSA-FRHV-F8PQ-H8G2
SSRF deny-list bypass: IsPublicIP omits IPv6 benchmarking range 2001:2::/48 while blocking the IPv4 equivalent
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:L/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Remediación | Parche v8.40.0 | github.com/gotenberg/gotenberg/v8 · -6 d desde divulgación | |
| Divulgación | Publicada | GHSA-FRHV-F8PQ-H8G2 divulgada · CVSS 7.5 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
Gotenberg's private-IP SSRF guard classifies the IPv6 benchmarking range `2001:2::/48` (RFC 5180 / RFC 8219) as a public address. `IsPublicIP` in `pkg/gotenberg/outbound.go` enumerates a fixed list of non-public IPv6 prefixes, but that list omits `2001:2::/48` even though the IPv4 benchmarking counterpart `198.18.0.0/15` (RFC 2544) is explicitly blocked. When an operator enables the deny-private-IPs protection, an unauthenticated attacker who can point an outbound URL at an address in `2001:2::/48` (directly, or via a crafted DNS AAAA record) reaches that address instead of being rejected. On a host that routes this range to an internal destination, the Chromium URL conversion path returns the fetched response as a PDF, yielding a full-read SSRF.
Root Cause
Gotenberg blocks outbound requests to internal networks through a denylist of address classes. `IsPublicIP` first applies the Go standard library predicates (`IsLoopback`, `IsPrivate`, `IsLinkLocalUnicast`, `IsLinkLocalMulticast`, `IsMulticast`, `IsUnspecified`, `IsInterfaceLocalMulticast`), then iterates two custom prefix slices for ranges the standard library does not classify. The security invariant is that every address range reserved for non-internet use is treated as non-public. That invariant is violated for IPv6 benchmarking addresses: `nonPublicIPv6Prefixes` lists eight prefixes, none of which contain `2001:2::/48`. The nearest entry, Teredo `2001::/32`, covers only `2001:0000::/32`; an address such as `2001:2::1` has its first 32 bits equal to `0x20010002`, outside `0x20010000`, so it is not matched. Because no predicate and no prefix matches, `IsPublicIP` returns `true` and the address is treated as a legitimate public destination.
pkg/gotenberg/outbound.go:77-86 nonPublicIPv6Prefixes (8 entries; 2001:2::/48 absent)
pkg/gotenberg/outbound.go:95-98 nonPublicIPv4Prefixes (includes 198.18.0.0/15, RFC 2544 benchmarking)
pkg/gotenberg/outbound.go:114 func IsPublicIP (returns true for 2001:2::1)Impact
The attacker needs no authentication; Gotenberg's HTTP API requires none by default. Exploitation applies when an operator has enabled the deny-private-IPs protection for the relevant module (`--chromium-deny-private-ips`, `--api-download-from-deny-private-ips`, `--webhook-deny-private-ips`, or `--libreoffice-deny-private-ips`; each defaults to off), which is precisely the configuration in which this gap matters. It additionally requires that `2001:2::/48` be routed to a reachable destination in the deployment's network. RFC 5180 Section 4 states this range must not be routed in production IPv6 networks, so on a compliant network the request is dropped; container, cloud, lab, or benchmarking networks that do not filter the range can route it internally. Where the range is routable, the attacker gains an SSRF primitive against internal services: through the Chromium URL conversion route the fetched response is rendered and returned as a PDF, so an internal HTTP response can be exfiltrated in full. Where the webhook protection is also enabled, the same classification gap accepts an attacker-supplied webhook destination in this range, so Gotenberg delivers a POST, PUT, or PATCH request with attacker-chosen extra headers to an internal endpoint; the body is the converted output rather than arbitrary content, which limits the effect on internal state without removing it. This is the same protection and the same impact class covered by the published advisory for this guard; the omitted IPv6 benchmarking prefix is an additional unblocked path.
Proof of Concept
Classification check against the exact prefix lists shipped in pkg/gotenberg/outbound.go.
No running instance is required to demonstrate the misclassification.- Build the eight-entry `nonPublicIPv6Prefixes` list and the two-entry `nonPublicIPv4Prefixes` list exactly as defined in `pkg/gotenberg/outbound.go`.
- Evaluate `2001:2::1` against the standard library predicates and both prefix lists, mirroring `IsPublicIP`.
- Compare with the IPv4 benchmarking counterpart `198.18.0.1`.
import ipaddress
non_public_v6 = ["2002::/16", "2001::/32", "64:ff9b::/96", "64:ff9b:1::/48",
"fec0::/10", "::/96", "2001:db8::/32", "100::/64"]
non_public_v4 = ["100.64.0.0/10", "198.18.0.0/15"]
def is_public(ip):
a = ipaddress.ip_address(ip)
if any(a in ipaddress.ip_network(p) for p in (non_public_v4 if a.version == 4 else non_public_v6)):
return False
return not (a.is_loopback or a.is_private or a.is_link_local or
a.is_multicast or a.is_unspecified)
for ip in ("2001:2::1", "2001:2:ffff::1", "198.18.0.1"):
print(ip, "-> IsPublicIP =", is_public(ip))2001:2::1 -> IsPublicIP = True
2001:2:ffff::1 -> IsPublicIP = True
198.18.0.1 -> IsPublicIP = FalseAgainst a running instance started with `--chromium-deny-private-ips`, a request to `POST /forms/chromium/convert/url` with `url=http://[2001:2::1]/` passes the guard and is dialed, whereas `url=http://198.18.0.1/` is rejected.
Attack Chain
- Exposure: The attacker sends an unauthenticated request to a URL-fetching endpoint such as `POST /forms/chromium/convert/url` (`pkg/modules/chromium/routes.go:467`) with an attacker-controlled `url`.
- Control: The attacker supplies `http://[2001:2::1]/` (or a hostname whose AAAA record resolves into `2001:2::/48`). The host survives parsing as a literal IPv6 address.
- Path: The request reaches `FilterOutboundURL` (`pkg/modules/chromium/browser.go:513`), which calls `DecideOutbound` (`pkg/gotenberg/outbound.go:301`), which calls `resolveHost` (`pkg/gotenberg/outbound.go:166`); with deny-private-IPs enabled, `resolveHost` rejects any address for which `IsPublicIP` returns `false`.
- Guard: `IsPublicIP` (`pkg/gotenberg/outbound.go:114`) returns `true` for `2001:2::1`: no standard library predicate matches and none of the eight entries in `nonPublicIPv6Prefixes` (`pkg/gotenberg/outbound.go:77-86`) contains the address.
- Primitive: The address passes the check and `DecideOutbound` returns a pinned decision; `secureDialContext` (`pkg/gotenberg/outbound.go:625`) dials `2001:2::1` directly.
- Result: Where the network routes `2001:2::/48` internally, the HTTP response from the internal destination is rendered by Chromium and returned to the attacker as a PDF, a full-read SSRF against internal services.
Bypass Evidence
The relevant protection is the deny-private-IPs classification in `IsPublicIP`, which is the subject of the published advisory GHSA-86m8-88fq-xfxp (CVE-2026-45741). The strongest challenge is whether an existing entry already covers `2001:2::/48`; it does not. The nearest prefix, Teredo `2001::/32`, matches only addresses whose first 32 bits equal `0x20010000`, while `2001:2::1` has first 32 bits `0x20010002`, so `netip.Prefix.Contains` returns false. The remaining seven custom prefixes and all seven standard library predicates were each evaluated against `2001:2::1` and none match, so `IsPublicIP` returns `true`. The precise new evidence beyond the published advisory is the asymmetry with the IPv4 path: the follow-up fix added the IPv4 benchmarking range `198.18.0.0/15` to `nonPublicIPv4Prefixes` (`pkg/gotenberg/outbound.go:95-98`) and the unit tests cover `198.18.0.1` (`pkg/gotenberg/outbound_test.go:53`), but the IPv6 benchmarking range `2001:2::/48` was never added and is not exercised by any test. The misclassification is deterministic from the shipped source; live routing to an internal target depends on the deployment network and was not executed.
Affected Versions
- Ecosystem: `go`
- Package: `github.com/gotenberg/gotenberg/v8`
- Confirmed affected range: `<= 8.37.0`
- Latest release checked: `v8.37.0` (pkg.go.dev
https://pkg.go.dev/github.com/gotenberg/gotenberg/v8@v8.37.0) - Fix status: not fixed
The `nonPublicIPv6Prefixes` list has never contained `2001:2::/48`. The IPv4 benchmarking prefix was added in commit `40cf484`, which is contained in the `v8.37.0` tag, confirming the intent to block benchmarking ranges; no corresponding IPv6 entry was added, and no branch in the examined checkout adds one. The introduction boundary cannot be pinned precisely because the omission predates and persists through the custom-prefix list: earlier releases lacked the entire list, so the range was unblocked there as part of the broader original issue.
Suggested Fix
Add `2001:2::/48` to `nonPublicIPv6Prefixes` so the IPv6 benchmarking range is classified as non-public, matching the existing treatment of the IPv4 benchmarking range `198.18.0.0/15`. Because this guard is a denylist of reserved ranges, review it against the current IANA IPv6 special-purpose and IPv4 special-purpose registries so other reserved-but-routable ranges are not similarly omitted, and add a regression test for `2001:2::1` alongside the existing `198.18.0.1` case. As an interim measure where feasible, restrict outbound destinations with the allow-list option or block `2001:2::/48` at the network layer; this does not remove the classification gap.
---
Reported by zx.
Patches
Fixed on `main` for 8.40.0 by a0091e9 https://github.com/gotenberg/gotenberg/commit/a0091e94fcb28670621fd83f922fb984ccdde26d, and on `next` for 9.0.0 by ef8257d https://github.com/gotenberg/gotenberg/commit/ef8257dad1d149044b425fb42a8e50fd91abc4fc. `IsPublicIP` now treats every block the IANA special-purpose registries mark as not globally reachable as non-public: the whole IETF protocol assignments block `2001::/23`, which holds `2001:2::/48`, plus `3fff::/20`, `5f00::/16` and `100:0:0:1::/64`. On `main`, c7c09d8 https://github.com/gotenberg/gotenberg/commit/c7c09d80fe98e289642de59a4aff92ad5600648f does the same for IPv4: `0.0.0.0/8`, `192.0.0.0/24`, the documentation ranges and `240.0.0.0/4`.
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
gogithub.com/gotenberg/gotenberg/v8 |
Corregida | v8.40.0 | -6 d | v8.40.0 no afectada |
v8.40.0Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/gotenberg/gotenberg/security/advisories/GHSA-frhv-f8pq-h8g2Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
