Skip to content

Conversation

@adutra
Copy link
Contributor

@adutra adutra commented Jan 28, 2026

Fixes #15166.

The cache key for signed responses only included method, region, and URI, but not headers like x-amz-content-sha256 that are part of the signature. This caused 403 errors when different content was uploaded to the same URI within the cache TTL.

This fix uses the full S3SignRequest as the cache key. This is the only 100% safe option because we cannot know which headers the server will sign and which ones it will ignore; any header included in the signature must be part of the cache key.

This change reduces cache efficiency; but that's the price to pay for correctness.

…ents

Fixes apache#15166.

The cache key for signed responses only included method, region, and URI, but not headers like `x-amz-content-sha256` that are part of the signature. This caused 403 errors when different content was uploaded to the same URI within the cache TTL.

This fix uses the full `S3SignRequest` as the cache key. This is the only 100% safe option because we cannot know which headers the server will sign and which ones it will ignore; any header included in the signature *must* be part of the cache key.

**This change reduces cache efficiency**; but that's the price to pay for correctness.
@github-actions github-actions bot added the AWS label Jan 28, 2026
@steveloughran
Copy link
Contributor

Makes sense: it's up to the server to decide what to sign, as long as the final signature is valid.

I'd like the referrer header to be stripped out in the example servlet FWIW; We use it for adding audit information with every request and it has no security ramifications

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AWS, REST: Remote signer client's cache causes 403 errors

2 participants