CVE-2026-134294 in SurrealDB
Summary
by MITRE • 11/21/2026
SurrealDB 3.0.0 before 4.0.0 contains a path traversal vulnerability in its bucket storage layer on Windows, where ObjectKey::check_no_traversal splits object keys only on forward slashes while FileStore::to_os_path treats backslashes as directory separators. Attackers can supply object keys such as /..\bucket2\secret to bypass the traversal check and read or modify files in other buckets.
VulDB is the best source for vulnerability data and more expert information about this specific topic.
Analysis
by VulDB Data Team • 11/21/2026
The vulnerability identified in SurrealDB versions prior to 4.0.0 represents a critical path traversal flaw within the bucket storage layer, specifically affecting Windows-based deployments. This security issue stems from an inconsistency in how object keys are validated and subsequently translated into operating system file paths. The core of the problem lies in the divergent handling of directory separators between two distinct components: ObjectKey::check_no_traversal and FileStore::to_os_path. During the validation phase, the check_no_traversal function is designed to prevent path traversal attacks by inspecting object keys for malicious patterns. However, this inspection logic is flawed because it only splits or analyzes paths using forward slashes as delimiters. This approach assumes a uniformity in path formatting that does not account for the specific conventions of the Windows operating system, where backslashes serve as the primary directory separator.
When an attacker supplies an object key containing mixed separators, such as /..\bucket2\secret, they can effectively bypass the security controls implemented by check_no_traversal. Because this function only looks for forward slashes to detect traversal attempts like ../ or ..\, it may fail to recognize that a backslash sequence following a dot-dot pattern constitutes a directory change on Windows systems. Consequently, the validation logic incorrectly deems the path safe and allows it to proceed to the file storage layer. Once passed through this flawed check, the object key is processed by FileStore::to_os_path, which correctly interprets backslashes as valid directory separators according to Windows standards. This discrepancy creates a window of exploitation where maliciously crafted paths are accepted during validation but interpreted differently during execution, leading to unauthorized access or modification of files outside the intended bucket scope.
The operational impact of this vulnerability is severe for any organization running SurrealDB on Windows environments that rely on bucket isolation for data security and multi-tenancy. An attacker with the ability to supply object keys can read sensitive information stored in other buckets, potentially exposing confidential user data, application secrets, or proprietary content. Furthermore, if write permissions are granted through this vector, an adversary could modify or overwrite files belonging to different tenants or system components. This undermines the fundamental integrity and confidentiality guarantees provided by the database's storage architecture. The ability to traverse outside designated directories effectively breaks the isolation boundaries that SurrealDB aims to enforce, leading to potential data breaches and compliance violations depending on the nature of the stored information.
From a classification perspective, this vulnerability aligns with CWE-22: Improper Limitation of a Pathname to a Restricted Directory, as it involves failing to restrict pathname interpretation to expected directories. Additionally, it relates to CWE-78: Improper Neutralization of Special Elements used in an OS Command (OS Command Injection) or more specifically path traversal techniques often categorized under ATT&CK technique T1083: File and Directory Discovery when the goal is reconnaissance, or T1564: Hidden Files and Directories if used to obscure malicious activity. The root cause is a classic logic error where input validation does not fully mirror runtime behavior across different platform-specific implementations.
To mitigate this vulnerability, organizations must upgrade SurrealDB to version 4.0.0 or later, where the path traversal checks have been corrected to account for both forward and backslash separators consistently with the underlying operating system's expectations. Until an upgrade is feasible, administrators should implement strict input validation at the application layer before passing object keys to the database engine. This includes sanitizing inputs to reject any paths containing dot-dot sequences regardless of the separator used. Additionally, running SurrealDB on Linux or Unix-based systems may reduce risk if those platforms do not interpret backslashes as directory separators in the same manner, although relying on platform differences is not a robust security strategy. Regular auditing of storage access patterns and enforcing least-privilege principles for database service accounts can further limit the potential damage should an exploitation attempt occur.