Skip to content
Back to skills

Auth Antipatterns

ASecurity

Forbidden authentication and session-management patterns — weak token generation, insecure password hashing, session fixation, JWT algorithm confusion, missing rate limits, and account enumeration. Applies when writing auth, login, session, token, password, or OAuth code.

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 21, 2026
ai-agentsgo

Security analysis

A100/100

Pro scans all 12 files and shows the line behind each finding

Scanned October 21, 2026

npx -y skills add emgiezet/aisdlc --skill auth-antipatterns --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Auth Antipatterns?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Auth Antipatterns
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/emgiezet-auth-antipatterns/badge)](https://www.skillsdirectory.com/skills/emgiezet-auth-antipatterns)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: auth-antipatterns
description: Forbidden authentication and session-management patterns — weak token generation, insecure password hashing, session fixation, JWT algorithm confusion, missing rate limits, and account enumeration. Applies when writing auth, login, session, token, password, or OAuth code.
paths: ["**/auth/**","**/*auth*","**/*login*","**/*session*","**/*token*","**/*password*","**/*oauth*"]
user-invocable: false
---

# Authentication and account-takeover anti-patterns — do not write these

Checks run automatically after each edit. Findings reference the IDs below.

## Blockers
- AP-AUTH-001 — Use a CSPRNG (secrets.token_urlsafe/randomBytes/rand.Reader) for all tokens; min 128-bit entropy.
- AP-AUTH-002 — Hash reset tokens (SHA-256) before storage; single-use only; expire within 15 minutes.
- AP-AUTH-003 — Hash passwords with argon2id (or bcrypt cost≥12 / scrypt); never MD5, SHA-1, or unsalted SHA.
- AP-AUTH-005 — Pin the JWT algorithm; verify iss, aud and exp; reject alg=none and mixed HMAC/RSA keys.
- AP-AUTH-006 — Re-authenticate before email or password changes; notify the previous address immediately.
- AP-AUTH-010 — Use state + PKCE in the authorization-code flow; match redirect_uri against an exact allowlist.

## Errors
- AP-AUTH-004 — Regenerate the session ID on login; enforce idle (30 min) and absolute (8 h) lifetime limits.
- AP-AUTH-007 — Invalidate all sessions and refresh tokens on password reset or MFA change.
- AP-AUTH-008 — Rate-limit login, OTP, and reset to ≤5 attempts/min per IP; lock after 10 failures.
- AP-AUTH-009 — Return identical message, status, and response time for bad email and bad password.
- AP-AUTH-011 — OTP codes expire in 5 min, allow ≤5 attempts, are single-use, and must never appear in URLs.

Details for any ID: `reference/<ID>.md`

Files in this skill

  • SKILL.md1.8 KB
  • reference/AP-AUTH-001.md1 KB
  • reference/AP-AUTH-002.md1.1 KB
  • reference/AP-AUTH-003.md1 KB
  • reference/AP-AUTH-004.md1.1 KB
  • reference/AP-AUTH-005.md971 B
  • reference/AP-AUTH-006.md1.2 KB
  • reference/AP-AUTH-007.md1.2 KB
  • reference/AP-AUTH-008.md1.4 KB
  • reference/AP-AUTH-009.md1.3 KB
  • reference/AP-AUTH-010.md1.4 KB
  • reference/AP-AUTH-011.md1.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.