GHSA-JWR6-6444-28XV
Denial of Service via malformed SurrealML model import
Texto original en inglés · Ver en español
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:N/A:H
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-JWR6-6444-28XV divulgada · CVSS 4.9 (GitHub) | |
| Divulgación | Modificada | Última actualización del registro | |
| Remediación | Parche 3.1.6 | surrealdb · 61 d desde divulgación | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
An authenticated system user holding the Owner role (at root, namespace, or database level, scoped to the target database) can crash a SurrealDB server by uploading a small malformed `.surml` file to the `/ml/import` endpoint.
The uploaded bytes are passed directly into the SurrealML header parser, which used unchecked `unwrap()` calls and array indexing on attacker-controlled header fields. A malformed field — for example a non-numeric input-dimensions value — panics during header parsing. Because `surrealdb-core` is built with `panic = 'abort'`, the panic terminates the entire server process.
Impact
What an attacker can do:
- With the Owner role (at root, namespace, or database level, scoped to the target database), crash the entire server with a single small malformed `.surml` upload to `/ml/import`.
- Deny service to every namespace and database on that instance until it is restarted — because `surrealdb-core` is built with `panic = 'abort'`, the panic aborts the whole process, not just the request.
What it can't do:
- Reach this code path without the Owner role — record/scope users and users holding only the Editor or Viewer role cannot call `/ml/import`.
- Affect confidentiality or integrity — the crash occurs during import parsing, before the model is stored (availability only).
- Affect deployments built without the `ml` feature, or that do not expose the `/ml/import` route.
Patches
A patch has been introduced that makes the SurrealML header parsers fail closed: malformed input-dimensions, origin, and output/normaliser fields now return a structured `BadRequest` error instead of panicking, so a malformed upload is rejected with an error response rather than crashing the server.
- Versions 3.1.6 and later are not affected by this issue.
Workarounds
Users unable to patch should consider the following workarounds:
- Build or deploy without the `ml` feature if machine-learning model import/export is not required.
- Grant the Owner role sparingly; only Owners can import models, so callers without it cannot reach the vulnerable code path.
- Run SurrealDB under a process supervisor that restarts it on exit (e.g. Kubernetes, systemd `Restart=on-failure`, or a Docker restart policy), so the server recovers immediately after a crash. This limits downtime but does not prevent the crash.
References
- DEFINE MODEL
https://surrealdb.com/docs/surrealql/statements/define/model - SurrealDB Documentation — Capabilities
https://surrealdb.com/docs/surrealdb/security/capabilities - `fix(surrealml): reject malformed model headers instead of panicking` (included in SurrealDB 3.2.0 and backported to 3.1.6)
- surrealdb/surrealml
https://github.com/surrealdb/surrealml— the standalone `surrealml-core` crate carries the same parser; the fix must be mirrored there. - GHSA-wjjj-24cx-f28g
https://github.com/surrealdb/surrealdb/security/advisories/GHSA-wjjj-24cx-f28g— related `panic = 'abort'` denial-of-service in RPC handling.
Acknowledgements
Thank you to sondt99 https://github.com/sondt99 for reporting this issue.
### Credits
- Thai Son Dinh from VinSOC Labs (R&D)
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.1.6 | 61 d | 4.0.1 no afectada |
3.1.6Arsenal 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-jwr6-6444-28xvLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
