Jun 20, 2026·6 min read·15 visits
A stack overflow vulnerability in SurrealDB allows authenticated users to trigger an uncatchable process abort by submitting queries with thousands of chained binary operators. The issue is resolved in version 3.1.5 by introducing a parser-level recursion depth limit.
An authenticated denial-of-service vulnerability in SurrealDB allows remote attackers with query privileges to crash the server process. The issue arises from uncontrolled recursion during the compilation, serialization, or deallocation of exceptionally deep Abstract Syntax Trees (ASTs). While the iterative Pratt parser successfully handles long flat sequences of binary operators without triggering recursion limits, the resulting AST structure causes stack overflow in downstream recursive tree-walking components.
SurrealDB is a multi-model database engine written in Rust that processes queries through its custom query language, SurrealQL. Plaintext queries are processed by a syntactic analyzer that translates statements into an Abstract Syntax Tree (AST) before compiler lowering and execution. The primary attack surface resides in endpoints exposing query-execution capabilities, specifically the HTTP /sql and WebSocket /rpc endpoints.
This vulnerability, tracked under GHSA-jv2j-mqmw-xvv5, is classified under CWE-674 (Uncontrolled Recursion) and CWE-400 (Uncontrolled Resource Consumption). It allows an authenticated user with low privileges to crash the database engine by executing a query containing a highly nested or extremely long flat chain of binary operators (e.g., thousands of additions or logical comparisons).
The impact is a total denial of service (DoS) affecting the SurrealDB node. Because SurrealDB operates as a single-process server, a crash terminates all active client connections and transactions across all database instances, namespaces, and tenants hosted on the affected system.
The root cause of this vulnerability lies in an architectural mismatch between the iterative query-parsing phase and the subsequent recursive AST-processing phases. SurrealDB's syntax parser uses a Pratt parser to handle operator precedence when parsing flat sequences of expressions and operators. Pratt parsing is executed iteratively using loops to append binary operators directly onto the spine of the AST.
Because this parsing phase operates iteratively rather than recursively, it successfully avoids standard call-stack limits or query-recursion guards. The parser processes arbitrarily long expressions without exhausting the call stack, producing an AST of arbitrary depth. For example, a query containing 50,000 chained addition operations yields a binary AST structure with a depth of 50,000 levels.
After parsing, downstream components walk the resulting deep AST to lower it to execution bytecode, serialize it for logs, or deallocate it from memory. These components perform recursive tree-walking operations. In Rust, the default deallocation (Drop implementation) for nested heap structures recursively destroys child nodes. Walking a 50,000-deep tree requires 50,000 nested stack frames, which quickly exhausts the typical 2MB stack space allocated to thread execution, triggering an uncatchable operating system-level stack overflow and a process abort.
The vulnerable implementation allowed the Pratt parser to build arbitrary tree depths because it lacked checks against the resulting AST height. Downstream components relied on standard recursion, which is highly sensitive to excessive nested structures. This code block shows how the Pratt parser built expression nodes iteratively, neglecting to validate overall depth constraints:
// Vulnerable parser pattern
fn parse_expr(&mut self, precedence: Precedence) -> Result<Expression, Error> {
let mut left = self.parse_primary()?;
while precedence < self.peek_precedence() {
// Iterative loop permits infinite chaining
// of binary operators, producing nested AST nodes
left = self.parse_infix(left)?;
}
Ok(left)
}The security patch introduced in SurrealDB version 3.1.5 resolves this vulnerability by establishing a strict recursion-depth budget during expression parsing. The expr_recursion_limit parameter (configurable via SURREAL_MAX_EXPRESSION_PARSING_DEPTH) is enforced directly in the parser logic. This prevents the construction of over-deep ASTs, raising a syntax error before any recursive traversals can be executed:
// Patched parser pattern
fn parse_expr(&mut self, precedence: Precedence, depth: u32) -> Result<Expression, Error> {
// Enforce depth limit to prevent downstream stack overflow
if depth > self.expr_recursion_limit {
return Err(Error::MaxExpressionDepthExceeded);
}
let mut left = self.parse_primary(depth + 1)?;
while precedence < self.peek_precedence() {
left = self.parse_infix(left, depth + 1)?;
}
Ok(left)
}This fix is complete because it addresses the issue at the ingestion layer, ensuring that no downstream compiler, serializer, or memory-cleanup operation ever encounters an AST that exceeds stack capacity.
To exploit this vulnerability, an attacker must have valid credentials with permission to execute arbitrary SurrealQL queries. The attack is performed by sending a single, malformed query consisting of a highly repetitive sequence of binary operators, such as addition (+) or logical operators (AND, OR). This payload can be transmitted via HTTP POST to the /sql endpoint or via persistent WebSocket frames to /rpc.
While the HTTP endpoint enforces a default 1 MiB body limit, a carefully crafted payload well below this limit can easily overflow the 2MB thread stack. The WebSocket /rpc endpoint is a highly reliable delivery vector because it often permits larger payloads. The attack sequence operates as follows:
No specialized tools are required. The following Python execution script demonstrates how a low-privileged authenticated session can trigger the crash:
import requests
url = "http://localhost:8000/sql"
headers = {"Accept": "application/json", "NS": "test", "DB": "test"}
# Generate deep operator chain
payload = "RETURN 1" + " + 1" * 45000 + ";"
try:
response = requests.post(url, data=payload, headers=headers, auth=("user", "pass"))
print("Status:", response.status_code)
except requests.exceptions.ConnectionError:
print("[+] Success: Connection dropped. SurrealDB process terminated.")The impact of this vulnerability is confined to service availability. Because the operating system terminates the process immediately following a stack overflow, the entire database engine halts. The vulnerability does not allow remote code execution or data extraction, nor does it result in database file corruption, since the crash occurs before transaction commit phases.
The CVSS v3.1 score is calculated as 6.5 (Medium). The score is limited by the requirement of valid credentials (PR:L). However, for multi-tenant SaaS environments or applications exposing raw query endpoints to low-privileged users, the impact is severe. An attacker can repeatedly execute the exploit to maintain a persistent state of denial of service, blocking all database transactions on the targeted host.
The definitive fix for this vulnerability is upgrading SurrealDB to version 3.1.5 or later. If immediate upgrading is not possible, administrators should implement the following workarounds to reduce risk:
Enable the --deny-arbitrary-query command-line capability flag. This restriction blocks ad-hoc user query execution, mitigating the risk from non-admin accounts.
Implement ingress payload limitations on reverse proxies (e.g., NGINX or Envoy) to drop HTTP POST requests and WebSocket frames that exceed 50 KB, preventing large nested operator sequences from reaching the parser.
Configure process supervision policies using systemd or Kubernetes restart policies. Ensure the database process restarts automatically on failure using configuration flags such as Restart=on-failure in the systemd service file.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
SurrealDB SurrealDB | >= 3.0.0, < 3.1.5 | 3.1.5 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-674, CWE-400 |
| Attack Vector | Network |
| CVSS v3.1 Score | 6.5 (Medium) |
| Exploit Status | Proof-of-Concept |
| CISA KEV Status | Not Listed |
| Impact | Denial of Service (Process Abort) |
The software directs the execution flow using recursion, but does not limit the number of recursive steps, leading to stack consumption and process termination.
CVE-2026-69192 is a critical parser differential vulnerability in the 'ip-address' JavaScript library (versions <= 10.3.0). The library parses IPv4 octets containing leading zeros as base-10 (decimal), whereas standard system resolvers and web environments parse them as base-8 (octal). This discrepancy allows remote attackers to bypass SSRF guards and route malicious requests to internal RFC 1918 networks.
A high-severity security vulnerability has been identified within the Angular compiler's internationalization (i18n) metadata collection and translation pipeline. Angular implements strict defenses against client-side execution injection by validating standard attribute and property bindings. However, when parsing elements containing both i18n translation attributes and inline event-handler elements (such as `i18n-onerror`), the compiler failed to assert the safety of the target attribute. Consequently, compromised or untrusted localization translation source files can supply arbitrary JavaScript payloads that replace static event-handler bindings. This arbitrary code is compiled directly into the localized build bundle and executed dynamically by the web browser, bypassing runtime sanitization, security checks, and standard binding constraints.
A directory traversal and arbitrary file read vulnerability exists in PostCSS due to an incomplete fix of CVE-2026-45623. When parsing a CSS file containing a sourceMappingURL comment with the 'from' parameter unset, path traversal and absolute path validations are bypassed, enabling attackers to read arbitrary local .map files.
CVE-2026-69152 is a high-severity Denial of Service (DoS) vulnerability in brace-expansion that allows remote, unauthenticated attackers to cause a process crash or infinite thread-blocking condition. The vulnerability stems from a complete mitigation bypass of the security checks implemented for CVE-2026-14257.
An in-depth technical analysis of CVE-2026-68945, a high-severity security vulnerability in Angular's `@angular/common/http` package. The flaw stems from an ambiguity in how query parameters are serialized to generate cache keys during Server-Side Rendering (SSR) within the `HttpTransferCache` component. By failing to encode delimiters and implicitly coercing arrays to comma-joined strings, the serialization mechanism yields identical cache keys for distinct requests, facilitating State Poisoning and Cross-Request Response Reuse.
A critical heap out-of-bounds (OOB) write vulnerability exists in the Linux kernel's IPv6 RPL (Routing Protocol for Low-Power and Lossy Networks) Segment Routing Header (SRH) processing logic. The vulnerability is located within net/ipv6/exthdrs.c, specifically in the ipv6_rpl_srh_rcv function. Under specific circumstances, when a packet containing a compressed RPL Source Routing Header is processed, segment swapping can reduce the common-prefix length, causing the recompressed header to grow. Because the kernel fails to validate available headroom on intermediate segments, a buffer underflow occurs during skb_push. This leads to an integer wrap in the MAC header offset pointer during MAC header rebuilding, causing a 14-byte out-of-bounds memory write roughly 64 KiB past the socket buffer.