🛡️ CVE-2025-71395 — surrealdb

🟠 CVSS 8.0 — High ✅ No Known Exploit CWE-789 NVD
8.0
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

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. 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)

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs low-level privileges on the target. No user interaction is required. Rated impact: confidentiality none, integrity none, availability high.

Affected software

CVE-2025-71395 is recorded against 2 packages.

  • surrealdb
  • unknown

Timeline and source

Published on 11 April 2025 and last revised on 19 July 2026. No public exploit is currently recorded for this entry. Record sourced from NVD.

References

github.com (Web)
github.com (Web)
github.com (Web)
github.com (Package)

Details

Severity HIGH
CVSS Score 8.0
CVSS Vector CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
CWE CWE-789
Public Exploit ✅ No
Source NVD
Published 2025-04-11
Updated 2026-08-12
Modified 2026-07-19
Fix URL N/A

Affected Packages

Software From version Fixed in
surrealdb
unknown

Similar Threats

Site Security Check

Is surrealdb part of your stack?

CVE-2025-71395 is rated CVSS 8.0 High. BotEraser scans your installation against known CVE records and tells you whether this vulnerability applies to the versions you actually run.

Scan My Site Free →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.