Memory Allocation with Excessive Size Value Affecting surrealdb-core package, versions <2.0.5>=2.1.0 <2.1.5>=2.2.0 <2.2.2


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-RUST-SURREALDBCORE-10074180
  • published9 May 2025
  • disclosed11 Apr 2025
  • creditcure53

Introduced: 11 Apr 2025

CVE NOT AVAILABLE CWE-789  (opens in a new tab)

How to fix?

Upgrade surrealdb-core to version 2.0.5, 2.1.5, 2.2.2 or higher.

Overview

Affected versions of this package are vulnerable to Memory Allocation with Excessive Size Value through the string::replace function. An attacker can exhaust server memory and cause a denial of service by crafting a query that uses a Regex to perform a string replacement, leading to unrestricted string length allocations.

Note:

This is only exploitable if the attacker has authenticated access to the database.

Workaround

This vulnerability can be mitigated by limiting the ability of untrusted clients to run the string::replace function using the --deny-functions flag or the SURREAL_CAPS_DENY_FUNC environment variable.

CVSS Base Scores

version 4.0
version 3.1