Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

cache-key-discriminator-audit

БесплатноБез исполняемых скриптовНе проверен

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…

testlandот testland★ 18 звёзд на GitHub

Об этом скилле

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). 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 deception tricks the cache into storing sensitive content the attacker can then retrieve (PortSwigger). Poisoning is the attacker-controlled form of an under-specified key. Deception is the attacker-controlled form of a response that should never have been stored in a shared cache at all.

Keyed and unkeyed inputs

The vocabulary to audit with comes from the cache's own point of view. A cache identifies equivalent requests by a predefined subset of the request's components, the cache key (typically the request line plus Host); components left out of it are unkeyed (PortSwigger).

So the audit reduces to one question per cached response:

Is every input the response body depends on keyed?

An unkeyed input that changes the body is the defect. An unkeyed input that cannot change the body is fine and should stay unkeyed, because every added discriminator fragments the cache and lowers the hit rate.

The discriminator table

Identity and authorization discriminators come first. They are the ones whose absence exposes data. Presentation discriminators come after; their absence produces wrong content, which is a correctness defect and not a disclosure.

Class Discriminator Where it lives in a request What happens when it is missing from the key
Identity tenant_id / org / workspace Subdomain, path segment, custom header, or claim inside the token Tenant B is served tenant A's response. Cross-tenant data leak.
Identity user_id / subject Claim inside the session token or Authorization User B is served user A's response. Per-user data leak.
Authorization Credential presence and value Authorization header, session cookie A response built for an authenticated principal is stored and replayed to an anonymous or differently-scoped requester. This is the canonical shared-cache leak.
Authorization Role / permission set Derived from the token server-side A low-privilege caller is served a response rendered with admin-visible fields.
Authorization Plan or subscription tier Derived from the tenant record A free-tier caller is served paid-tier content, or a paid caller is served the upsell page.
Identity-adjacent Impersonation / support-session context Custom header set by an internal proxy Support-session output is cached and served to the real end user, or the reverse.
Content negotiation Locale Accept-Language, cookie, path prefix Wrong-language body. Also wrong pluralization and wrong legal copy.
Content negotiation Currency Derived from tenant, geo, or explicit selector Prices rendered in the wrong currency, with the numeric amount unchanged.
Content negotiation Region / geo routing CDN geo header, client IP Geo-restricted content served outside its region.
Content negotiation Accept-Encoding Accept-Encoding header A gzip body served to a client that cannot decode it.
Content negotiation Device class / breakpoint User-Agent, client hints Mobile markup served to desktop and back.
Content shape Feature flag / experiment bucket Cookie, header, or server-side assignment Variant B cached and served to the whole control group, destroying the experiment and shipping unreleased UI.
Content shape API or schema version Path segment, Accept media type, custom h
Полный SKILL.md на GitHub

Установить cache-key-discriminator-audit в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

.tessl-plugin/plugin.jsonevals/ab-test-variant-leaking-to-the-control-group/criteria.jsonevals/ab-test-variant-leaking-to-the-control-group/task.mdevals/five-tickets-and-room-for-two-fixes-on-friday/criteria.jsonevals/five-tickets-and-room-for-two-fixes-on-friday/task.mdevals/pen-test-pulled-a-statement-through-a-css-url/criteria.jsonevals/pen-test-pulled-a-statement-through-a-css-url/task.mdevals/security-review-says-add-the-org-id-to-all-three-keys/criteria.jsonevals/security-review-says-add-the-org-id-to-all-three-keys/task.mdevals/worker-oom-and-one-customer-saw-another-companys-name/criteria.jsonevals/worker-oom-and-one-customer-saw-another-companys-name/task.mdreferences/http-cache-directives.mdreferences/lru-cache-trap.md

FAQ

Что делает скилл cache-key-discriminator-audit?

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.

Как установить скилл cache-key-discriminator-audit?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл cache-key-discriminator-audit запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить cache-key-discriminator-audit с