GHSA-PR34-75C7-F9H3
Chromium host-resolver rules disable WebSocket private-IP enforcement
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/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-PR34-75C7-F9H3 divulgada · CVSS 5.9 (GitHub) | |
| Divulgación | Modificada | Última actualización del registro | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
An API caller can submit HTML that opens a WebSocket to a private network service.
When Gotenberg is configured with `CHROMIUM_DENY_PRIVATE_IPS=true` and any
nonempty `CHROMIUM_HOST_RESOLVER_RULES`, the renderer logs that the target is
non-public but does not block the connection. An isolated exact-image test read a
fake private WebSocket secret and rendered it into the returned PDF, while the
identical request was blocked when the unrelated resolver override was absent.
Details
Affected version and preconditions
- Repository: `https://github.com/gotenberg/gotenberg.git`
- Commit: `e4ee0f29d648f8d5a0a766dd797d108361905deb`
- Version: 8.38.1 source commit on `main` at the tested commit (same code as the 8.38.0 Docker image)
- Minimum attacker privilege: API caller able to submit attacker-controlled HTML; this is
- Victim interaction: none
- Default configuration: no
- Other conditions: the deployment enables `CHROMIUM_DENY_PRIVATE_IPS` and also
Root cause
The `--chromium-deny-private-ips` option is documented as rejecting non-public
destinations to mitigate SSRF (`pkg/modules/chromium/chromium.go:484`). Chromium
normally starts an internal pinning proxy that validates and pins every outbound
destination (`pkg/modules/chromium/browser.go:204`). WebSocket handshakes are not
surfaced through the CDP request-pausing API, so the code states that this proxy
is the only enforcement layer that can block them
(`pkg/modules/chromium/browser.go:222`).
However, setting any custom host-resolver rule disables the pinning proxy
entirely, even when a deny-private policy is active
(`pkg/modules/chromium/browser.go:194` and
`pkg/modules/chromium/browser.go:215`). The remaining WebSocket event listener
calls `FilterOutboundURL`, but on rejection it only writes a warning and cannot
abort the handshake (`pkg/modules/chromium/events.go:54` and
`pkg/modules/chromium/events.go:85`). Module validation does not reject or warn
about this incompatible option combination
(`pkg/modules/chromium/chromium.go:693`). The result is a configured private-IP
restriction that logs a warning but does not block WebSockets. The public
outbound-filtering documentation notes that custom host-resolver rules skip DNS
pinning; it does not say this makes WebSocket private-IP denial warning-only.
Remediation
Make outbound-policy enforcement fail closed when custom routing options are
present. Reject startup when an IP policy is combined with a resolver or proxy
override that removes the only WebSocket enforcement layer, or preserve an
enforcement proxy that honors the operator's routing configuration while still
validating every WebSocket destination. A warning emitted after the handshake is
not sufficient. Add integration tests for private WebSockets with host-resolver
rules, custom proxies, environment proxies, redirecting services, and Web Workers.
Proof of concept
- From a clean checkout at the tested commit, build the exact source image:
```bash
docker build --progress=plain \
--file build/Dockerfile \
--target gotenberg \
--build-arg GOTENBERG_VERSION=e4ee0f2 \
--label com.codex.review.revision=e4ee0f29d648f8d5a0a766dd797d108361905deb \
--tag codex-gotenberg:e4ee0f2 .
```
- Ensure Docker, Docker Compose, Bash, Python 3, and `pdftotext` are available.
- From this finding directory, run `./reproduce.sh`. The wrapper starts an
- The negative control uses `CHROMIUM_DENY_PRIVATE_IPS=true` without resolver
- The treatment uses the same policy and HTML plus the unrelated rule
- Confirm the summary contains `websocket_host_resolver_bypass=present` and
- Cleanup is automatic on success, failure, or interruption. After all target
Impact
The exact pinned image demonstrated server-side access to a Docker-internal
WebSocket and exfiltration of its harmless secret through an attacker-controlled
PDF. This crosses the private-network boundary that the enabled deny-private
option is intended to enforce. A deployment exposing an internal WebSocket that
returns credentials, administrative state, or privileged responses could disclose
that data to an API caller.
The finding is classified `medium`: exploitation needs a non-default combination
of a deny-private policy and custom resolver rules, plus a useful reachable
WebSocket service. The test did not demonstrate arbitrary HTTP SSRF, code
execution, real cloud-metadata access, or access to a real sensitive service. A
separate attempt to read a mounted local file was blocked by the file-URL filter,
and Chromium's DevTools endpoint used a random local port and browser identifier,
so no Critical chain was reproduced.
Provisional CVSS v3.1: `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N` (5.9). This scores the demonstrated read of a private WebSocket response; the non-default resolver configuration and useful private target are prerequisites.
Patches
Fixed on `main` for 8.40.0 by 9243257 https://github.com/gotenberg/gotenberg/commit/9243257cb442929f19602247699d47d8a37b0e4b, and on `next` for 9.0.0 by c462a2e https://github.com/gotenberg/gotenberg/commit/c462a2ebf5542005740337a6a232ab3f10ef801d. Host-resolver rules no longer turn the pinning proxy off. Gotenberg parses the rules with Chromium's `MAP` and `EXCLUDE` semantics and applies them in the outbound checks and in the proxy, so a WebSocket to a private address is refused with `CHROMIUM_DENY_PRIVATE_IPS` set, from a page and from a Web Worker. An invalid rule stops Gotenberg at startup. `--chromium-proxy-server` still hands WebSockets to the operator's proxy, and Gotenberg now logs a startup warning when it is combined with an outbound policy.
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-pr34-75c7-f9h3Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
