Repository navigation
fix(s3): require x-amz-* request headers to be signed - #14799
Conversation
SigV4 requires every x-amz-* header on a request to be covered by the signature. The gateway acted on copy and metadata-directive headers even when they were outside SignedHeaders, so a request signed for one operation could be extended into another. Reject such requests with AccessDenied, matching S3. x-amz-content-sha256 stays exempt because the canonical request's payload line already binds it. Co-Authored-By: Claude <[email protected]>
|
Review complete. No issues found — approved ✅. This change closes an unsigned-header smuggling gap in the S3 gateway's AWS Signature V4 verification: requests carrying
Reviewed commit: 15c1c6d |
🟢 Tier S · Ready to merge
The S3 SigV4 verifier now rejects requests containing unsigned
📂 Walkthrough · 3
Reviewed |
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
Security rulesNo new WARNING or ERROR findings from security rules. 6 existing findings tracked in
|
…ders fix(s3): require x-amz-* request headers to be signed (cherry picked from commit 151a7e9)
Summary
Reject S3 requests that include an
x-amz-*header omitted fromSignedHeaders, for both Authorization-header and presigned-URL authentication.Previously, the verifier checked only the headers listed by the signer. A caller could append an unsigned
x-amz-copy-sourceto an otherwise valid PUT request and have the gateway treat it as CopyObject. The same gap applied to other operation headers, includingx-amz-copy-source-rangeandx-amz-metadata-directive.The gateway now rejects these requests with HTTP 403 and S3
AccessDeniedbefore the object operation runs.Changes
x-amz-*header against the normalized signed-header list inSignatureV4::verify().x-amz-content-sha256exemption: header-authenticated requests bind its value through the canonical request's payload line; presigned requests useUNSIGNED-PAYLOADand ignore this header for verification.x-amz-*headers it sends, with an explicit option for sending unsigned headers in negative tests.This follows the S3 signing requirements. Clients sending unsigned
x-amz-*headers, other than the exemption above, must include them inSignedHeaders.Validation
x-amz-copy-sourceis rejected for both authentication methods; signed copy headers are accepted; a presigned request with unsignedx-amz-content-sha256remains valid.AccessDeniedand leaves the destination absent. Signing the same header succeeds, and the copied bytes match the source.Related: appwrite-labs/cloud#6674