Skills

Audit Auth

Audit authentication and session-management code for common issues, weak JWT config...

Install

npx skills add vigolium/vigolium --skill audit-auth -g -a claude-code -y
Repository
vigolium/vigolium1.1k
Category
Engineering
Updated
10d ago
License
MIT
Context cost
Lightabout 785 tokens
Runs scripts
No, instructions only

What it does

Audit authentication and session-management code for common issues, weak JWT config, session fixation, password-handling flaws, insecure cookies, broken OAuth flows, and missing auth checks on routes. Use when the user asks to review auth code or when source-aware scanning targets login/session/token handling.

Authentication & Session Code Audit

You are auditing authentication and session-management code. Your goal is to identify concrete, reproducible vulnerabilities, not style nits. Each issue you raise must map to a CWE and a specific file + line range, and must be persisted via the report_finding tool.

Scope, what to look for

Work through these in order; some targets will be irrelevant (skip and say so in your final summary rather than fabricating findings):

1. JWT / token handling

  • alg=none accepted by the verifier (CWE-327)
  • Secret reused for HMAC and RSA (key confusion, CWE-347)
  • Hard-coded secrets or secrets pulled from non-secret sources
  • Missing iss, aud, exp validation (CWE-345)
  • Tokens logged at INFO level (CWE-532)

2. Session management

  • Session IDs derived from user input or predictable sources (CWE-330)
  • No session rotation on privilege change (CWE-384 session fixation)
  • Cookies missing HttpOnly, Secure, or SameSite (CWE-1004)
  • Long or unbounded session lifetime

3. Password handling

  • Plaintext storage or fast hashes (MD5/SHA1/SHA256 without KDF) (CWE-916)
  • Passwords in URL query strings, logs, or error messages
  • Timing-unsafe comparison of password hashes (CWE-208)
  • No rate limiting on login (CWE-307)

4. OAuth / OIDC

  • Missing state / PKCE (CWE-352 CSRF on auth flow)
  • Open redirect on callback (CWE-601)
  • redirect_uri not validated against allowlist
  • Token exposure via referer or fragment-in-GET

5. Route-level auth

  • Handlers that forget to call the auth middleware
  • Role checks on client-supplied fields (e.g., trusting req.body.role)
  • IDOR: authorization based on URL param without ownership check (CWE-639)

Recommended workflow

Read the whole SKILL.md on GitHub

More in Engineering