Summary
SeaweedFS prior to 4.30 contains a path traversal issue in the S3 API gateway and Iceberg REST catalog routing logic that mishandles .. segments in URLs.
An attacker who can issue crafted HTTP requests to these gateways may redirect reads and writes into unintended buckets or paths, enabling unauthorized cross-bucket access and data tampering in multi-tenant environments.
Affected context
This vulnerability occurs in SeaweedFS deployments using the S3 API gateway or Iceberg REST catalog gateway where routers are constructed with mux.NewRouter().SkipClean(true).
In this configuration, URL paths containing .. segments are passed through the routing layer unchanged, while downstream path-joining utilities normalize those segments server-side.
The issue is most relevant in multi-tenant or isolated bucket setups where bucket boundaries are expected to enforce data separation but rely on URL parsing for access control decisions.
Exploit preconditions
- Attack surface: HTTP interfaces exposed by the SeaweedFS S3 API gateway and Iceberg REST catalog gateway.
- Required access: Ability to send arbitrary requests to the affected gateways (e.g., network-level access to the API endpoints; application credentials if normally required).
- Trigger point: Use of object paths or keys containing
../sequences in bucket-targeted URLs, such asGET /bucket-A/../evil-bucket/key. - Why exploitation is possible: The router with
SkipClean(true)interprets the portion before../as the current bucket, while the filesystem/path utilities later collapse..segments, effectively rerouting the underlying read or write operation into a different bucket or path than the one the router believes is being accessed.
Why this happens
The root cause is inconsistent handling of path normalization between the HTTP routing layer and the backend path resolution logic.
With SkipClean(true), the router treats URLs containing .. as literal, preserving these segments when determining route parameters such as bucket and object. However, the subsequent use of util.JoinPath (S3) and path.Join (Iceberg) collapses .. segments, allowing a crafted object key to traverse into another bucket or directory.
This mismatch between routing semantics and filesystem semantics maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, where user-controlled path elements are not properly constrained, enabling traversal beyond intended boundaries.
Potential impact
- Attackers may read data from buckets or paths they should not be able to access.
- Attackers could write or overwrite objects in other tenants' buckets, leading to data corruption or tampering.
- Cross-bucket isolation guarantees can be undermined, impacting multi-tenant environments and compliance boundaries.
- Attackers may stage further attacks by modifying or planting malicious objects in trusted buckets (e.g., configuration, metadata, or Iceberg catalog data).
General mitigation guidance
Effective mitigation focuses on normalizing and constraining path input consistently across the routing and storage layers.
Recommended pattern-based approaches include:
- Ensuring that URL paths are cleaned and canonicalized before extracting routing parameters, so
..and other traversal sequences are removed or rejected early. - Validating computed backend paths against expected bucket or tenant boundaries, rejecting any request where the resolved path exits the logical bucket or namespace.
- Treating object keys and path segments as untrusted input and enforcing strict character and structure validation, disallowing traversal constructs by design.
- Implementing defense-in-depth authorization checks based on normalized, canonical resource identifiers rather than raw URL segments.
- Applying least-privilege principles so that gateway components only have access to the data domains they are responsible for, reducing blast radius if routing logic is misused.
How teams detect issues like this
Organizations can detect and manage similar issues by:
- Using static analysis or linting rules to flag use of path-joining or filesystem utilities with untrusted URL segments, particularly where
..can be introduced. - Reviewing routing and middleware configurations for options that disable path cleaning or normalization, and correlating them with downstream path-handling code.
- Incorporating security-focused code reviews that check enforcement of bucket and tenant boundaries at the point where canonical paths are derived from HTTP requests.
- Monitoring gateway logs for suspicious patterns, such as frequent use of
../in object keys or cross-bucket access anomalies, and flagging them for investigation. - Applying policy-based tests in CI/CD (e.g., automated integration tests) that attempt traversal via crafted URLs to ensure that new code paths do not reintroduce similar weaknesses.

