Summary
SeaweedFS's S3 gateway previously failed to reject dot-dot path segments in the X-Amz-Copy-Source header for CopyObject and UploadPartCopy operations.
Under certain configurations, an authenticated identity restricted to one bucket could use server-side copy to read objects from other buckets, bypassing intended bucket scoping.
Affected context
This vulnerability appears when SeaweedFS is deployed with its S3 API gateway and uses bucket-scoped identities or policies to restrict access.
The issue involves server-side copy operations (CopyObject and UploadPartCopy) that rely on the X-Amz-Copy-Source header to identify source objects.
When validation of path segments in this header is insufficient, specially crafted values may allow identities confined to a single bucket to indirectly access objects in other buckets.
Exploit preconditions
- Attack surface: SeaweedFS S3 API gateway endpoints handling CopyObject and UploadPartCopy requests
- Required access: Valid authenticated S3-style credentials with access limited (by policy) to a specific bucket
- Trigger point: Sending a server-side copy request with a crafted X-Amz-Copy-Source header containing dot-dot (
..) segments - Why exploitation is possible: The gateway's path normalization does not properly reject traversal-style segments within the copy source path, allowing resolution beyond the intended bucket boundary
Why this happens
The root cause aligns with CWE-22: Improper Limitation of a Pathname to a Restricted Directory ("Path Traversal").
The S3 gateway logic trusts the structure of the X-Amz-Copy-Source header without robust normalization and restriction of path segments.
By permitting .. components in the copy source, the server's internal path resolution can escape the bucket-relative namespace that policies intend to enforce, resulting in unintended cross-bucket object visibility.
Potential impact
- An identity scoped to a single bucket may read objects from other buckets via server-side copy
- Bucket-level isolation and access controls can be undermined
- Sensitive data stored in adjacent buckets could be exposed to unauthorized internal tenants
- Compliance and data segregation guarantees may be weakened
General mitigation guidance
Effective mitigation focuses on strict path handling and enforcing namespace boundaries in API request processing.
Common defensive patterns include:
- Normalizing and validating all user-controlled path inputs, especially headers like X-Amz-Copy-Source
- Explicitly rejecting dot-dot (
..) and similar traversal segments in any bucket or object path evaluation - Implementing clear separation between bucket namespaces and verifying that server-side copy sources belong to the requesting identity's allowed buckets
- Applying defense-in-depth authorization checks at the object level, not solely at bucket boundaries
- Designing APIs so that copy operations require explicit, policy-verified source and destination identifiers instead of free-form paths
How teams detect issues like this
Organizations can detect path traversal and authorization bypass issues through several approaches:
- Static analysis rules and code scanning tuned to identify unvalidated path concatenation and missing normalization around S3-style headers
- Manual code review focusing on any feature that performs server-side copy, rename, or move using user-supplied paths
- Logging and monitoring for anomalous CopyObject / UploadPartCopy requests that reference unexpected buckets or complex path patterns with
.. - Policy-based checks in CI/CD that require path validation wrappers or utility functions for all storage gateway operations
- Use of automated security testing tools or custom integration tests that attempt traversal via X-Amz-Copy-Source and similar headers

