/code-audit:authentication-flow-review [path or scope]from code-audit
Audits authentication flows for vulnerabilities including password hashing, JWT configuration, session management, brute force protection, and account enumeration defenses. Adapts principles across frameworks.
Ships in code-audit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Target: $ARGUMENTS
If no target path is given above, review the entire codebase.
Stack note: The code examples and library references below use Node.js/Express conventions (
bcrypt,jsonwebtoken,zod/joi,req.body, etc.). If the codebase uses a different language or framework, apply the same security principles and adapt the specifics — for example:bcrypt→passlib/Argon2id(Python),spring-security(Java),bcrypt(Go);jsonwebtoken→PyJWT,java-jwt,golang-jwt/jwt;mongoose.set('sanitizeFilter')→ the equivalent ORM sanitization setting. Mark any checklist item Not Applicable if the concept doesn't apply to the detected stack.
Conduct a comprehensive authentication security review:
Check for:
Password hashing
bcrypt.hash() with salt rounds ≥ 10 (ideally 12); async, not sync; no double-hashing on updates.bcrypt.compare() used for login.JWT secret/key strength & storage
Token settings
algorithms, issuer (iss), audience (aud), subject (sub), jti, iat, exp, and optional nbf are enforced in verify.Refresh token implementation
jti, ua, ip, expiresAt).Session invalidation
pwdChangedAt or increment tokenVersion vs jwt.iat).Brute force protection
Account enumeration defenses
Password reset flow security
crypto.randomBytes(32), hashed at rest (SHA-256), short TTL (≤ 15–30 min), one-time use, invalidated after success.Email verification
SQL/NoSQL injection in auth paths
$where; parameterized SQL if applicable.AuthZ integrity
Cookie & CSRF configuration (if cookies used)
HttpOnly, Secure, SameSite=Lax|Strict, narrow path/domain, explicit Max-Age.Input validation & normalization
Mass assignment risks
role, emailVerified, passwordResetToken, etc., from req.body.JWT misuse
jwt.decode() for authorization decisions; always jwt.verify() with explicit algorithms.Logging & telemetry
Dependency & crypto hygiene
jsonwebtoken and bcrypt versions; no custom JWT parser; Node crypto used correctly; no MD5/SHA* for password hashing.Transport & CORS
Open redirect / next param
next= redirects.Operational controls
Provide:
A structured finding report with the following for each issue:
A summary risk score (0–10) and top 3–5 prioritized fixes that reduce risk fastest.
A checklist diff: which items from the “Check for” list are Pass/Fail/Not Applicable.
Constraints & style:
Bonus (if applicable):
jti blacklist service, adding device/session management UI, enabling mongoose.set('sanitizeFilter', true)).Provide specific vulnerabilities found with severity ratings.
Write this into a markdown file and place it in the audits/ folder.
What SKILL.md sets; muted values are Claude Code's defaults
22 skills in this plugin
/api-and-infrastructureReviews API and infrastructure security configuration, including endpoints, headers, transport, and deployment settings. Use when auditing API or infrastructure hardening./authorization-implementationAnalyzes authorization and access-control logic across routes and resources for privilege and enforcement flaws. Use when auditing authorization, RBAC, or access control./business-logic-vulnerabilitiesAnalyzes business logic for security flaws such as workflow bypasses, race conditions, and abuse cases. Use when reviewing application logic for exploitable behavior./code-duplication-detectionDetects duplicated and near-duplicate code across the codebase and suggests consolidation. Use when reviewing for copy-paste code, repeated logic, or DRY violations./code-quality-metrics-standardsAnalyzes code complexity and adherence to quality standards, flagging overly complex functions and metric outliers. Use when auditing maintainability, cyclomatic complexity, or coding-standard compliance./comprehensive-security-reportAggregates findings from the other security audits into one prioritized security report. Use after running individual security reviews to produce a consolidated report.npx claudepluginhub jeremymorgan/code-review-skills --plugin code-auditOther plugins' skills for the same job