GHSA-5X4X-2946-QR67
SSRF via JWKS URL — allow-listed hostname resolving to a private IP
Texto original en inglés · Ver en español
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:N/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-5X4X-2946-QR67 divulgada · CVSS 4.1 (GitHub) | |
| Remediación | Parche 3.2.0 | surrealdb · 0 d desde divulgación | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
SurrealDB fetches the JWKS document for a JWT or record access method over the network, gated by `--allow-net`/`--deny-net`. The check in `core/src/iam/jwks.rs` (`check_capabilities_url`) validates only the URL host string; the fetch then runs on a `reqwest` client using the default DNS resolver, with no check on the resolved addresses. An Owner can point an access method at an `--allow-net`-permitted hostname that resolves to loopback, link-local, cloud-metadata, or private address space, causing the server to issue a GET to that internal address — one a direct URL to the same IP would block.
Impact
What an attacker can do:
- With the Owner role at database level or above (the minimum to run `DEFINE ACCESS ... TYPE JWT URL` / `TYPE RECORD ... WITH JWT URL`), point an access method at an allow-listed hostname resolving to an internal address, causing a GET the allowlist was meant to block (loopback, `169.254.169.254`, RFC 1918).
- Infer internal host/port liveness from response-timing and JWKS-parse-success differences.
What it can't do:
- Read the response — the fetch is blind (body parsed only as a JWKS; failures surface as an opaque `InvalidAuth` error).
- Modify data or affect availability (a single GET).
Patches
The JWKS fetcher now uses the same capability-aware DNS resolver as the protected `HttpClient`, re-checking every resolved address and blocking private/special-use IPs unless explicitly allow-listed.
- Versions 3.2.0 and later are not affected by this issue.
Workarounds
- Use only trusted JWKS hosts that resolve to fixed public addresses, or use locally defined keys instead of a remote JWKS.
- Restrict the Owner role to trusted operators.
- Enforce network-layer egress filtering (block loopback, `169.254.0.0/16`, and internal ranges).
References
- SurrealDB Documentation — Capabilities
https://surrealdb.com/docs/surrealdb/security/capabilities - SurrealQL Documentation — DEFINE ACCESS
https://surrealdb.com/docs/surrealql/statements/define/access - `fix(core): enforce JWKS network capabilities at the resolved IP` (included in SurrealDB 3.2.0)
Acknowledgements
Thanks to @DavidCarliez https://github.com/DavidCarliez for finding and reporting this issue.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
crates.iosurrealdb |
Corregida | 3.2.0 | 0 d | 4.0.1 no afectada |
3.2.0Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/surrealdb/surrealdb/security/advisories/GHSA-5x4x-2946-qr67Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
