Authentication Security
Purpose
Assess whether the system's identity handling resists attack: are credentials stored safely, tokens/sessions handled correctly, flows enumeration- and brute-force-resistant, and revocation real. The review/audit lens; the design and construction live in ../../backend/backend-authentication.
When to Use
- Reviewing authentication design or an existing implementation for security.
- As the identity slice of
../../security-review and threat-modeling spoofing/elevation threats.
- Not for building auth (
../../backend/backend-authentication) or authorization (authorization-security).
Inputs
- The authentication design/implementation (
../../backend/backend-authentication).
- Threat model's identity threats (
threat-modeling).
Discovery Questions
- How are passwords stored (adaptive hash?), and are secrets/tokens ever logged?
- Session vs JWT — is revocation actually possible, and does logout/password-change invalidate?
- Are login/reset flows resistant to brute force (
abuse-prevention) and account enumeration?
- Are reset tokens/OTPs single-use, expiring, and attempt-limited? Is MFA (if present) implemented soundly?
Responsibilities
Confirm the credential input contract is enforced server-side, not only in the form (../../auth-form-validation) — including the breach check and enumeration-safe messages.
Verify credential storage: adaptive hashing (bcrypt/argon2/scrypt), never plaintext or fast hashes; no credentials/tokens in logs, errors, or URLs.
Assess session/token handling: httpOnly/secure/sameSite cookies for browsers (not localStorage tokens); short-lived access + rotating refresh with reuse detection for JWTs; signing keys managed (secrets-audit).
Verify revocation is real: logout and password change invalidate sessions/tokens; a pure-stateless JWT with no denylist can't truly revoke — flag the gap.
Check brute-force + enumeration resistance: login/reset/OTP throttled and CAPTCHA-guarded (abuse-prevention); responses don't reveal whether an account exists.
Review flows: reset tokens single-use + expiring; OTP attempt-limited + expiring; MFA/recovery-code secrets stored safely; verification flows sound.
Confirm findings become security regression tests (security-regression-testing).
Required Workflow
- Review credential storage + secret handling.
- Assess session/token issuance, expiry, rotation, revocation.
- Check brute-force + enumeration resistance on public flows.
- Review reset/OTP/MFA flows for reuse/expiry/limits.
- Record findings (Confirmed vs Potential); route mitigations to build skills + regression tests.
Decision Rules
- Fast-hash or plaintext passwords = confirmed high-severity finding.
- If revocation is required but the token scheme can't do it, that's a design finding, not a nitpick.
- Enumeration-revealing responses on login/reset are real findings — attackers harvest valid accounts.
- Client-held auth state is a hint, never proof; server must verify every request.
Rules
- Never print discovered secrets/credentials — reference location, flag rotation (
secrets-audit).
- Findings separated Confirmed vs Potential; never declare auth "secure" (
../../security-review).
- Each finding maps to a fix + a regression test.
Anti-Patterns
- Reviewing auth as if "logged in" implied "authorized" (that's
authorization-security).
- Passing an implementation with unrevocable long-lived tokens.
- Ignoring account enumeration in error messages/timing.
- Reset links that don't expire or reused OTPs.
- Treating rate limiting as the whole brute-force defense (it's one layer).
Validation Checklist
Definition of Done
A recorded authentication security assessment — credential storage, session/token handling, revocation, brute-force/enumeration resistance, and account flows — with Confirmed/Potential findings routed to fixes and security regression tests, and no "secure" claim.
Related Skills
../../backend/backend-authentication, authorization-security, abuse-prevention, secrets-audit, security-regression-testing, ../../security-review, threat-modeling, web-security, mobile-security.
Related Knowledge
../../../knowledge/ (identity threats, provider constraints).
Related References
../../../references/security/ (auth review checklists, when populated).
Context Loading Guidance
- Requires: the authentication design/impl, identity threats.
- Does not require: authorization model, unrelated code.
- May load:
../../backend/backend-authentication, abuse-prevention.
- Stop when: findings + routed mitigations/regression tests are recorded.
Token Efficiency Guidance
The finding table (area → issue → severity → fix → test) is the artifact; never echo real credentials/secrets.
1---2name: authentication-security3description: Use to review authentication for security weaknesses — credential storage, session/token handling, brute-force and enumeration resistance, reset/OTP/MFA flows, and logout/revocation. The security-review lens on identity; backend-authentication is the design/build skill.4---56# Authentication Security78## Purpose910Assess whether the system's **identity handling** resists attack: are credentials stored safely, tokens/sessions handled correctly, flows enumeration- and brute-force-resistant, and revocation real. The review/audit lens; the design and construction live in `../../backend/backend-authentication`.1112## When to Use1314- Reviewing authentication design or an existing implementation for security.15- As the identity slice of `../../security-review` and `threat-modeling` spoofing/elevation threats.16- **Not** for building auth (`../../backend/backend-authentication`) or authorization (`authorization-security`).1718## Inputs1920- The authentication design/implementation (`../../backend/backend-authentication`).21- Threat model's identity threats (`threat-modeling`).2223## Discovery Questions2425- How are passwords stored (adaptive hash?), and are secrets/tokens ever logged?26- Session vs JWT — is revocation actually possible, and does logout/password-change invalidate?27- Are login/reset flows resistant to brute force (`abuse-prevention`) and account enumeration?28- Are reset tokens/OTPs single-use, expiring, and attempt-limited? Is MFA (if present) implemented soundly?2930## Responsibilities3132- Confirm the credential **input contract** is enforced server-side, not only in the form (`../../auth-form-validation`) — including the breach check and enumeration-safe messages.3334- Verify **credential storage**: adaptive hashing (bcrypt/argon2/scrypt), never plaintext or fast hashes; no credentials/tokens in logs, errors, or URLs.35- Assess **session/token handling**: httpOnly/secure/sameSite cookies for browsers (not localStorage tokens); short-lived access + rotating refresh with reuse detection for JWTs; signing keys managed (`secrets-audit`).36- Verify **revocation is real**: logout and password change invalidate sessions/tokens; a pure-stateless JWT with no denylist can't truly revoke — flag the gap.37- Check **brute-force + enumeration resistance**: login/reset/OTP throttled and CAPTCHA-guarded (`abuse-prevention`); responses don't reveal whether an account exists.38- Review **flows**: reset tokens single-use + expiring; OTP attempt-limited + expiring; MFA/recovery-code secrets stored safely; verification flows sound.39- Confirm findings become **security regression tests** (`security-regression-testing`).4041## Required Workflow42431. Review credential storage + secret handling.442. Assess session/token issuance, expiry, rotation, revocation.453. Check brute-force + enumeration resistance on public flows.464. Review reset/OTP/MFA flows for reuse/expiry/limits.475. Record findings (Confirmed vs Potential); route mitigations to build skills + regression tests.4849## Decision Rules5051- Fast-hash or plaintext passwords = confirmed high-severity finding.52- If revocation is required but the token scheme can't do it, that's a design finding, not a nitpick.53- Enumeration-revealing responses on login/reset are real findings — attackers harvest valid accounts.54- Client-held auth state is a hint, never proof; server must verify every request.5556## Rules5758- Never print discovered secrets/credentials — reference location, flag rotation (`secrets-audit`).59- Findings separated Confirmed vs Potential; never declare auth "secure" (`../../security-review`).60- Each finding maps to a fix + a regression test.6162## Anti-Patterns6364- Reviewing auth as if "logged in" implied "authorized" (that's `authorization-security`).65- Passing an implementation with unrevocable long-lived tokens.66- Ignoring account enumeration in error messages/timing.67- Reset links that don't expire or reused OTPs.68- Treating rate limiting as the whole brute-force defense (it's one layer).6970## Validation Checklist7172- [ ] Credential storage: adaptive hashing; no secret logging.73- [ ] Session/token: secure cookies / rotating refresh; keys managed.74- [ ] Revocation real (logout/password-change invalidate).75- [ ] Brute-force + enumeration resistance verified.76- [ ] Reset/OTP/MFA flows: single-use, expiring, attempt-limited.77- [ ] Findings → fixes → regression tests.7879## Definition of Done8081A recorded authentication security assessment — credential storage, session/token handling, revocation, brute-force/enumeration resistance, and account flows — with Confirmed/Potential findings routed to fixes and security regression tests, and no "secure" claim.8283## Related Skills8485`../../backend/backend-authentication`, `authorization-security`, `abuse-prevention`, `secrets-audit`, `security-regression-testing`, `../../security-review`, `threat-modeling`, `web-security`, `mobile-security`.8687## Related Knowledge8889`../../../knowledge/` (identity threats, provider constraints).9091## Related References9293`../../../references/security/` (auth review checklists, when populated).9495## Context Loading Guidance9697- **Requires:** the authentication design/impl, identity threats.98- **Does not require:** authorization model, unrelated code.99- **May load:** `../../backend/backend-authentication`, `abuse-prevention`.100- **Stop when:** findings + routed mitigations/regression tests are recorded.101102## Token Efficiency Guidance103104The finding table (area → issue → severity → fix → test) is the artifact; never echo real credentials/secrets.