← ClaudeAtlas

cache-key-discriminator-auditlisted

Use whenever a user saw another user's or tenant's data, or a per-user response goes through a shared cache, Redis or a CDN, or a cache key is designed or changed. Checks the key holds every value the response depends on (tenant, user, scope, locale), writes the fixed key, Vary header and tests.
testland/qa · ★ 13 · Testing & QA · score 80
Install: claude install-skill testland/qa
# cache-key-discriminator-audit ## The defect this finds A cache key is a function of an operation plus a set of **discriminators**: the request dimensions the response body actually varies on. If the response varies on something the key does not carry, two different requests hash to the same slot and the second requester is served the first requester's response. The worst version of this is not slow, and it is not stale. It is a **data-exposure defect**: one user's data served to another user. A missing `tenant_id` in a multi-tenant cache is a confidentiality bug with the same blast radius as a missing authorization check, because the cache is doing the serving and the authorization code never runs on the second request. Triage it as a security defect, not as a performance or freshness issue. The exposure only reaches other people when the cache is shared. RFC 9111 §1 splits caches into a **shared cache** (stores responses for reuse by more than one user) and a **private cache** (dedicated to a single user) ([RFC 9111 §1](https://www.rfc-editor.org/rfc/rfc9111.html)). A CDN, a reverse proxy, and a Redis or Memcached instance behind the application are all shared caches. A missing discriminator in any of them is a cross-user defect. The same omission in a browser cache is a correctness bug affecting one person. Two named web-security classes sit on top of this. Web cache poisoning manipulates cache keys to inject malicious content served to other users; web cache decepti