---
id: CVE-2025-71395
title: >-
  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
summary: >-
  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 …
severity: medium
cvss: 6.5
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H'
cwe:
  - CWE-789
vendor: surrealdb
product: surrealdb
affected:
  - surrealdb < 2.0.5
  - 'surrealdb >= 2.1.0, < 2.1.5'
  - 'surrealdb >= 2.2.0, < 2.2.2'
patched:
  - surrealdb 2.2.2
published: '2026-07-18'
updated: '2026-09-29'
sourceUpdated: '2026-09-29T19:10:00.160'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2025-71395'
references:
  - url: >-
      https://github.com/surrealdb/surrealdb/security/advisories/GHSA-3633-g6mg-p6qq
    label: disclosure@vulncheck.com
  - url: >-
      https://www.vulncheck.com/advisories/surrealdb-before-memory-exhaustion-via-string-replace
    label: disclosure@vulncheck.com
tags:
  - nvd
  - cve.org
epss: 0.0045
epssPercentile: 0.38956
ingestedAt: '2026-07-19T05:29:21.257Z'
ssvc:
  exploitation: none
  automatable: 'no'
  technicalImpact: partial
  timestamp: '2026-07-22T19:09:25.666132Z'
scores:
  nvd: 6.5
  cna: 7.1
---

## Overview

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.

## Affected

- `surrealdb < 2.0.5`
- `surrealdb >= 2.1.0, < 2.1.5`
- `surrealdb >= 2.2.0, < 2.2.2`

## Remediation

Upgrade past the affected range:

- `surrealdb 2.2.2`
