CVE-2026-134290 in SurrealDB
Summary
by MITRE • 11/21/2026
SurrealDB 2.2.0 before 4.0.0 includes the record id of a referencing row in the error returned when a delete is blocked by an ON DELETE REJECT reference, without checking the caller's SELECT permission on that row. An authenticated principal with DELETE permission can attempt to delete a referenced record and read the rejection error to learn the existence and exact ids of referencing records hidden by row-level SELECT permissions.
Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.
Analysis
by VulDB Data Team • 11/21/2026
The vulnerability identified in SurrealDB versions prior to 4.0.0 represents a significant authorization bypass that exploits the intersection of data integrity constraints and access control mechanisms. Specifically, this flaw resides within the database engine's handling of foreign key relationships defined by ON DELETE REJECT policies. When an application attempts to delete a parent record that is referenced by child records under such a constraint, the system correctly blocks the deletion to preserve referential integrity. However, in doing so, it generates an error message that inadvertently discloses sensitive metadata about those referencing rows. This behavior creates a side-channel attack vector where information leakage occurs not through direct data retrieval but through the analysis of system responses to invalid operations.
From a technical perspective, the core issue is a failure to enforce row-level security permissions when constructing diagnostic or error messages for constraint violations. While the database correctly restricts unauthorized SELECT operations on specific rows based on user roles and policies, it fails to apply these same checks before including identifiers from those restricted rows in an exception thrown during a DELETE operation. An authenticated principal who possesses DELETE privileges but lacks SELECT privileges on certain child records can exploit this discrepancy. By attempting to delete the parent record associated with those hidden children, the attacker triggers the rejection error which explicitly lists the IDs of the referencing records. This allows the attacker to enumerate and identify data that they are otherwise prohibited from viewing or accessing directly.
The operational impact of this vulnerability is substantial for any system relying on SurrealDB for sensitive data management where fine-grained access control is critical. The ability to discover the existence and exact identifiers of hidden records undermines the confidentiality guarantees provided by row-level permissions. Attackers can use this information to map out the structure of restricted datasets, potentially identifying patterns or relationships that were intended to be obscured from lower-privileged users. In environments where data classification depends on strict isolation between different security zones, such as healthcare or financial applications, this leakage could facilitate further attacks, including targeted social engineering or more sophisticated exploitation attempts against other components in the architecture.
This vulnerability aligns with CWE-209, which describes the generation of an error message that includes sensitive information, and CWE-863, concerning improper authorization checks for critical functionality. Furthermore, it maps to MITRE ATT&CK technique T1537, specifically the sub-technique of data leakage through side channels or unintended information disclosure via API responses. The flaw highlights a common pitfall in database development where error handling is prioritized over security auditing during exception generation.
To mitigate this risk, organizations running SurrealDB versions before 4.0.0 should upgrade to version 4.0.0 or later immediately, as the vendor has addressed this authorization bypass in subsequent releases. Until an upgrade can be performed, administrators should consider implementing strict input validation and custom error handling at the application layer to mask detailed database errors from end-users. Additionally, reviewing access control policies to ensure that DELETE permissions are granted only to users who genuinely require them for operational purposes can reduce the attack surface available to potential adversaries exploiting this information leakage channel.