CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-XX7M-69FF-9CRP

SurrealDB's Poison Pill: Crashing the Database with a Single String

Alon Barad
Alon Barad
Software Engineer

Feb 13, 2026·5 min read·14 visits

Executive Summary (TL;DR)

SurrealDB embeds the QuickJS engine to allow inline JavaScript functions. A flaw in how QuickJS handles massive string literals during compilation allows an attacker to trigger a Null Pointer Dereference. By submitting a crafted SurrealQL query that generates a huge string and feeds it to the JS engine, an authenticated user can crash the server instantly. The fix involves updating the internal `rquickjs` dependency.

A critical Denial of Service vulnerability exists in SurrealDB's embedded JavaScript engine, QuickJS. By defining a scripting function containing an excessively large string literal, an attacker can trigger a Null Pointer Dereference (CWE-476) within the compilation phase. This memory safety violation bypasses Rust's safety guarantees, causing the entire database process to terminate immediately via a segmentation fault.

The Frankenstein Database

SurrealDB is the Swiss Army knife of modern databases. It wants to be everything: a document store, a graph database, and a relational powerhouse. To achieve this flexibility, it allows developers to write custom logic not just in its native SurrealQL, but also in JavaScript.

To make this happen without dragging in the massive footprint of V8 (Node.js), SurrealDB embeds QuickJS, a lightweight JavaScript engine written in C. This is where things get spicy. While SurrealDB is written in Rust—a language famous for its memory safety guarantees—it has to interface with QuickJS via Foreign Function Interfaces (FFI).

When you cross the border from Rust (Safe) to C (Unsafe), you leave your armor behind. If the C code decides to dereference a null pointer because it ran out of memory or got confused by a massive literal, Rust can't catch the panic. The operating system steps in, sees a segmentation fault, and kills the process instantly. No error log, no graceful shutdown. Just silence.

The Ghost in the Engine (Root Cause)

The vulnerability lies deep within the compilation phase of QuickJS (specifically versions prior to the patch included in rquickjs 0.11.0). When the engine parses source code, it has to allocate memory for string literals (constants) found in the script.

Here is the sequence of doom:

  1. The user provides a script containing a string literal of astronomical size.
  2. QuickJS attempts to "atomize" this string—converting it into an internal unique identifier.
  3. Due to the size, the internal allocation logic hits an edge case. It might fail to allocate memory, or it might encounter an integer overflow in the size calculation.
  4. Instead of returning an error that propagates up the stack, a function deeper in the parser returns a NULL pointer (or an invalid state representing one).
  5. The compiler, assuming the atomization succeeded, attempts to read from this pointer.

CWE-476 (Null Pointer Dereference) triggers. In a pure C environment, this is a crash. Because QuickJS is running inside the main SurrealDB thread (or a worker thread that shares the process), the OS sends SIGSEGV, and the database vanishes.

The Code: Dependency Hell

This vulnerability highlights a classic supply chain risk. SurrealDB's code didn't technically have a logic bug; its dependency did. The fix wasn't a change to the query parser, but a bump in the rquickjs crate, which wraps QuickJS for Rust.

The vulnerable code relied on rquickjs versions < 0.11.0. The patch is simple in implementation but critical in impact.

The Vulnerable State (Abstracted):

// Cargo.toml
[dependencies]
rquickjs = { version = "0.6", features = ["full"] }
// This pulls in an older, vulnerable C-based QuickJS

The Fix (Commit bcd2ece):

// Cargo.toml
[dependencies]
// Updating to 0.11.0 brings in QuickJS-NG v0.9
// which includes hardened memory checks.
rquickjs = { version = "0.11.0", features = ["full"] }

The fix is invisible to the end user's logic, but binary-wise, it replaces the engine with one that actually checks if malloc returned NULL before writing to it.

The Exploit: Building the Bomb

Exploiting this is trivially easy if you have permissions to define functions. We don't even need to send a 1GB payload over the network; we can ask SurrealDB to generate the poison pill for us using string::repeat.

The attack vector looks like this:

  1. Generate the Payload: We create a variable $bomb containing a massive string.
  2. Inject and Compile: We embed this string into a JavaScript function definition. The moment SurrealDB tries to parse this function to store it (or execute it), QuickJS chokes.

Proof of Concept (SurrealQL):

-- Step 1: Create a massive string in memory (SurrealDB handles this fine initially)
LET $payload = string::repeat("A", 50000000); 
 
-- Step 2: Define a JS function that includes this string as a literal
-- The mere act of parsing this script triggers the NPD in QuickJS
DEFINE FUNCTION fn::crash_me() {
    return "" + $payload + "";
};

When the server processes the DEFINE FUNCTION statement, it passes the body to rquickjs to compile bytecode. The compiler sees the massive string literal, fails the allocation check, dereferences NULL, and the server crashes.

The Impact: Denial of Service

This is a high-availability nightmare.

Availability: Total loss. The crash is not a caught exception; it is a process termination. If you are running a single instance of SurrealDB, your application goes offline immediately. If you are running a cluster, a persistent attacker could crash nodes sequentially or simultaneously.

Privilege Requirement: Low. Any user who can define functions or execute ad-hoc scripts can trigger this. in many configurations, this might be a standard application user.

Data Integrity: Paradoxically safe. Because the process dies so abruptly, it's unlikely to corrupt data on disk (thanks to RocksDB/TiKV transactional guarantees), but any in-flight transactions are lost.

The Fix: Upgrade or Disable

If you are running SurrealDB, you have two options. One is a fix, the other is a workaround.

1. The Patch: Upgrade to the latest version of SurrealDB (post-February 2026 builds). Ensure the release notes mention the rquickjs update to 0.11.0 or higher.

2. The Workaround: If you cannot upgrade, you must disable the scripting capability. This removes the attack surface entirely by preventing the QuickJS engine from being invoked.

Start your server with scripting disabled if your application logic allows it:

surreal start --deny-scripting

> [!NOTE] > Relying on embedded scripting engines for core database logic is always a double-edged sword. It offers power, but imports the vulnerabilities of the scripting language into your database kernel.

Official Patches

SurrealDBPull Request upgrading rquickjs

Fix Analysis (1)

Technical Appendix

CVSS Score
6.5/ 10
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
EPSS Probability
0.04%
Top 100% most exploited

Affected Systems

SurrealDB Server (versions using rquickjs < 0.11.0)SurrealDB Embedded (Rust crate)

Affected Versions Detail

Product
Affected Versions
Fixed Version
SurrealDB
SurrealDB
< 2026-02-02 buildsPost-Feb 2026 builds
AttributeDetail
CWE IDCWE-476 (Null Pointer Dereference)
Attack VectorNetwork (Authenticated)
CVSS Score6.5 (Medium)
ImpactDenial of Service (Process Crash)
ComponentQuickJS / rquickjs
Exploit StatusPoC Available

MITRE ATT&CK Mapping

T1499Endpoint Denial of Service
Impact
T1499.004Application or System Exploitation
Impact
CWE-476
NULL Pointer Dereference

A NULL Pointer Dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit.

Known Exploits & Detection

NucleiDetection Template Available

Vulnerability Timeline

Initial dependency update PR created
2026-01-21
Fix merged (rquickjs update)
2026-02-02
GHSA Advisory Published
2026-02-02

References & Sources

  • [1]GHSA Advisory
  • [2]CWE-476: NULL Pointer Dereference

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•24 minutes ago•GHSA-GR75-JV2W-4656
4.7

GHSA-GR75-JV2W-4656: Path Traversal and Sandbox Escape in LangChain File-Search Middleware and Loaders

A path traversal and sandbox escape vulnerability in LangChain and LangChain-Anthropic Python packages allows unauthenticated local attackers to access files outside the restricted directory via crafted input, symbolic links, or prefix bypasses.

Alon Barad
Alon Barad
0 views•8 min read
•about 1 hour ago•GHSA-M557-WRGG-6RP4
5.8

GHSA-m557-wrgg-6rp4: Server-Side Request Forgery via Authority Information Access (AIA) Chasing in phpseclib

The PHP Secure Communications Library (phpseclib) contains a Server-Side Request Forgery (SSRF) vulnerability due to an insecure default implementation of Authority Information Access (AIA) certificate chasing. This flaw allows remote, unauthenticated attackers to coerce applications validating user-supplied X.509 certificates into generating arbitrary outbound HTTP requests to internal networks or local interfaces.

Amit Schendel
Amit Schendel
2 views•6 min read
•about 1 hour ago•CVE-2026-45491
6.2

CVE-2026-45491: Directory Traversal via Improper Link Resolution in .NET System.Formats.Tar

A directory traversal vulnerability exists in the Microsoft .NET System.Formats.Tar library during archive extraction. When extracting a TAR archive using the TarFile.ExtractToDirectory API, the extraction engine improperly resolves symbolic links prior to file creation, allowing local unauthorized attackers to write or overwrite arbitrary files outside the target directory. This can lead to local tampering, privilege escalation, or arbitrary code execution.

Amit Schendel
Amit Schendel
7 views•6 min read
•about 2 hours ago•GHSA-GJ48-438W-JH9V
6.1

GHSA-GJ48-438W-JH9V: Client-Side HTML Sanitization Bypass in Bleach

A client-side HTML sanitization bypass vulnerability exists in the Bleach library where the formaction attribute is not recognized as a URI. This allows attackers to inject javascript: URIs when formaction is on the allowed list, resulting in Cross-Site Scripting (XSS).

Alon Barad
Alon Barad
5 views•6 min read
•about 2 hours ago•CVE-2026-53722
5.4

CVE-2026-53722: Reflected DOM-based Cross-Site Scripting (XSS) in Nuxt <NuxtLink>

A reflected DOM-based Cross-Site Scripting (XSS) vulnerability was identified in Nuxt's core <NuxtLink> component. Prior to the patched versions, the component failed to validate or sanitize the target URI schemes before directly rendering them into the 'href' attribute of native HTML anchor elements. An attacker who controls the input bound to the 'to' or 'href' properties can inject executable URI schemes, such as 'javascript:' or 'data:', leading to arbitrary script execution in the context of the user's browser session.

Amit Schendel
Amit Schendel
4 views•6 min read
•about 15 hours ago•GHSA-PW6J-QG29-8W7F
5.9

GHSA-pw6j-qg29-8w7f: State Persistence and Sensitive Credential Leakage in Tornado CurlAsyncHTTPClient

A state persistence vulnerability exists in Tornado's CurlAsyncHTTPClient component where pooled pycurl.Curl handles are reused across asynchronous requests without a complete state reset. Consequently, sensitive per-request configurations, such as client TLS certificates or proxy basic authentication credentials, persist on the shared handle. This behavior leads to subsequent requests leaking these credentials to unauthorized remote servers.

Amit Schendel
Amit Schendel
7 views•7 min read