Vulnerability DatabaseCVE-2026-137490

CVE-2026-137490: 
Chainguard vulnerability analysis and mitigation

Overview

CVE-2026-137490 is a high-severity authorization bypass vulnerability in SurrealDB affecting all versions before 4.0.0. The flaw allows authenticated users with script execution permissions to invoke the JavaScript surrealdb.query() bridge to execute arbitrary database queries beyond their authorized scope, circumventing the Capabilities::allows_query() access control gate. It was published on November 26, 2026, with the underlying security advisory (GHSA-fq69-wr4w-v3gm) originally published by the SurrealDB team on November 3, 2026. The vulnerability carries a CVSS v3.1 base score of 8.8 (High) and a CVSS v4.0 base score of 8.7 (High) (GitHub Advisory, SurrealDB Advisory).

Technical details

The root cause is a missing authorization check (CWE-862) in surrealdb/core/src/fnc/script/modules/surrealdb/query/mod.rs. While SurrealQL's nested query functions correctly invoke Capabilities::allows_query() before execution, the JavaScript bridge's query() function directly parses and executes input queries without performing this capability check. An attacker who has been granted permission to execute a specific script can exploit this gap to run arbitrary SurrealQL queries that their role would otherwise be prohibited from executing. The fix, introduced in commit 0b8be14543, enforces query and function capability checks inside the embedded JavaScript bridge (SurrealDB Advisory, GitHub Advisory).

Impact

A successfully exploited vulnerability allows an authenticated user with script execution permissions to read, modify, or delete data beyond their authorized scope within the SurrealDB instance. This breaks the integrity of role-based access controls, potentially exposing sensitive records, enabling unauthorized data manipulation, or causing data loss through destructive queries. The impact is confined to the vulnerable SurrealDB system itself (subsequent system impact is rated None), but the high confidentiality, integrity, and availability ratings on the vulnerable system reflect the severity of unrestricted database access (GitHub Advisory, SurrealDB Advisory).

Exploitability

There is no public proof-of-concept exploit code and no evidence of in-the-wild exploitation at this time. The CVE status is listed as "Deferred" and the EPSS score is 0.0, indicating a very low current probability of exploitation. The vulnerability requires low-level authenticated access (script execution permission), which limits the attacker pool but does not require administrative privileges. It has not been added to the CISA Known Exploited Vulnerabilities catalog (GitHub Advisory, Feedly).

Exploitation steps

  1. Obtain script execution access: Authenticate to a SurrealDB instance (version < 4.0.0) as a subject (user or role) that has been granted permission to execute JavaScript scripting functions, but is restricted from running arbitrary queries directly.
  2. Craft a malicious script: Write a JavaScript function that calls the surrealdb.query() bridge with an arbitrary SurrealQL query — for example, one that reads all records from a table the subject is not authorized to access: surrealdb.query('SELECT * FROM sensitive_table').
  3. Execute the script: Submit the crafted script to SurrealDB via the scripting function interface (e.g., using a DEFINE FUNCTION or inline script call in SurrealQL).
  4. Bypass the capability gate: Because surrealdb/core/src/fnc/script/modules/surrealdb/query/mod.rs does not call Capabilities::allows_query(), the query executes without restriction, returning data or performing modifications beyond the subject's authorized scope.
  5. Exfiltrate or manipulate data: Use the unrestricted query access to read sensitive records, modify data, or issue destructive queries (e.g., DELETE FROM *) that the subject's role would normally prohibit (SurrealDB Advisory).

Indicators of compromise

  • Logs: SurrealDB query logs showing JavaScript scripting function calls (surrealdb.query()) originating from subjects or roles not expected to perform broad or cross-table queries; unexpected SELECT *, DELETE, or UPDATE queries attributed to restricted user sessions.
  • Database Activity: Unusual access patterns to sensitive tables by accounts with limited roles; bulk data reads or modifications inconsistent with a subject's defined permissions.
  • Network: Authenticated API requests from low-privilege accounts that trigger large result sets or write operations not consistent with their role definition.

Mitigation and workarounds

Upgrade SurrealDB to version 4.0.0 or later, which enforces Capabilities::allows_query() and function capability checks within the embedded JavaScript bridge (SurrealDB Advisory). As an interim workaround until patching is feasible, restrict script execution permissions exclusively to fully trusted users and audit all roles that currently hold scripting capabilities. Review and tighten access controls to minimize the number of subjects permitted to execute JavaScript functions within SurrealDB.

Additional resources


Source: This report was generated using AI

Related Chainguard vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-137490HIGH8.7
  • Chainguard logoChainguard
  • surrealdb
NoYesNov 26, 2026
CVE-2026-137588HIGH7.1
  • Chainguard logoChainguard
  • cpe:2.3:a:librechat:librechat
NoYesNov 26, 2026
CVE-2026-137489MEDIUM5.3
  • Chainguard logoChainguard
  • surrealdb
NoYesNov 26, 2026
CVE-2026-137488MEDIUM5.3
  • Chainguard logoChainguard
  • surrealdb
NoYesNov 26, 2026
CVE-2026-137656LOW2.3
  • Chainguard logoChainguard
  • librechat
NoYesNov 26, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management