Loading advisory.
Loading advisory.
SurrealDB memory exhaustion via string::replace using regex
An authenticated user can craft a query using the string::replace function that uses a Regex to perform a string replacement.
Published 2025-04-11 14:08 UTC · Modified 2026-10-29 21:15 UTC
Severity and EPSS are shown separately. Helm does not combine them into one score. How tiers work
| Package | Ecosystem | Affected | Fixed in | Upgrade command |
|---|---|---|---|---|
| surrealdb | crates.io | >= 2.2.0, < 2.2.2 >= 2.1.0, < 2.1.5 < 2.0.5 | 2.2.2, 2.1.5, 2.0.5 | cargo add surrealdb@2.2.2cargo add surrealdb@2.1.5cargo add surrealdb@2.0.5 |
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.
An authenticated user can crash the SurrealDB instance through memory exhaustion
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
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 or the equivalent SURREAL_CAPS_DENY_FUNC environment variable.
SurrealQL Documentation - DB Functions (string::replace) SurrealDB Documentation - Capabilities SurrealDB Documentation - Environment Variables #5619 #5638
No public exploit code known to Helm's sources (Nuclei templates, Metasploit, Exploit-DB and PoC-in-GitHub). That does not mean none exists.
One EPSS score on record: 0.004 on 2026-11-24.
| Date | Score | Previous | Model |
|---|---|---|---|
| 2026-11-24 | 0.004 | first score | v2026.06.15 |