authentication-security
/authentication-security
Review and harden authentication in a SaaS application — login, registration, password storage, sessions and cookies, JWT/API tokens, MFA, OAuth/SSO and account recovery. Use when touching auth code or auditing identity flows.
- Author
- IbrahimCodeur ↗
- Repository
- saas-blind-security ↗
- Licence
- MIT
- Last repository change
- 07.11.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 07.11.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Review and harden authentication in a SaaS application — login, registration, password storage, sessions and cookies, JWT/API tokens, MFA, OAuth/SSO and account recovery. Use when touching auth code or auditing identity flows.
Original author description
Review and harden authentication in a SaaS application — login, registration, password storage, sessions and cookies, JWT/API tokens, MFA, OAuth/SSO and account recovery. Use when touching auth code or auditing identity flows.
How it works
- Objectives
- Steps
- Security rules
- Validation criteria
SKILL.md preview
---
name: authentication-security
description: Review and harden authentication in a SaaS application — login, registration, password storage, sessions and cookies, JWT/API tokens, MFA, OAuth/SSO and account recovery. Use when touching auth code or auditing identity flows.
---
# Authentication security
Part of saas-blind-security — created and maintained by IbrahimCodeur.
## Objectives
- Only legitimate users obtain sessions or tokens, and those credentials cannot be forged, stolen easily or reused.
- Account recovery and MFA cannot be used to bypass authentication.
- Align with OWASP ASVS V2 (Authentication) and V3 (Session Management).
## Steps
1. **Map the flows.** Registration, login, logout, password change, password reset, email change, MFA
enrolment/verification/recovery codes, OAuth/SSO callbacks, API keys, "remember me", impersonation.
2. **Password storage.** Must use a slow adaptive hash: Laravel `Hash::make` (bcrypt/argon2id), Django
`make_password` (PBKDF2/argon2), Node `bcrypt`/`argon2`. Flag md5/sha1/sha256 of passwords
(Semgrep: `sbs-*-weak-password-hash`). Check minimum length (≥ 8, ASVS recommends 12+ for new
systems), breached-password checks if available, no maximum length below 64.
3. **Brute force & enumeration.** Rate limit login, reset and MFA endpoints per account and per IP
(Laravel `RateLimiter`/`throttle`, `express-rate-limit`, Django-axes / DRF throttling). Same response and
timing for "unknown user" and "wrong password"; reset endpoints must not reveal whether an email exists.
4. **Sessions.** Regenerate session ID on login and privilege change (`$request->session()->regenerate()`,
Django does this on `login()`, `req.session.regenerate` in express-session). Invalidate other sessions on
password change. Server-side logout. Idle and absolute timeouts.
5. **Cookies.** `HttpOnly`, `Secure`, `SameSite=Lax` (or `Strict`), narrow `Domain`/`Path`.
Laravel `config/session.php`, Django `SESSION_COOKIE_*`/`CSRF_COOKIE_*`, express-session `cookie: {}`.
6. **Tokens/JWT.** Verify signature with a pinned algorithm list (`jwt.verify(t, key, {algorithms:[...]})`,
PyJWT `algorithms=[...]`); never `jwt.decode` for authentication; validate `exp`, `nbf`, `iss`, `aud`.
Short-lived access tokens, rotating refresh tokens stored hashed, revocation on logout/password change.
API keys: random ≥ 128 bits, stored hashed, scoped, revocable, shown once.
7. **Password reset.** Single-use, random (CSPRNG) token stored hashed, expires ≤ 60 min, invalidated after
use and after password change, sent only to the verified address, no token in referrer/logs.
8. **MFA.** TOTP/WebAuthn verification server-side, rate-limited; recovery codes hashed and single-use; MFA
required again for disabling MFA or changing email; no "MFA required" flag the client can skip.
9. **OAuth/SSO.** `state` parameter (CSRF), PKCE for public clients, exact redirect-URI matching, verify ID
token signature/audience, link accounts only on verified email, no account takeover via unverified
provider emails.
10. **Email change / account linking.** Confirm via the old and new address; re-authenticate.
## Security rules
- Never log passwords, tokens, reset links, MFA secrets or session IDs.
- Never weaken a check to fix a login bug (e.g. skipping MFA, accepting unsigned tokens, widening CORS).
- Do not test credentials found in the code against real services.
- Changes to auth flows require user approval and tests for both success and failure paths.
## Validation criteria
- [ ] Tests prove: wrong password fails, locked/rate-limited after N attempts, reset token single-use and expiring,
forged/expired/`alg:none` JWT rejected, session ID changes after login, sessions invalidated after password change.
- [ ] Password hashing uses an adaptive algorithm.
- [ ] Cookie flags verified (code + `scripts/check-headers.sh` on a local instance).
- [ ] No user-enumeration difference in responses.
Versions
The database has no other skills named authentication-security.
Database snapshot: 13.11.2026 · package version fa6e24371183 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 1 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 90security-authentication-and-sessions
Assess and remediate authentication, sessions, identity tokens, mfa, federated sign-in and logout in frontend and associated web services. Use for login, session renewal or expiry, cookies, MFA, OAuth, OIDC, JWT, account recovery. - 90auth
Auth & identity security lens. Use on any task touching login, signup, OAuth, OIDC, SAML, sessions, cookies, JWT, password reset, MFA, and when the user says "doberman" or asks if this is safe. Defensive use only. - 100watchdog-go-auth
On-demand auth audit (Login, OAuth/OIDC, sessions, password reset, MFA, JWT, SSO). Use for /watchdog-go-auth. Defensive use only. - 95identity-access-control
Use this capability for login, signup, session management, OAuth/OIDC, SSO, JWT, cookies, MFA, RBAC, ABAC, ReBAC, permission checks, service identities, and access reviews. Trigger on auth, login, signup, token, JWT, OAuth, OIDC, SSO, session, cookie, role, permission, MFA, 2FA,… - 100auth-implementation
Implements authentication and authorization safely - OAuth 2.0 and OpenID Connect flows with PKCE, sessions vs tokens, token validation, refresh rotation, logout, RBAC/ABAC/ReBAC checks, service-to-service auth, MFA and passkeys. Use when adding login or SSO, integrating an… - 100agent-auth-specialist
Specialist subagent: OAuth 2.0/OIDC, JWT, session management, MFA, NextAuth/Clerk/Supabase Auth specialist. Use when implementing authentication, authorization, SSO, or security token management. Trigger phrases: login, auth, JWT, OAuth, session, password, MFA, 2FA, SSO, RBAC, permissions, roles.