/

CVE-2026-134295

Severity:

HIGH RISK

(8.8)

Path Traversal (CWE-22) in SurrealDB File Bucket API

CVE-2026-134295

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Unauthorized file read, write, or deletion within the storage root

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

SurrealDB direct filesystem buckets can mishandle object keys when checking permissions and converting keys into filesystem paths. An authenticated tenant with access to selected keys may use path traversal sequences to read, write, or delete other files within the storage root.

Affected context

The issue affects SurrealDB direct filesystem buckets when key-based access controls are used. It occurs when permissions are evaluated against an unnormalized object key, but that key is later converted to a filesystem path with traversal sequences collapsed without a corresponding traversal check.

Exploit preconditions

  • Attack surface: Direct filesystem bucket operations
  • Required access: An authenticated tenant account permitted to access some bucket keys
  • Trigger point: A read, write, or delete operation using a crafted object key
  • Why exploitation is possible: ACL evaluation uses the unnormalized key, while filesystem path conversion resolves traversal sequences, allowing the resulting path to refer to a different file within the storage root

Why this happens

The vulnerability is an authorization and path canonicalization mismatch. Key-based ACLs are checked before the object key is normalized, while the filesystem path conversion collapses .. sequences without verifying that the resolved path remains within the intended location. This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

Potential impact

  • An attacker may read files within the storage root that are outside their permitted key scope.
  • An attacker could modify or overwrite files within the storage root.
  • An attacker may delete files that their key-based permissions should not allow them to access.

General mitigation guidance

Mitigation generally focuses on making authorization and path resolution enforce the same security boundary.

Common defensive patterns include:

  • Canonicalizing and validating keys before authorization checks.
  • Resolving filesystem paths and verifying they remain beneath the configured storage root.
  • Rejecting traversal components and ambiguous path forms.
  • Applying access controls to the canonical resource identity rather than the original key string.
  • Running storage operations with only the filesystem privileges they require.

How teams detect issues like this

Detection approaches can include:

  • Static analysis for filesystem path construction that lacks canonicalization or containment checks.
  • Code review of the ordering between key normalization, ACL evaluation, and filesystem operations.
  • Tests and security policies that verify resolved paths remain within the configured storage root.
  • Monitoring for rejected or unusual object keys containing traversal-like components.

Sources

SourceLink
github.comgithub.com/surrealdb/surrealdb/security/advisories/GHSA-cph5-pm57-9w9c
vulncheck.comvulncheck.com/advisories/surrealdb-3.0.0-before-4.0.0-path-traversal-in-direct-filesystem-buckets

Frequently asked

questions

The described issue can expose files within the direct filesystem bucket's storage root; it does not establish access to files outside that root.

Yes. The described scenario requires an authenticated tenant with permission to access certain keys.

Normalize and resolve the key before applying authorization, then verify the resolved path remains within the intended storage root.

Treat object keys as untrusted input, use consistent canonicalization for both authorization and filesystem access, and enforce path-containment checks through code review and automated tests.

Find out what's already
exploitable in your codebase.