auth-flow-reviewer
Skill1 starsChanged 5 days agoMITView on GitHub
Read-only review of authentication AND authorization flows — session/token model, cookie flags, CSRF, token rotation, password-reset/email-verification, OAuth redirect/state, and per-route object-level access checks — for exploitable gaps. Use before shipping login/session/token code, when adding a protected route or sharing-by-URL feature, or during a security pass. Reports findings by severity with location, impact, and the concrete fix; never edits code.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- mrenigmatic19/claude_skillstheir own version, first seen Oct 8, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- mrenigmatic19/claude_skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository163 other files it gives its agents.
- agents.mdAGENTS.md
- 3d-asset-handoff-sheetSkill
- accessibility-regression-auditorSkill
- adr-writerSkill
- agent-memory-designerSkill
- agent-trajectory-evaluatorSkill
- alerting-rules-tunerSkill
- analysis-memo-writerSkill
- annotation-disagreement-ledgerSkill
- annotation-task-spec-builderSkill
- api-deprecation-plannerSkill
- api-error-contract-designerSkill
- architecture-diagram-generatorSkill
- asset-metadata-review-ledgerSkill
- background-job-reliability-auditorSkill
- branch-rebaserSkill
- brand-voice-profilerSkill
- bundle-analyzerSkill
- cache-policy-designerSkill
- canary-release-plannerSkill
- caption-correction-ledgerSkill
- changelog-from-prsSkill
- chart-chooserSkill
- chunking-strategy-optimizerSkill
- circular-dependency-breakerSkill
- claude-settings-auditorSkill
- code-example-verifierSkill
- cold-email-deliverability-auditorSkill
- cold-start-optimizerSkill
- commit-splitterSkill
- competitor-teardownSkill
- component-spec-writerSkill
- connection-pool-tunerSkill
- content-repurposerSkill
- contract-obligation-registerSkill
- contract-test-designerSkill
- conventional-commitsSkill
- cors-configuratorSkill
- coverage-gap-finderSkill
- crm-export-auditorSkill
- dashboard-designerSkill
- data-retention-auditorSkill
- dataset-first-lookSkill
- dead-code-finderSkill
- deadlock-diagnoserSkill
- decision-log-reconcilerSkill
- dependency-auditSkill
- dependency-upgrade-plannerSkill
- design-brief-writerSkill
- design-critique-checklistSkill
- design-token-extractorSkill
- devcontainer-designerSkill
- distributed-tracing-instrumenterSkill
- dockerfile-optimizerSkill
- email-sequence-drafterSkill
- embedding-index-tunerSkill
- embedding-set-inspectorSkill
- entity-match-candidate-ledgerSkill
- exit-ticket-builderSkill
- extract-moduleSkill
- The first 60 shown.
The file
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 12
Before shipping login, signup, session, JWT, or refresh-token code.
- Distinctive: line 13
When adding a new protected route, an admin action, or a "share by link / by ID" feature — anywhere a request carries an object identifier.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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
Review authentication and authorization code for exploitable gaps without touching a line of it. The skill walks the session/token model, cookie flags, CSRF defenses, token lifecycle, password-reset and email-verification flows, and OAuth parameter validation — then spends most of its effort on the part teams routinely skip: confirming that every protected route enforces an object-level access check. A login form that works tells you nothing about whether user A can read user B's invoice by editing an ID. Output is a findings list grouped by severity, each with a location, the concrete impact, and the fix.
When to use this skill
- Before shipping login, signup, session, JWT, or refresh-token code.
- When adding a new protected route, an admin action, or a "share by link / by ID" feature — anywhere a request carries an object identifier.
- Reviewing a password-reset, email-verification, or OAuth/SSO integration.
- During a scheduled security pass, or after a pentest/bug report mentioning broken access control.
[!WARNING] Authentication ≠ authorization. The most common, highest-impact real bug is a fully logged-in, legitimate user accessing another user's object (IDOR) —
GET /api/orders/123returning order 123 to whoever asks, regardless of owner. If you only verify that login works, you will miss it. Audit the per-object check on every route, not just the session.
Instructions
- Map the surface first. Glob for routers, middleware, controllers, and guards (
**/routes/**,**/middleware/**,**/*controller*,**/*guard*,**/auth/**). Build a list of every endpoint and tag each as public, authenticated-only, or authorized (requires ownership/role). You cannot review what you have not enumerated — an unlisted route is the one that ships unprotected. - Classify the session model. Determine whether the app uses server-side sessions (cookie holds an opaque session id) or stateless tokens (cookie/header holds a JWT). The two have different failure modes: sessions need a server store and explicit invalidation on logout; JWTs cannot be revoked before expiry without a denylist. Flag any hybrid where a JWT is treated as revocable but no denylist exists.
- Audit cookie flags on every auth cookie. Confirm
HttpOnly(blocks JS/XSS theft),Secure(HTTPS-only), and an explicitSameSite(Laxminimum;Strictfor the session cookie when feasible;NonerequiresSecureand a CSRF defense). Grep for cookie-setting calls (set-cookie,res.cookie,Set-Cookie, framework session config) and report any auth cookie missing a flag, with the exact line. - Verify CSRF protection on state-changing requests. Any cookie-authenticated
POST/PUT/PATCH/DELETEneeds a CSRF defense: a per-session synchronizer token, double-submit cookie, or strictSameSiteplus origin checking. Token/Authorization: Bearerflows in headers are not CSRF-prone, but cookie flows are. Flag every mutating, cookie-authed endpoint with no token check or origin/referer validation. - Trace the token lifecycle. For JWTs/access tokens, check: signing algorithm is pinned (reject
alg: noneand confirm the verifier does not accept attacker-chosen algorithms), expiry is short (minutes, not days), the secret/key is not hardcoded, and the payload carries no secrets. For refresh tokens, require server-side storage, rotation on use (old token invalidated when a new one is issued), and reuse-detection that revokes the family on replay. Flag tokens stored inlocalStorage(XSS-readable) where a cookie would be safer. - Review password reset and email verification as untrusted token flows. For each, confirm: the token is high-entropy (CSPRNG, not a sequential id, timestamp, or weak hash), single-use (consumed/invalidated after first use), short-lived (minutes to an hour), and bound to the target user. Critically, confirm the flow does not enumerate users — the "reset email sent" and "verify" responses must be identical for existing and non-existing accounts (same body, same status, same timing). Flag any reset that returns "no such user".
- Validate OAuth/SSO parameters. Confirm
redirect_uriis checked against an exact-match allowlist (not a prefix/substring/regex that an attacker can satisfy withevil.com?x=trusted.com), and that thestateparameter is generated, stored, and verified on callback to stop CSRF/login-fixation. For authorization-code flows, confirm PKCE is used for public clients and the code is exchanged server-side. - Enforce object-level authorization on every protected route — the core check. For each endpoint that accepts an object id (path param, query, or body), confirm the handler verifies the current principal is allowed to act on that specific object (e.g.
WHERE owner_id = session.user.id, or an explicit policy/ability check), not merely that someone is logged in. Look for the anti-pattern: authentication middleware present, but the query fetches by id alone. Also check privilege escalation: role/permission read from the request body or a client-supplied field instead of the server-trusted session; missingisAdmingates on admin endpoints; mass-assignment that lets a user set their ownrole. - Report; do not modify. Produce the severity-grouped findings (see Output). The skill is read-only — propose the fix, leave the change to the author.
[!NOTE] Test the negative path in your reasoning, not just the happy path: for every "user can see their data" check, ask "what stops them from seeing someone else's?" and "what happens if I delete the auth header / swap the id / replay the token?". Findings come from the requests the code forgot to reject.
Output
A findings report grouped by severity, with a one-line scope header (what was reviewed) and, for each finding, a file:line location, the impact in attacker terms, and the concrete fix. Nothing is edited.
Auth flow review — scope: src/routes/**, src/middleware/auth.ts, src/auth/oauth.ts
12 endpoints enumerated (3 public, 5 authenticated, 4 authorized)
CRITICAL
- IDOR on invoice fetch — src/routes/invoices.ts:41
Impact: any logged-in user reads any invoice; `findById(req.params.id)` has no
owner check. GET /api/invoices/123 returns 123 to anyone.
Fix: scope the query — findOne({ id, ownerId: req.session.userId }); 404 on miss.
- Privilege escalation via body — src/routes/users.ts:88
Impact: PATCH /api/users/me accepts { role } from the request body (mass assignment);
a user can set role: "admin".
Fix: whitelist updatable fields; derive role only from server state, never the body.
HIGH
- Refresh token not rotated — src/auth/tokens.ts:53
Impact: a stolen refresh token works until expiry and is never invalidated on reuse.
Fix: rotate on each use, persist the new token, and revoke the family on replay.
- User enumeration on password reset — src/routes/auth.ts:120
Impact: reset endpoint returns 404 "no such user", letting attackers harvest valid emails.
Fix: return an identical 200 "if an account exists, an email was sent" in all cases.
MEDIUM
- Session cookie missing SameSite — src/middleware/session.ts:17
Impact: cookie sent on cross-site requests; widens CSRF exposure.
Fix: add SameSite=Lax (or Strict) alongside HttpOnly and Secure.
- OAuth redirect_uri prefix match — src/auth/oauth.ts:34
Impact: startsWith() allows https://trusted.com.evil.com — open redirect / token theft.
Fix: exact-match redirect_uri against a registered allowlist.
Summary: 2 critical, 2 high, 2 medium. No code modified.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.

