llamaCVEVulnerability Intelligence
/
Advisory · GitHub · crates.io · surrealdb

GHSA-3633-G6MG-P6QQ

SurrealDB memory exhaustion via string::replace using regex

Parche disponible
Descargar PNG JSON
CVSS
—
high
Fuente: —
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche3 versionesPrimer parche a -1 d de la divulgación
Exposición587 dDesde la divulgación, 11 abr 2025, 9:08 a. m.
Detección584 dDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Modificada
Explotación
Remediación
Parche 2.0.5 +2
Monitoreo
Detectada
10 abr 25
11 abr 25
19 jul 26
17 nov 26
20 nov 26
10 abr 25
4 sept 25
30 ene 26
26 jun 26
20 nov 26
FechaFaseEventoDetalle
Remediación Parche 2.0.5 surrealdb · -1 d desde divulgación
Remediación Parche 2.1.5 surrealdb · -1 d desde divulgación
Remediación Parche 2.2.2 surrealdb · -1 d desde divulgación
Divulgación Publicada GHSA-3633-G6MG-P6QQ divulgada
Divulgación Modificada Última actualización del registro
Monitoreo Detectada Ingresó al índice
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

An authenticated user can craft a query using the `string::replace` function that uses a Regex to perform a string replacement. As there is a failure to restrict the resulting string length, this enables an attacker to send a `string::replace` function to the SurrealDB server exhausting all the memory of the server due to string allocations. This eventually results in a Denial-of-Service situation for the SurrealDB server.

This issue was discovered and patched during an code audit and penetration test of SurrealDB by cure53. Using CVSSv4 definitions, the severity is High.

### Impact
An authenticated user can crash the SurrealDB instance through memory exhaustion

### Patches
A patch has been created that enforces a limit on string length `SURREAL_GENERATION_ALLOCATION_LIMIT`

  • Versions 2.0.5, 2.1.5, 2.2.2, and later are not affected by this issue

### Workarounds
Affected users who are unable to update may want to limit the ability of untrusted clients to run the `string::replace` function in the affected versions of SurrealDB using the `--deny-functions` flag described within Capabilities https://surrealdb.com/docs/surrealdb/security/capabilities#functions or the equivalent `SURREAL_CAPS_DENY_FUNC` environment variable.

References

SurrealQL Documentation - DB Functions (string::replace) https://surrealdb.com/docs/surrealql/functions/database/string#stringreplace
SurrealDB Documentation - Capabilities https://surrealdb.com/docs/surrealdb/security/capabilities#functions
SurrealDB Documentation - Environment Variables https://surrealdb.com/docs/surrealdb/cli/env
#5619 https://github.com/surrealdb/surrealdb/pull/5619
#5638 https://github.com/surrealdb/surrealdb/pull/5638

Versiones

Rangos afectados

Afectada Corregida Última
surrealdb< 2.0.5
surrealdb≥ 2.1.0 < 2.1.5
surrealdb≥ 2.2.0 < 2.2.2
2.0.5
2.1.0
2.1.5
2.2.0
2.2.2
4.0.1
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
crates.iosurrealdb
Corregida 2.0.5, 2.1.5, 2.2.2 -1 d · -1 d · -1 d 4.0.1 no afectada
Versiones corregidas2.0.52.1.52.2.2
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Otrahttps://github.com/surrealdb/surrealdb/security/advisories/GHSA-3633-g6mg-p6qq
Otrahttps://github.com/surrealdb/surrealdb/pull/5619
Otrahttps://github.com/surrealdb/surrealdb/pull/5638
Otrahttps://github.com/surrealdb/surrealdb

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.