Skip to main content

SurrealDB CVE-2025-71395

| EUVDEUVD-2025-210486 HIGH
Memory Allocation with Excessive Size Value (CWE-789)
2026-07-18 VulnCheck GHSA-849x-5qr7-wxfm
7.1
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Authenticate to SurrealDB endpoint
  2. Delivery
    Craft string::replace regex query
  3. Exploit
    Submit query to server
  4. Execution
    Trigger unbounded string allocation
  5. Persist
    Exhaust server memory
  6. Impact
    Crash database (denial of service)

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Memory allocation limits
Exploitation Conditions

Exploitation requires an authenticated session (CVSS PR:L) with the ability to run SurrealQL queries that invoke the string::replace function with a regex pattern, against a vulnerable version (before 2.0.5, 2.1.0-2.1.4, or 2.2.0-2.2.1). Limiting factors: the attacker must be able to authenticate and must not be blocked by capability restrictions - deployments that already deny string::replace via --deny-functions / SURREAL_CAPS_DENY_FUNC, or that do not expose query access to untrusted users, are not practically exploitable. No user interaction and no administrative privilege beyond a function-capable authenticated account are needed.

Impact

The provided CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:H, score 7.1 High) describes a low-complexity, network-reachable attack that requires authentication (PR:L), needs no user interaction, and produces high availability impact with zero confidentiality or integrity impact - a pure DoS. No EPSS score, KEV entry, POC, or SSVC data was supplied, so exploitation probability cannot be quantified from the input, and there is no public exploit identified at time of analysis nor evidence of active exploitation. Real-world priority is moderate rather than critical: the requirement for a valid, function-capable authenticated session narrows who can trigger it, but the attack itself is trivial (a single crafted query) and the outcome is a full server crash, so any deployment that grants query access to untrusted or semi-trusted principals should treat this as a genuine availability risk and not dismiss it as a high-CVSS-but-low-real-risk issue.

Exploit ScenarioDerived

An attacker holding valid credentials - or having compromised a low-privilege application account - connects to the SurrealDB endpoint and submits a single SurrealQL query invoking string::replace with a regex pattern crafted to expand the output string without bound. The server allocates memory until it is exhausted and the process is killed, taking the database offline for all users; no elevated privileges or user interaction are required, and no public exploit code is needed to reproduce it given the low attack complexity (AC:L).

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 18, 2026

Denial of service in SurrealDB before 2.2.2 lets an authenticated user crash the database by calling the string::replace function with a regex pattern that produces an unbounded output string, exhausting server memory. The flaw spans the 2.0.x, 2.1.x, and 2.2.x release lines and was discovered during a cure53 security audit; there is no public exploit identified at time of analysis and it is not listed in CISA KEV. Impact is availability-only with no confidentiality or integrity loss, rated CVSS 4.0 7.1 High.

RemediationAI

Upgrade to the fixed release on your branch - SurrealDB 2.0.5, 2.1.5, or 2.2.2 (or later) - each of which enforces a string-length ceiling via SURREAL_GENERATION_ALLOCATION_LIMIT; the fixes landed in pull requests https://github.com/surrealdb/surrealdb/pull/5619 and https://github.com/surrealdb/surrealdb/pull/5638. If immediate upgrade is not possible, the vendor-recommended workaround is to prevent untrusted clients from calling the vulnerable function by denying it in SurrealDB capabilities using the --deny-functions flag or the equivalent SURREAL_CAPS_DENY_FUNC environment variable (see https://surrealdb.com/docs/surrealdb/security/capabilities#functions and https://surrealdb.com/docs/surrealdb/cli/env); the side effect is that any legitimate application logic relying on string::replace will stop working, so scope the deny rule to that specific function rather than blanket-denying string functions. As additional containment, restrict database access to trusted authenticated principals and run SurrealDB under an OS/container memory limit so a single crash does not destabilize the host.

Affected VersionsENISA

surrealdb 0 <2.0.5
surrealdb 0 <2.1.5
surrealdb 0 <2.2.2

Affected Packages

cargo surrealdb fix: 2.0.5, 2.1.5, 2.2.2

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in cargo

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

SurrealDB is a Rust-based multi-model database that exposes the SurrealQL query language, which ships built-in string functions. The string::replace function accepts a regular-expression pattern for match-and-replace, but the implementation did not cap the size of the resulting allocated string. This is a textbook CWE-789 (Memory Allocation with Excessive Size Value): an attacker-controlled operation drives an allocation whose size is not bounded against any limit, so a query that expands a string enormously forces the server to allocate memory until the process is starved. The remediation adds a configurable ceiling exposed as SURREAL_GENERATION_ALLOCATION_LIMIT. The affected component is cpe:2.3:a:surrealdb:surrealdb across the vulnerable version ranges.

Know when Surrealdb gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (VulnCheck) PRIMARY 7.1 HIGH
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
vuln.today AI 6.5 MEDIUM

Network-reachable low-complexity query needing a valid low-privilege authenticated session (PR:L), no interaction, availability-only impact so C:N/I:N/A:H.

3.1 AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
Low
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
Patch available
Jul 18, 2026 - 15:17 EUVD
CVE Published
Jul 18, 2026 - 13:10 cve.org
HIGH 7.1

DescriptionCVE.org

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.

Executive ViewAI

Why It Matters

SurrealDB versions 2.0.x through 2.2.0 contain a database crash vulnerability exploitable by authenticated users, creating unplanned downtime risk for applications relying on affected instances. This disrupts service availability without compromising data confidentiality or integrity. Organizations must immediately restrict database access and coordinate with SurrealDB for patch availability.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations: (1) Network segmentation-restrict database connectivity to trusted application servers via firewall rules only; (2) Access enforcement-require strong authentication for all database users, audit roles monthly, remove unnecessary administrative privileges; (3) Monitoring and alerting-enable query logging with automated alerts for anomalous database access patterns; (4) Resource protection-set memory limits and configure automatic failover or restart on threshold breach; (5) Connection pooling with configurable query timeouts to constrain resource exhaustion exposure.

Threat Intelligence Overview

EPSS Score
0.2%
Top 86% exploitable
Prevalence
Low
emerging niche database, limited enterprise production footprint versus established DBs
Social Media
1
Sightings
Data Quality
6 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact
High

Priority Score

36
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +36
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

CVE-2025-71392 CRITICAL
9.4 Jul 18

Privilege escalation via second-order SurrealQL injection in SurrealDB before 2.0.5, 2.1.5, and 2.2.2 lets an authentica

CVE-2026-134292 CRITICAL
9.3 Nov 21

SurrealDB versions 1.0.0 through 3.x (before 4.0.0) fail to enforce built-in function capability checks inside the embed

CVE-2026-63756 CRITICAL
9.2 Jul 20

Privilege escalation in SurrealDB before v3.1.0 lets unauthenticated attackers hijack the privileges of concurrently-act

CVE-2026-134299 HIGH
8.7 Nov 21

Memory exhaustion in SurrealDB 3.0.4 through 3.x lets unauthenticated remote clients pin up to 64 MiB of in-flight WebSo

CVE-2026-134293 HIGH
8.8 Nov 21

SQL injection in the Model Context Protocol (MCP) server component of SurrealDB 3.1.0 through 3.x (fixed in 4.0.0) allow

CVE-2026-134295 HIGH
8.7 Nov 21

Authenticated tenants of SurrealDB 3.0.0 through 3.x can escape key-based ACL boundaries in direct filesystem buckets an

CVE-2026-134291 HIGH
8.7 Nov 21

Filesystem bucket path traversal in SurrealDB 3.0.0 before 4.0.0 allows an attacker with bucket-operation access to read

CVE-2026-137490 HIGH
8.7 Nov 26

SurrealDB releases before 4.0.0 fail to check query capability inside the embedded JavaScript bridge, so a low-privilege

CVE-2026-134309 HIGH
8.7 Nov 21

SurrealDB 1.0.0 through 3.x lets an authenticated user with only the database-level VIEWER role read, modify, and delete

CVE-2026-121417 HIGH
8.8 Nov 03

Use-after-free in SurrealDB Core before 3.3.0 can crash or corrupt memory in Rust applications that embed the database a

CVE-2026-134294 HIGH
8.7 Nov 21

Cross-bucket file disclosure and modification on Windows affects SurrealDB versions 3.0.0 up to but not including 4.0.0

CVE-2026-63760 HIGH
8.7 Jul 20

Denial of service in SurrealDB before 3.1.0 lets an unauthenticated remote attacker crash the database with a single Web

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy