Repository navigation
fix(s3): HeadObject 403 when proxies rewrite HEAD to GET - #13744
Merged
Merged
Conversation
Proxies in front of Cloud may convert HeadObject to GET while forwarding the HEAD signature and x-id. Verify GET/HEAD interchangeably, treat x-id=HeadObject|HeadBucket as HEAD, and keep the empty body. Co-authored-by: Torsten Dittmann <[email protected]>
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
… GET Cloud may rewrite HeadObject to GET while forwarding the HEAD signature. Keep the change to signature verification only. Co-authored-by: Torsten Dittmann <[email protected]>
TorstenDittmann
marked this pull request as ready for review
September 17, 2026 15:08
Contributor
|
Limit the HEAD fallback to SDK HeadObject/HeadBucket requests (x-id) so a presigned HEAD URL cannot be replayed as GetObject. Treat those operations as HEAD so the object body is not returned. Co-authored-by: Torsten Dittmann <[email protected]>
ChiragAgg5k
approved these changes
Sep 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
HeadObject was documented as supported, but boto3 and the AWS CLI get a generic
403 Forbidden. Cloud (Fastly) can rewrite the SDK'sHEADinto aGETwhile forwarding the HEAD SigV4 signature andx-id=HeadObject. Verification used the request method as-is, so the canonical request no longer matched (AccessDenied).If a
GETsignature does not match, retry asHEADonly whenx-idisHeadObjectorHeadBucket. Those operations are then handled as HEAD so a presigned HEAD URL cannot be replayed as GetObject.Test Plan
testVerifiesHeadObjectSignatureAfterProxyRewritesToGet— HEAD signature on a GET withx-id=HeadObjecttestRejectsHeadSignatureReplayedAsGetObject— HEAD signature on a GET withoutx-idis rejectedRelated PRs and Issues
Checklist