CVE-2025-71395
mediumpriority · track · 26EPSS 0.004 · 39 %ileEUUSEPSS · scored 2026-10-28
SurrealDB versions before 2.2.2 contain a memory exhaustion vulnerability in the string::replace function that fails to restrict resulting string length when using regex patterns. An authenticated attacker can craft a malicious query to exhaust server memory through unbounded string allocations, causing denial of service.
cvss
Technical severity, 0–10. One row per scoring source.
base score 0–10 · higher = more severe · hover a vector to decode⚠ sources disagree · medium–high · 4.9–7.1
ssvc
A stakeholder decision — act, attend, or track — from exploitation and impact.
weaknesses
The CWE weakness classes this flaw belongs to.
affected products (9)
Products and version ranges known to be affected.
advisories (1)
Vendor and ecosystem advisories describing this.
- GHSA-3633-g6mg-p6qqSurrealDB memory exhaustion via string::replace using regex 2025-04-11ghsa · osvUS
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)
also known as (3)
Other names and identifiers for this entity.
sources
Which sources assert this record, and when.
references (6)
External citations — patches, advisories, analysis.
- https://github.com/surrealdb/surrealdb/security/advisories/GHSA-3633-g6mg-p6qqcnnvd
- https://www.vulncheck.com/advisories/surrealdb-before-memory-exhaustion-via-string-replacecnnvd
- https://github.com/surrealdb/surrealdb/security/advisories/GHSA-3633-g6mg-p6qqenisa_euvd
- https://www.vulncheck.com/advisories/surrealdb-before-memory-exhaustion-via-string-replaceenisa_euvd
- https://github.com/surrealdb/surrealdb/security/advisories/GHSA-3633-g6mg-p6qqVendor Advisorynvd
- https://www.vulncheck.com/advisories/surrealdb-before-memory-exhaustion-via-string-replaceThird Party Advisorynvd
Attackers weaponise vulnerabilities like this against internet-exposed services. See what is exposed on your perimeter with a free passive scan.
Free scan