Skip to content
Skills Library
Security · Review & audit

cache-key-authorization-alignment

/cache-key-authorization-alignment

Verify response caches key on identity and tenant, so one caller's authorization state never serves another caller its content. Use when the stack includes response caches, CDNs, edge caches or per-tenant intermediaries in front of authorized endpoints

Repository
authzmap ↗
Licence
MIT
Last repository change
28.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
2
Deprecation

No signals detected. Repository changed on 28.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Verify response caches key on identity and tenant, so one caller's authorization state never serves another caller its content. Use when the stack includes response caches, CDNs, edge caches or per-tenant intermediaries in front of authorized endpoints

Original author description

Verify response caches key on identity and tenant, so one caller's authorization state never serves another caller its content. Use when the stack includes response caches, CDNs, edge caches or per-tenant intermediaries in front of authorized endpoints

How it works

  1. Procedure
  2. Signals
  3. Patterns
  4. Pitfalls
  5. Done when
  6. References
Original SKILL.md headings · 61 lines, 414 words
SKILL.md preview
---
name: cache-key-authorization-alignment
description: "Verify response caches key on identity and tenant, so one caller's authorization state never serves another caller its content. Use when the stack includes response caches, CDNs, edge caches or per-tenant intermediaries in front of authorized endpoints"
pack: authzmap
version: 1.0.0
category: api-security
tags: [caching, authorization, tenant]
---

# Cache Key Authorization Alignment

> Verify response caches key on identity and tenant, so one caller's authorization state never serves another caller its content

**Use when:** the stack includes response caches, CDNs, edge caches or per-tenant intermediaries in front of authorized endpoints

**Avoid when:** the API is uncached end to end and you can prove every request runs through the authorization check directly

## Procedure

1. Trace which layers cache: edge proxy, application-instance memo, browser directive and service-level deduplication.
2. Issue the same authorized operation repeatedly with each of your two identities and diff response bodies where caching may differ.
3. Inspect cache-related response headers for which content is shared and which carries identity-sensitive state across callers.
4. Test whether identity-changing request attributes alter the served copy: credential, tenant, locale and client version headers.
5. Check writes after reads, since a cached authorized response may continue serving content after state changed beneath it.
6. Record each cache layer with its key inputs so the report can state exactly which parts of the pipeline are identity-aware.

## Signals

- A response addressed to one caller is also served to a second caller, or partial body differs only by call count rather than identity.
- Identity-specific cache key parts exist only for a few endpoints while the majority forget them.
- After role or ownership change downstream, the served copy does not re-authorize and instead serves stale authorized output.
- Tenant-specific details leak to another tenant when the cache sees a similar parameter set with a different credential.

## Patterns

**1. Key inventory**

```text
layer=app-cache  key_path=credential,tenant,locale  since_billed=Vary:Authorization
```

**2. Shared cache**

```text
alice-request cached -> bob plans same -> served alice's body -> identity skipped from key
```

**3. Result row**

```text
endpoint=/api/me cache=edge  key=vary=none identity-served-to-others=yes
```

## Pitfalls

- Estimating caches by the response headers you saw in browser tools, missing intermediaries that never emit headers.
- Testing reads without also testing the write-invalidation path, which is where staleness becomes a real authorization break.
- Attributing the leak to the incorrect layer without isolating which cache involved actually carries the identity-erred key set.

## Done when

- Every cache layer in the pipeline has a documented key inventory, including upstream and internal ones without response headers.
- Identity-erred keys, if found, are located at a specific layer with reproducible requests showing the wrong body served to the wrong caller.

## References

- [MDN - HTTP caching](https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching)
- [OWASP - session and request isolation cheating](https://cheatsheetseries.owasp.org/)

Versions

The database has no other skills named cache-key-authorization-alignment.

Database snapshot: 13.11.2026 · package version 4cfacd55ea3b (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100tenant-isolation
    Enforces tenant isolation in B2B SaaS on every path (web, API, jobs, caches, exports, webhooks, realtime): a fail-closed tenant context, scoped input IDs, scoping versus PostgreSQL RLS, cross-tenant probe tests. Use when adding a tenant-owned model, endpoint, job, cache key or…
  • 90rag-data-exposure-audit
    Assesses document authorization, tenant isolation, raw-chunk fields, citations, caches, exports, and sensitive-source leakage in retrieval systems. Use when an authorized RAG assessment must determine what data each identity can retrieve or disclose.
  • 90multi-tenant-security
    Verify tenant isolation in a multi-tenant SaaS — detect IDOR/BOLA, cross-tenant queries, filtering mistakes, leaky caches, jobs, files, search and exports — and enforce tenant scoping by design. Use whenever the app serves several organisations, teams, workspaces or customer accounts.
  • 85multi-tenant-access-control
    Design, implement, or review tenant isolation and authorization across SaaS resources, roles, memberships, workers, caches, and administrative workflows. Use for access decisions or cross-tenant risks; skip authentication-only work and ordinary features with unchanged access boundaries.
  • 100rate-limit-boundary-fairness
    Check that rate limits and quotas are assigned and consumed per identity, so exhaustion of one caller cannot perturb another's authorization guarantees. Use when the API enforces rate limits, quotas or concurrency caps alongside its authorization checks
  • 100finops-caches
    GitHub Actions cache analysis — size, prefix/branch breakdown, stale detection. Use when investigating cache bloat, stale caches, or auditing cache key strategies.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.