GHSA-5353-8CWJ-GFCJ
Allow-list prefix match bypasses deny-private-ips (SSRF)
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Remediación | Parche v8.37.0 | github.com/gotenberg/gotenberg/v8 · -61 d desde divulgación | |
| Divulgación | Publicada | GHSA-5353-8CWJ-GFCJ divulgada · CVSS 8.6 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
When an operator sets a Chromium (or downloadFrom / webhook) allow-list together with `--chromium-deny-private-ips=true`, Gotenberg's `DecideOutbound` treats any `regexp2.MatchString` hit on the full URL as `{Bypass: true}` and skips the private/public IP-class checks. A typical pattern such as `^http://trusted\.example\.com` (start-anchored, not host-terminated) therefore matches suffix hosts like `http://trusted.example.com.evil.internal/` and userinfo URLs like `http://trusted.example.com@<private-ip>/`. Chromium then fetches the attacker-chosen host and returns the body in the PDF.
Affected
- Product: Gotenberg (`github.com/gotenberg/gotenberg/v8`)
- Version tested: 8.36.0, tested on a local Docker container (`gotenberg/gotenberg:8.36.0`)
Impact
An unauthenticated caller (default Gotenberg API has no authentication) can make the container fetch hosts that only prefix-match the allow-list, including names the attacker points at RFC1918, loopback, or link-local metadata, and read the response back in the converted PDF. Direct use of the private IP is correctly refused; the prefix/suffix name is not.
`downloadFrom` uses the Go HTTP client (not the Chromium pinning proxy), so the userinfo form also reaches the private host.
Steps to reproduce
Start Gotenberg 8.36.0 with:
--chromium-allow-list '^http://trusted\.example\.com'
--chromium-deny-private-ips=true
--api-download-from-allow-list '^http://trusted\.example\.com'
--api-download-from-deny-private-ips=trueResolve `trusted.example.com.evil.internal` to an internal HTTP service (attacker DNS, or container extra_hosts in a lab).
Control — private IP is refused:
POST /forms/chromium/convert/url
url=http://<private-ip>:8000/Observed: HTTP 403 Forbidden.
Attack — suffix host matches the allow-list prefix:
POST /forms/chromium/convert/url
url=http://trusted.example.com.evil.internal:8000/Observed on 8.36.0 (local Docker): HTTP 200 and a PDF of the internal page.
Related path (`downloadFrom`, Go client):
POST /forms/chromium/convert/html
downloadFrom=[{"url":"http://trusted.example.com@<private-ip>:8000/file"}]The Go client fetches the private host. The same URL without userinfo (`http://<private-ip>:8000/file`) is 403 and is never fetched.
Notes that are not working bypasses against a caret-anchored pattern:
- Query-string embedding (`http://<private-ip>/?q=http://trusted.example.com`) returns 403.
- Chromium URL-userinfo is later blocked by the pinning proxy, which rebuilds the URL from `Host` (no userinfo).
Root cause
`DecideOutbound` in `pkg/gotenberg/outbound.go` runs the operator allow-list with `regexp2.MatchString` against the normalized full URL. On a hit it returns `OutboundDecision{Bypass: true}` before host resolution, so `WithDenyPrivateIPs` / `WithDenyPublicIPs` never run. Consumers (Chromium pinning proxy, `downloadFrom`, webhook, LibreOffice proxy) then dial the attacker-chosen host.
Allow-list match skipping the IP check is documented as intentional. Matching the whole URL string makes a hostname prefix or userinfo enough to trigger that bypass.
Suggested fix
- Match allow-lists against scheme+host (or require a host terminator), not an unanchored-at-end match on the full URL.
- Still apply IP-class checks after an allow-list hit instead of returning `{Bypass: true}`.
- Reject URL userinfo before matching.
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.37.0 | -61 d | v8.40.0 no afectada |
8.37.0v8.37.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-5353-8cwj-gfcjLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
