Summary
SeaweedFS before 4.34 contains a path traversal flaw in the S3 gateway's DeleteMultipleObjectsHandler, allowing directory traversal via crafted object keys in DeleteObjects XML requests.
Authenticated S3 principals with write access to a single bucket can abuse this behavior to delete arbitrary objects in other tenants' buckets when the gateway resolves paths outside the authorized bucket.
Affected context
This vulnerability arises in SeaweedFS deployments using the S3 gateway, specifically when clients invoke the multi-object delete operation (DeleteMultipleObjectsHandler).
It is most relevant in multi-tenant or multi-bucket environments where authorization decisions are tied to the requested bucket, but object keys from the request body are later translated into filer paths.
The issue manifests when directory traversal sequences (../) in object keys are normalized by the backend path resolution logic, enabling access to objects outside the caller's intended bucket scope under certain configurations.
Exploit preconditions
- Attack surface: S3-compatible HTTP API, particularly the DeleteObjects (multi-delete) endpoint on the SeaweedFS S3 gateway.
- Required access: Valid, authenticated S3 principal with write/delete permissions to at least one bucket on the gateway.
- Trigger point: Submission of a DeleteObjects XML request whose object keys include
../segments that, when resolved, traverse to other buckets' storage paths. - Why exploitation is possible: The validateRequestPath middleware only checks URL path variables for safety and authorization, ignoring object keys in the request body. The filer then collapses the traversal segments and resolves the underlying filesystem path, effectively allowing a confused deputy scenario where the gateway performs deletions outside the originally authorized bucket.
Why this happens
The core defect is insufficient input validation on attacker-controlled path components contained in the DeleteObjects XML request body.
While the URL-level path validation middleware attempts to enforce safe, tenant-scoped access, it does not extend its checks to object keys, which are later transformed into filer paths.
This gap allows directory traversal sequences (../) in keys to survive until filesystem resolution, matching CWE-22: Improper Limitation of a Pathname to a Restricted Directory (Path Traversal).
Conceptually, the S3 gateway acts as a confused deputy: it trusts body-supplied keys as internal paths without canonicalization or enforcement of bucket boundaries, enabling operations outside the intended authorization scope.
Potential impact
- Authenticated tenants may delete arbitrary objects from other tenants' buckets.
- Critical application data stored in neighboring buckets could be removed or disrupted.
- Cross-tenant isolation guarantees can be undermined, eroding trust in shared storage deployments.
- Backup or archival data mapped under the same filer hierarchy may also be unintentionally exposed to deletion.
General mitigation guidance
Effective mitigation focuses on tightening path handling and authorization boundaries within the S3 gateway and underlying filer.
Common defensive patterns include:
- Applying strict canonicalization and normalization of all path segments derived from request bodies before use.
- Enforcing bucket and tenant boundaries after path resolution, ensuring that resolved paths cannot escape their configured root directories.
- Rejecting object keys that contain
../, absolute path prefixes, or other traversal patterns as part of API input validation. - Designing gateway components so that authorization decisions are made over fully-resolved, canonical paths rather than partially trusted inputs.
- Minimizing the gateway's effective privileges on backend storage, so that even if traversal occurs, the impact surface is reduced.
How teams detect issues like this
Organizations can detect similar path traversal risks by:
- Using static analysis or linters to flag direct concatenation of user-supplied strings into filesystem or filer paths, especially in gateway or API layers.
- Reviewing code for inconsistencies where middleware validates URL paths but does not apply equivalent checks to request bodies or query parameters.
- Implementing security-focused integration tests that attempt directory traversal via object keys and other secondary inputs on S3-compatible endpoints.
- Applying centralized logging and anomaly detection for multi-delete operations that target unexpected directories or cross-bucket paths.

