CVE-2025-71395
Received Received - Intake

Memory Exhaustion in SurrealDB String Replace Function

Vulnerability report for CVE-2025-71395, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-07-18

Last updated on: 2026-07-18

Assigner: VulnCheck

Description

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 Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-07-18
Last Modified
2026-07-18
Generated
2026-07-18
AI Q&A
2026-07-18
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 3 associated CPEs
Vendor Product Version / Range
surrealdb surrealdb to 2.2.2 (exc)
surrealdb surrealdb to 2.1.5 (exc)
surrealdb surrealdb to 2.0.5 (exc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-789 The product allocates memory based on an untrusted, large size value, but it does not ensure that the size is within expected limits, allowing arbitrary amounts of memory to be allocated.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

CVE-2025-71395 is a memory exhaustion vulnerability in SurrealDB versions before 2.2.2. It occurs in the string::replace function when regex patterns are used. The function fails to limit the resulting string length, allowing an attacker to craft malicious queries that cause unbounded memory allocation. This leads to server memory exhaustion and denial of service.

Detection Guidance

To detect this vulnerability, monitor SurrealDB server logs for excessive memory usage or crashes during query processing. Check for queries using the string::replace function with regex patterns. Use system monitoring tools like 'top', 'htop', or 'ps' to observe memory consumption spikes. Ensure SurrealDB versions are updated to 2.2.2 or later.

Impact Analysis

An authenticated attacker can exploit this to crash the SurrealDB server by causing memory exhaustion. This results in downtime and loss of service availability for users relying on the database. Systems with high query volumes are particularly vulnerable.

Compliance Impact

This vulnerability primarily impacts system availability by causing memory exhaustion and potential server crashes, which could lead to service disruptions. For compliance standards like GDPR and HIPAA, which require data availability and integrity, such disruptions may violate availability requirements. However, the vulnerability itself does not directly expose or leak data, so confidentiality impacts are minimal.

Mitigation Strategies

Immediately update SurrealDB to version 2.2.2 or later. If updating is not possible, restrict access to the string::replace function using the --deny-functions flag or set SURREAL_CAPS_DENY_FUNC environment variable. Limit user access to authenticated sessions only and monitor server memory usage closely.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2025-71395. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart