SurrealDB Capability Bypass via the Embedded JavaScript Function Bridge (CVE-2026-134292)
Published: 2026-11-25 • Researcher: cveForge (PoC); ARSB (credit, per VulnCheck advisory); SurrealDB team (advisory GHSA-5w6j-qm42-4rc2)
- Severity
- Critical
- CVE
- CVE-2026-134292
- Category
- network
- Affected product
- SurrealDB (multi-model database server, Cargo package surrealdb)
- Affected versions
- SurrealDB 1.0.0 and later, before 4.0.0 (semver range >= 1.0.0, < 4.0.0; 4.0.0 is marked unaffected). NVD publishes no further CPE configurations; see references.
- Disclosed
- 2026-11-25
- Patch status
- Patched
Tags
References
- https://nvd.nist.gov/vuln/detail/CVE-2026-134292
- https://github.com/surrealdb/surrealdb/security/advisories/GHSA-5w6j-qm42-4rc2
- https://www.vulncheck.com/advisories/surrealdb-1.0.0-before-4.0.0-function-capability-bypass-via-javascript-built-in-bridge
- https://github.com/cveForge/CVE-2026-134292
- https://cwe.mitre.org/data/definitions/862.html
Archive entry
intelseclab/poc-archiveOn this page
Metadata
| Field | Value |
|---|---|
| Date Added | 2026-11-25 |
| Last Updated | 2026-11-24 |
| Author / Researcher | cveForge (PoC); ARSB (credit, per VulnCheck advisory); SurrealDB team (advisory GHSA-5w6j-qm42-4rc2) |
| CVE / Advisory | CVE-2026-134292 |
| Category | network |
| Severity | Critical |
| CVSS Score | 9.8 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H); 9.3 (CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N), both per VulnCheck/NVD |
| Status | PoC |
| Tags | authorization-bypass, CWE-862, SurrealDB, SurrealQL, capability-bypass, embedded-JavaScript, SSRF, RCE, authenticated, database |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | SurrealDB (multi-model database server, Cargo package surrealdb) |
| Versions Affected | SurrealDB 1.0.0 and later, before 4.0.0 (semver range >= 1.0.0, < 4.0.0; 4.0.0 is marked unaffected). NVD publishes no further CPE configurations; see references. |
| Language / Platform | Rust server with SurrealQL plus an embedded JavaScript scripting engine; the PoC client is Python 3.8+ (requests); any OS running SurrealDB |
| Authentication Required | Yes — the advisory describes authenticated users whose access to built-in functions was denied by capability configuration. Note that NVD’s CVSS 3.1 vector carries PR:N while the advisory text says authenticated; the higher score is used here. |
| Network Access Required | Yes — HTTP/WebSocket API over the network (AV:N) |
Summary
SurrealDB enforces capability restrictions on built-in SurrealQL functions, but the JavaScript bridge exposed as surrealdb.functions calls the internal synchronous and asynchronous function dispatchers without re-checking those capability rules. An authenticated user who was explicitly denied access to a built-in function can therefore execute it from embedded JavaScript, reaching scripting, outbound network access, or other restricted server-side functionality. The upstream proof of concept authenticates to the HTTP API and submits three SurrealQL statements that should be blocked by capability flags, flagging any HTTP 200 response as a bypass.
Vulnerability Details
Root Cause
SurrealDB’s capability system is designed to deny categories of behaviour, including scripting and outbound networking, to users who should not have them. The embedded JavaScript engine exposes a bridge named surrealdb.functions through which JavaScript code can invoke SurrealQL built-in functions. Per the advisory, that bridge routes calls straight into the internal fnc::synchronous() and fnc::asynchronous() dispatchers and never re-runs the function capability checks that guard the normal SurrealQL call path. The check is thus missing rather than wrong: anything reachable through the dispatchers becomes reachable from JavaScript regardless of the caller’s capability grants or denials. This is classified as CWE-862 (Missing Authorization) by NVD and VulnCheck and as CWE-863 (Incorrect Authorization) by the upstream repository metadata.
Attack Vector
The attacker needs a session for a database user that was denied one or more built-in functions by capability configuration. Over the HTTP API the account signs in at /signin to obtain a bearer token, then POSTs SurrealQL to /sql with NS and DB headers selecting the namespace and database. A statement that runs embedded JavaScript and calls the target built-in through the surrealdb.functions bridge executes it as the server, bypassing the denial. The bundled PoC instead sends three direct SurrealQL probes (an inline JavaScript function returning a process environment value, an http::get to the cloud metadata address, and a read of the internal _surrealdb record) and treats a 200 response as proof of the bypass; it does not itself use the surrealdb.functions bridge described in the advisory.
Impact
Restricted built-in functions execute with the database server’s privileges, so the practical impact depends on what was denied. Scripting and network capabilities cover arbitrary JavaScript execution inside the database process and outbound HTTP requests from the server, which enables data exfiltration, server-side request forgery against internal services or cloud metadata endpoints, and potentially code execution on the host. NVD and VulnCheck rate confidentiality, integrity and availability impact as High with unchanged scope (CVSS 3.1 9.8) and 9.3 under CVSS 4.0.
Environment / Lab Setup
OS: Any Linux/macOS host for the client; SurrealDB container or binary for the target
Target: SurrealDB >= 1.0.0 and < 4.0.0 with capability restrictions configured
(scripting and networking denied for the test user)
Attacker: Python 3.8+ with requests; same host or LAN
Tools: Docker (optional), curl, Python 3, SurrealDB CLI (optional)Setup Steps
| |
The exploit does not start the server itself; it only authenticates and sends queries. Do not run it against systems you do not own or have written authorization to test.
Proof of Concept
Step-by-Step Reproduction
- Start a vulnerable instance — run any SurrealDB build in the 1.0.0 to 3.x range (before 4.0.0) with a namespace and database you control, as in the setup steps.
- Create a restricted user — define the test user and deny the capabilities that should block scripting and outbound requests. The upstream README recommends running with –deny-scripting, –deny-net and –deny-guests; the exact flag spelling differs across 1.x, 2.x and 3.x, so verify against your build.
- Run the PoC —
python3 poc.py http://localhost:8000 <user> <password>. The script posts to /signin, takes the returned token, then POSTs each candidate statement to /sql with NS and DB headers set to test/test. - Read the verdict per query — a 200 response is printed as
[+] BYPASSEDtogether with the first 200 characters of the body; any other status is printed as[-] Blocked. - Interpret carefully — a 200 only means the statement was accepted and returned data. Confirm that the specific function was in fact denied for that user on an unpatched baseline, otherwise a 200 is expected behaviour rather than a bypass.
Exploit Code
See
poc.pyin this folder (archived upstream copy, disclaimer header added). The upstream description is inupstream-README.md.
The three probes it sends are, in order:
| |
Each is POSTed raw to /sql with a Bearer token plus NS and DB headers. The documented surrealdb.functions bridge call is not implemented by the upstream script; a faithful test of the advisory would need a JavaScript block that invokes the denied function through surrealdb.functions.
Expected Output
| |
The exact bodies depend on the build, on whether the queries are syntactically valid in that version, and on which capabilities were denied. A run with no BYPASSED lines means the configuration or version under test did not accept the probes; it does not by itself prove the target is patched.
Detection & Indicators of Compromise
- SurrealDB query or slow-query logs showing embedded JavaScript containing surrealdb.functions, or inline function definitions such as
function() { ... }()inside a RETURN statement. - POSTs to /sql carrying an inline JavaScript block or an http::get / http::post call, particularly from an account whose role or capabilities should forbid scripting or networking.
- Outbound HTTP requests originating from the database host to link-local 169.254.169.254, to RFC1918 addresses, or to unexpected external hosts.
- Reads of the internal
_surrealdbrecord namespace (type::thing on_surrealdb), which normal application queries do not need. - A /signin followed immediately by /sql traffic from the same low-privilege account with NS and DB headers set to internal namespaces.
SIEM / IDS rule (example):
| |
Remediation
| Action | Detail |
|---|---|
| Patch | Upgrade SurrealDB to 4.0.0 or later, the first version marked unaffected in the semver range; See references for the vendor advisory and confirm the fixed release note for your deployment. |
| Workaround | Deny scripting and networking capabilities for untrusted users. The upstream README recommends –deny-scripting, –deny-net and –deny-guests; flag names vary by version, so verify against your build’s CLI help. Restricting which users may run embedded JavaScript removes the reachable bridge. |
| Config Hardening | Use least-privilege database users and roles, keep the HTTP API off untrusted networks, block egress from the database host to link-local and internal ranges, and forward query/audit logs to a monitored SIEM. |
References
- CVE-2026-134292 — NVD
- SurrealDB advisory GHSA-5w6j-qm42-4rc2 — JavaScript Built-in Bridge Bypasses Function Capability Enforcement
- VulnCheck advisory — SurrealDB 1.0.0 before 4.0.0 Function Capability Bypass via JavaScript Built-in Bridge
- Source PoC repository — cveForge/CVE-2026-134292
- CWE-862: Missing Authorization
Notes
Auto-ingested from https://github.com/cveForge/CVE-2026-134292 on 2026-11-25. The repository contains a single Python script plus a README; the README is archived as upstream-README.md and the script as poc.py with the authorized-research header added. There is no LICENSE file in the repository, so the code is archived with attribution only and no license is asserted.
Review verdict: real but limited. The script is an exploit attempt, not a detector, so it was ingested, but it functions as a capability-check oracle rather than a demonstrated end-to-end exploit. It does not implement the surrealdb.functions bridge call described in the advisory; it sends three generic capability probes and treats HTTP 200 as a bypass. Its usage example authenticates as root, which makes the “low privilege” premise untested, and it neither verifies that the queried function was actually denied on that account nor demonstrates impact such as an SSRF response body or command execution. Filenames and any exploit artefacts are minimal: no lab harness, no vulnerable-version pin, and no expected-output fixtures upstream.
Status is therefore PoC (oracle/probe) rather than Weaponized: reproduce only in a lab where a restricted user and capability denials are known, and treat a 200 as a test result rather than proof of compromise. Run only against systems you own or have written authorization to test.
| |