Skip to content

fix: limit cached-read grants to object reads - #248

Merged
ovaistariq merged 10 commits into
mainfrom
perfloop-pr-open-0pnf306gcd
Oct 21, 2026
Merged

ovaistariq merged 10 commits into
mainfrom
perfloop-pr-open-0pnf306gcd

Conversation

@perfloop

@perfloop perfloop Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Transparent mode no longer treats a successful write or another non-object-read response as permission to read private cached data. TAG still learns signing keys from successful replies, but grants bucket-level cached-read authorization only after a recognized GetObject or HeadObject succeeds upstream.

The response interceptor now separates key learning from authorization. It rejects other S3 subresources, including GetObjectAttributes, and unknown or malformed query selectors even when they use GET. The internal signing-key header is still stripped on every response. No S3 route or configuration is added.

The README, security guide, and transparent-proxy maintenance notes now describe this boundary. Routed tests keep multipart initiation and two-day signing-key learning intact, verify authorized GET/HEAD cache hits, and ensure that multipart and GetObjectAttributes replies do not grant access when the origin denies GetObject. The tests also cover bucket isolation, authorization expiry and 403 revocation, and signing-key header failure paths.

The routed correctness comparison found the assertion violated at 4df832ad38e8d9cc6cea919603be1ccd7657b75f and satisfied on the final source. The fixture uses a controlled origin policy; it does not establish a production incident or its frequency, and it does not address finer-grained object policies.

The checks passed: make lint-ci, make lint, make test, make test-integration, and make test-race. Full repository CI remains pending.

Recorded proof ran with retained support that is not included in this pull request.


Generated by Perfloop. Measurements and checks. Reproduce this comparison (tenant access required).


Note

High Risk
Changes authorization semantics for transparent mode cache hits; incorrect query classification could deny legitimate reads or still over-grant, with direct impact on access to private cached objects.

Overview
Tightens transparent-proxy cached-read authorization so a successful upstream response no longer automatically grants bucket read access when TAG learns signing keys.

The response interceptor now splits identity from permission: learnSigningKeys still caches derived keys from any successful reply with the internal header, but AuthzCache.Grant runs only in grantReadAuthorization after a 2xx on a client GET/HEAD to a real object key. isReadAuthorizationQuery blocks grants for other subresources (e.g. ?attributes, ?tagging, ?uploads, unknown query keys).

Docs (README, docs/security.md, transparent-proxy rules) describe that writes and passthrough successes do not confer cached-read rights. Unit tests cover the interceptor, query classifier, and signing-key failure paths; integration tests cover multipart/tagging/attributes vs denied GetObject, HEAD cache hits, 403 revocation, and per-bucket isolation.

Reviewed by Cursor Bugbot for commit 8233c19. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps

greptile-apps Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 3/5

[High impact] The change reaches cached-read authorization in transparent proxy mode.

Do not merge yet: a successful public-object read can still grant access to private cached objects in the same bucket.

Fix All in Claude CodeFindings

  1. P1 Security Public read grants private access ▶
  2. P2 Grant explanation repeats table ▶

Summary

TAG separates signing-key learning from permission to read cached objects.

  • Only successful object reads grant transparent-mode cached-read access.

Reviews (2) · Last reviewed commit: "fix: infer cache grants from object read..." · Reviewed by Greptile

Comment thread proxy/forwarder_transparent.go Resolved
Comment thread docs/security.md Resolved

@ovaistariq ovaistariq left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed: cached-read grants are now issued only after a client GET/HEAD 2xx on a real object key with no foreign subresource, so a write-only principal's PUT no longer unlocks private cached reads for the bucket. Remaining gap (a public-object GET still grants the bucket) needs a Tigris-side authorization signal and is tracked as a follow-up.

@ovaistariq
ovaistariq merged commit 8f1db15 into main Oct 21, 2026
10 checks passed
@ovaistariq
ovaistariq deleted the perfloop-pr-open-0pnf306gcd branch October 21, 2026 21:21
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 21, 2026
@tigrisdata-argocd-bot

Copy link
Copy Markdown

🎉 This PR is included in version 1.22.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants