Detect SurrealDB Embedded JavaScript Function Capability Bypass (CVE-2026-134292) in Splunk
Detects potential exploitation of CVE-2026-134292, a capability check bypass (CWE-862, CVSS 9.3) in SurrealDB versions 1.0.0 before 4.0.0. The embedded JavaScript scripting engine's surrealdb.functions bridge calls internal built-in functions without re-applying the configured function capability checks. An authenticated user denied access to restricted built-ins in SurrealQL can call them from within a JavaScript function body and bypass the server's function-capability enforcement. Detection focuses on SurrealQL/HTTP activity that defines or invokes JavaScript functions and on the downstream network effects of bypassed built-ins.
MITRE ATT&CK
SPL Detection Query
``` df00tech DF00-6f10b6fa17 · https://df00tech.com/detections/CVE-2026-134292 · licence: https://df00tech.com/detections/licence ```
(index=network OR index=db sourcetype IN ("surrealdb:log","syslog","linux:container")) (surrealdb OR surreal)
| search ("surrealdb.functions" OR "function::script" OR "<js>" OR "function() {") ("http::" OR "crypto::" OR "capability" OR "DEFINE FUNCTION")
| rex field=_raw "(?<js_call>http::\w+|crypto::\w+|surrealdb\.functions\.\w+)"
| stats count min(_time) as firstSeen max(_time) as lastSeen values(js_call) as invoked_builtins by host, source
| where count > 0
| convert ctime(firstSeen) ctime(lastSeen) Correlates SurrealDB log events where a JavaScript function body references the surrealdb.functions bridge together with restricted built-ins (http/crypto), indicating a likely capability bypass attempt.
Data Sources
Required Sourcetypes
False Positives & Tuning
- Legitimate scripted functions written by application developers
- Lab/staging SurrealDB nodes with scripting intentionally enabled
- Log lines mentioning http:: in unrelated URL fields
Other platforms for CVE-2026-134292
Testing Methodology
Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are further down this page.
- Test 1 SurrealDB JS function invoking http built-in via bridge
Expected signal: SurrealDB server log line referencing surrealdb.functions and http::get; outbound connection attempt to 127.0.0.1:9999 from the surreal process.
- Test 2 DEFINE FUNCTION with embedded JS calling restricted built-in
Expected signal: DEFINE FUNCTION log event containing <js> body and surrealdb.functions.crypto:: reference.
- Test 3 SurrealDB RPC JS scripting invocation
Expected signal: Reverse-proxy/access log for POST /rpc with surrealdb.functions and http::post in the body; SurrealDB log of JS execution.
Response Playbook
Triage
- Confirm the SurrealDB server version: versions 1.0.0 up to (but not including) 4.0.0 are vulnerable. Check the running binary with `surreal version` or the /version HTTP endpoint.
- Determine whether the embedded JavaScript scripting engine is enabled and whether function capabilities (allow/deny lists) are configured; the bypass only matters when restricted built-ins are supposed to be denied.
- Review the flagged query/log line: identify which built-in (http::, crypto::, etc.) was invoked through the surrealdb.functions bridge and whether it corresponds to a function the capability policy intended to deny.
- Identify the authenticated principal / source IP that submitted the JavaScript function and whether it is an expected application identity.
Containment
- Upgrade SurrealDB to 4.0.0 or later, where the capability check is re-applied in the JS functions bridge.
- As an interim mitigation, disable the embedded JavaScript scripting engine (do not start the server with scripting enabled) or enforce `--deny-functions` / capability flags and restrict network egress from the SurrealDB host.
- Rotate any credentials, API keys, or secrets that may have been reachable via bypassed crypto::/http:: built-ins.
Evidence Collection
- Capture the full SurrealQL statement(s) and JavaScript function bodies from server logs and any reverse-proxy /sql and /rpc access logs.
- Preserve outbound network connection logs from the SurrealDB host for the relevant window to assess http:: exfiltration or SSRF.
- Export the SurrealDB configuration (capability flags, scripting setting) and version metadata.
Escalation Criteria
- !Escalate to incident response if a bypassed http:: call reached an internal or external host, indicating SSRF or data exfiltration.
- !Escalate if the invoking principal is unexpected or the function was defined outside a sanctioned deployment process.
- !Escalate if the affected instance holds sensitive data and scripting with capability restrictions was supposed to be enforced.
Investigation Guide
Forensic Artifacts
- >
SurrealDB server logs containing DEFINE FUNCTION / <js> statements and surrealdb.functions bridge calls - >
Reverse-proxy or IIS access logs for /sql and /rpc endpoints - >
Host network connection records showing egress from the surreal process
Tuning Guidance
Baseline the set of SurrealDB JavaScript functions legitimately defined by your applications and allow-list them by function name/hash or defining principal. Raise severity when the invoking identity is unexpected or when a bypassed http:: call is followed by egress to a non-allowlisted destination. Suppress alerts from known staging/test SurrealDB instances where scripting is intentionally enabled without capability restrictions.
Hunting Queries
Hunt for any SurrealDB JavaScript function invoking restricted built-ins through the bridge over a wide time window.
// df00tech DF00-6f10b6fa17 · https://df00tech.com/detections/CVE-2026-134292 · licence: https://df00tech.com/detections/licence
Syslog | where SyslogMessage has "surrealdb.functions" and SyslogMessage has_any ("http::", "crypto::") | project TimeGenerated, Computer, SyslogMessage ``` df00tech DF00-6f10b6fa17 · https://df00tech.com/detections/CVE-2026-134292 · licence: https://df00tech.com/detections/licence ```
index=db sourcetype=surrealdb:log "surrealdb.functions" ("http::" OR "crypto::") | stats count by host, _raw Atomic Red Team Tests
Defines and runs a SurrealQL JavaScript function that calls an http:: built-in through the surrealdb.functions bridge to simulate the capability bypass.
Command
curl -s -X POST http://127.0.0.1:8000/sql -u root:root -H 'Accept: application/json' -H 'surreal-ns: test' -H 'surreal-db: test' --data "RETURN function() { return await surrealdb.functions['http::get']('http://127.0.0.1:9999/canary'); };" Cleanup
curl -s -X POST http://127.0.0.1:8000/sql -u root:root -H 'surreal-ns: test' -H 'surreal-db: test' --data 'REMOVE FUNCTION fn::test;' 2>/dev/null || true Expected Telemetry
SurrealDB server log line referencing surrealdb.functions and http::get; outbound connection attempt to 127.0.0.1:9999 from the surreal process.
Expected Detection
KQL/SPL rules match on the surrealdb.functions + http:: pattern; EQL sequence links the bridge call to egress.
Persists a JavaScript-backed SurrealDB function that invokes a crypto built-in through the bridge.
Command
curl -s -X POST http://127.0.0.1:8000/sql -u root:root -H 'surreal-ns: test' -H 'surreal-db: test' --data "DEFINE FUNCTION fn::bypass() { RETURN function() { return surrealdb.functions['crypto::md5']('x'); }; };" Cleanup
curl -s -X POST http://127.0.0.1:8000/sql -u root:root -H 'surreal-ns: test' -H 'surreal-db: test' --data 'REMOVE FUNCTION fn::bypass;' 2>/dev/null || true Expected Telemetry
DEFINE FUNCTION log event containing <js> body and surrealdb.functions.crypto:: reference.
Expected Detection
Log-based rules match DEFINE FUNCTION + surrealdb.functions + crypto:: pattern.
Uses the /rpc endpoint to send a JavaScript function that references the functions bridge, simulating API-driven exploitation.
Command
curl -s -X POST http://127.0.0.1:8000/rpc -u root:root -H 'Content-Type: application/json' --data '{"method":"query","params":["RETURN function() { return surrealdb.functions[\"http::post\"](\"http://127.0.0.1:9999\", {}); };"]}' Cleanup
echo 'no persistent artifact to clean' Expected Telemetry
Reverse-proxy/access log for POST /rpc with surrealdb.functions and http::post in the body; SurrealDB log of JS execution.
Expected Detection
IIS/W3C and SPL rules match /rpc requests carrying surrealdb.functions + http:: content.