Summary
SurrealDB 1.0.0 before 4.0.0 lets authenticated users run built-in functions that are denied to them in SurrealQL, by going through the embedded JavaScript engine. The CVSS 4.0 score is 9.3 (critical) per CNA:VulnCheck.
What happened
SurrealDB's embedded JavaScript scripting engine contains a capability check bypass (CWE-862, missing authorization). The surrealdb.functions bridge calls the internal fnc::synchronous() and fnc::asynchronous() dispatchers without enforcing function capability checks. As a result, an authenticated user who is denied access to built-in functions in SurrealQL can execute them by calling them from embedded JavaScript through surrealdb.functions.
Why it matters
The restriction on built-in functions set by administrators can be bypassed, so denied functions can still be executed. The CVSS 4.0 score is 9.3 (critical), with vector 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, assigned by CNA:VulnCheck. According to CISA's KEV catalog, no active exploitation of this vulnerability is recorded; the source also does not state that it is a zero-day.
Affected products and versions
SurrealDB (vendor: surrealdb), versions >= 1.0.0 and < 4.0.0. Version 4.0.0 is listed as unaffected.
| Product | Versions | Fixed in |
|---|---|---|
| surrealdb surrealdb | >= 1.0.0, < 4.0.0 | — |
| surrealdb surrealdb | 4.0.0 | 4.0.0 |
Action recommended by the source
The source lists 4.0.0 as the fixed version. The vendor advisory is available at https://github.com/surrealdb/surrealdb/security/advisories/GHSA-5w6j-qm42-4rc2 and the VulnCheck advisory at https://www.vulncheck.com/advisories/surrealdb-1.0.0-before-4.0.0-function-capability-bypass-via-javascript-built-in-bridge. The source does not state any additional mitigations.
Fixed in: 4.0.0
Sources and references
- https://github.com/surrealdb/surrealdb/security/advisories/GHSA-5w6j-qm42-4rc2 — CVE Program
- https://www.vulncheck.com/advisories/surrealdb-1.0.0-before-4.0.0-function-capability-bypass-via-javascript-built-in-bridge — CVE Program
Weaknesses (CWE): CWE-862
Relevant change history
Published
Advisory published.