Skip to content

fix(router): return plaintext ETag on intercepted GetObject#50

Open
pszafarczyk wants to merge 1 commit into
Intrinsec:mainfrom
pszafarczyk:etag
Open

fix(router): return plaintext ETag on intercepted GetObject#50
pszafarczyk wants to merge 1 commit into
Intrinsec:mainfrom
pszafarczyk:etag

Conversation

@pszafarczyk

Copy link
Copy Markdown

Intercepted GETs decrypt the body but returned the upstream ETag, which S3 computes over the ciphertext at rest. Clients/SDKs that validate the body against the ETag, or cache by it, saw a mismatch.

Override the response ETag with md5(plaintext) — the ETag S3 would have produced for the unencrypted object — computed on the fly from the buffer already in memory, so no stored metadata or migration is needed. Pass-through objects (no DEK tag) keep the upstream ETag. PUT-response and HEAD ETags still reflect the ciphertext and remain a known gap.

Intercepted GETs decrypt the body but returned the upstream ETag, which
S3 computes over the ciphertext at rest. Clients/SDKs that validate the
body against the ETag, or cache by it, saw a mismatch.

Override the response ETag with md5(plaintext) — the ETag S3 would have
produced for the unencrypted object — computed on the fly from the buffer
already in memory, so no stored metadata or migration is needed.
Pass-through objects (no DEK tag) keep the upstream ETag. PUT-response and
HEAD ETags still reflect the ciphertext and remain a known gap.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant