authn-authz-design-review
Skill0 starsChanged 5 months agoMITView on GitHub
Reviews authentication and authorization design for gaps in identity, session, and access-control enforcement. Use when designing or auditing login, sessions, tokens, permissions, multi-tenancy isolation, or when investigating an access-control bug like privilege escalation or data leakage between users.
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
The auth boundary: every protected entry point re-establishes identity.
- Distinctive: line 21
Function + object level: verify both that the user may perform the *action* and may touch the specific *object/tenant*.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AuthN / AuthZ Design Review
Authentication proves who you are; authorization decides what you may do. Conflating them, or enforcing either in the wrong place, is the source of most access-control breaches. They are separate systems and must both be checked on every request.
Authentication: establishing identity
- Credential handling: passwords hashed with a slow, salted KDF (argon2/bcrypt/scrypt) — never fast hashes, never reversible. MFA for sensitive access.
- Session/token integrity: sessions must be unguessable, rotated on privilege change, invalidatable server-side, and bound to expiry. JWTs that can't be revoked are a liability for logout/compromise; verify signature,
alg, audience, and expiry — rejectalg: none. - The auth boundary: every protected entry point re-establishes identity. "Authenticated once, trusted forever" within a session is how stolen tokens become persistent access.
Authorization: the part that's usually broken
- Enforce on every access, server-side, at the resource: the most common vulnerability class (IDOR / broken object-level authorization) is checking authentication but not whether this user may access this object.
GET /orders/123must verify 123 belongs to the caller. - Deny by default: access is granted explicitly, never the absence of a deny. New endpoints should be locked until opened.
- Check at the right layer: authorization in the UI or API gateway alone is bypassable; enforce at the data/service layer closest to the resource.
- Function + object level: verify both that the user may perform the action and may touch the specific object/tenant.
Adversarial validation
- IDOR sweep: for every endpoint that takes an ID, can user A pass user B's ID and get B's data? Test horizontally (peer) and vertically (privilege escalation).
- Multi-tenant isolation: can tenant A reach tenant B's data via a shared cache, a missing tenant filter in a query, or a guessable identifier?
- Token abuse: replay an expired/revoked token, tamper with claims, swap
alg, reuse a token after logout or password change — does any of it still work? - Privilege transitions: does the session/token refresh privileges when a role is removed, or does a demoted user keep old powers until they log out?
- The forgotten path: admin endpoints, batch/export, internal APIs, and GraphQL resolvers often skip the authz check the main path has.
Non-obvious risks
- Authorization logic duplicated across services drifts; one service's stale check becomes the hole. Centralize the decision, enforce locally.
- Caching authorized responses can serve them to the wrong user if the cache key omits identity/tenant.
- "Soft delete" and "disabled" accounts often retain valid tokens; disabling must invalidate sessions.
Output structure
Deliver: the authN mechanism (credential storage, MFA, session/token integrity and revocation), the authZ model (deny-by-default, enforcement layer, object+function level), the IDOR/tenant-isolation test results, the privilege-transition handling, and the forgotten paths (admin, export, internal) explicitly verified.
In this repository29 other files it gives its agents.
- adversarial-code-reviewSkill
- api-contract-designSkill
- attack-surface-mappingSkill
- benchmark-designSkill
- capacity-scalability-planningSkill
- concurrency-race-analysisSkill
- data-consistency-modelingSkill
- data-exfiltration-analysisSkill
- distributed-consensus-designSkill
- error-handling-architectureSkill
- event-driven-architectureSkill
- experiment-designSkill
- hypothesis-falsificationSkill
- incident-rca-postmortemSkill
- legacy-refactoring-strategySkill
- literature-synthesisSkill
- metrics-designSkill
- multi-layer-caching-strategySkill
- mvp-scope-cuttingSkill
- performance-profilingSkill
- rate-limiting-designSkill
- requirements-disambiguationSkill
- secrets-management-auditSkill
- statistical-validity-analysisSkill
- supply-chain-risk-analysisSkill
- system-decomposition-synthesisSkill
- threat-modelingSkill
- tradeoff-decision-frameworkSkill
- user-failure-mode-mappingSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

