CVE-2026-134295 in SurrealDB
Summary
by MITRE • 11/21/2026
SurrealDB 3.0.0 before 4.0.0 contains a path traversal vulnerability in direct filesystem buckets because BucketController::check_permission evaluates key-based ACLs against the un-normalized object key, while FileStore::to_os_path collapses '..' sequences without a traversal check. An authenticated tenant permitted only for certain keys can supply a key such as /public/../private/confidential.txt to read, write, or delete arbitrary files within the storage root.
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 critical path traversal flaw rooted in an inconsistency between access control enforcement and file system path resolution mechanisms. This issue specifically affects direct filesystem buckets where data persistence is managed through local disk operations rather than remote storage services. The core of the problem lies in how the BucketController component handles authorization decisions compared to how the FileStore component translates logical keys into physical operating system paths. When an authenticated tenant initiates a request, the system first evaluates whether the user has permission for the requested resource based on Access Control Lists (ACLs) defined by key patterns. However, this evaluation step fails to normalize or sanitize the input key before performing the check, allowing attackers to manipulate the path structure during the authorization phase while relying on subsequent steps to resolve the actual file location.
The technical flaw manifests when a user supplies an object key containing directory traversal sequences such as double dots followed by forward slashes, for example /public/../private/confidential.txt. The BucketController::check_permission function processes this un-normalized string against the configured ACLs. If the tenant is granted access to keys matching the pattern public/*, the system may incorrectly interpret the request as authorized because it does not account for the fact that the traversal sequence will alter the final destination path. Consequently, the authorization check passes based on a logical interpretation of the key rather than its resolved physical location. This creates a security gap where permissions are granted for one resource but applied to another entirely different and potentially sensitive file located outside the intended scope.
Following the successful bypass of access controls, the FileStore::to_os_path function takes over responsibility for locating the actual file on disk. This utility function is designed to collapse redundant path segments by resolving relative references like .. to their parent directories. While this behavior is standard for many file system utilities and generally useful for handling messy input paths, it becomes dangerous in this context because it lacks a secondary validation step to ensure that the resulting normalized path remains within the allowed storage root directory. As a result, the traversal sequences are resolved into absolute or relative paths pointing outside the designated bucket area. This allows an authenticated user with limited permissions to read, write, or delete arbitrary files anywhere within the underlying file system hierarchy accessible by the SurrealDB process, effectively breaking the isolation guarantees provided by multi-tenant architectures.
The operational impact of this vulnerability is severe, particularly in environments where multiple tenants share a single database instance using direct filesystem storage. An attacker can exploit this flaw to exfiltrate sensitive data belonging to other users or administrators who store information within adjacent directories. Beyond confidentiality breaches, the ability to write arbitrary files could lead to remote code execution if an attacker manages to overwrite executable scripts or configuration files that are subsequently processed by the system. Additionally, the capability to delete critical storage files can result in denial of service conditions for all tenants sharing the same infrastructure. This vulnerability undermines the fundamental principle of least privilege and compromises data integrity across the entire deployment.
From a classification perspective, this issue aligns with CWE-22 Improper Limitation of a Pathname to a Restricted Directory, as it involves accessing files outside restricted directories through path manipulation. It also relates to CWE-732 Incorrect Permission Assignment for Critical Resource because the access control logic fails to correctly assign permissions based on the actual resource being accessed rather than the input string provided by the user. In terms of offensive security frameworks, this vulnerability facilitates techniques associated with ATT&CK T1083 File and Directory Discovery and potentially T1564 Hidden Files and Directories if used for persistence or evasion purposes within a compromised environment.
Mitigation strategies must focus on enforcing strict path normalization before any authorization checks are performed. The BucketController should resolve the logical key to its canonical absolute path immediately upon receipt of the request, ensuring that all relative references like .. are resolved against the base storage root directory. Once normalized, this canonical path should be used for both the ACL evaluation and subsequent file operations. Additionally, implementing a strict validation step after path resolution is crucial; the system must verify that the final resolved path starts with or equals the expected bucket prefix to prevent any escape attempts even if normalization logic changes in future updates. Upgrading to SurrealDB version 4.0.0 or later resolves this issue as it addresses these inconsistencies in permission checking and path handling, ensuring that access controls are applied consistently against the actual physical location of resources rather than their unnormalized logical representations.