Skip to content

AL-JANEF/janef-forge / skills/security/auth-hardening

auth-hardening

Verified

Review, harden, and design authentication and session management: login, logout, session lifecycle, password storage, JWT and cookie handling, refresh tokens, brute-force and enumeration resistance, MFA/OTP, password reset, roles and permissions. Use whenever a task touches sign-in, sessions, tokens, or authorization, even casually. Defensive only.

FileKindSize
SKILL.mdskill md6.6 KB
capability.jsonconfig2.3 KB
references/checklist.mdmarkdown1.8 KB
references/session-patterns.mdmarkdown4.2 KB

references/checklist.md

View on GitHub
# Auth Pre-Ship Checklist

A fast final pass before shipping any auth change. Each line is a yes/no with the
answer that should be "yes." If any is "no," it's a finding.

## Password storage
- [ ] Passwords hashed with argon2id or bcrypt (cost >= 12), never a fast hash
- [ ] Salts unique per password (handled automatically by argon2/bcrypt)
- [ ] No password, token, or secret written to logs

## Sessions & logout
- [ ] Session model is explicit (stateful vs. stateless) and documented
- [ ] Logout actually invalidates server-side (record deleted, version bumped,
      or token denylisted) — not just cleared from the client
- [ ] Sessions/tokens expire; access tokens are short-lived
- [ ] Password change / reset invalidates existing sessions

## Cookies & tokens
- [ ] Session cookies are HttpOnly + Secure + SameSite
- [ ] JWT algorithm pinned server-side; `alg: none` rejected
- [ ] JWT `exp`, `iss`, `aud` validated
- [ ] Refresh tokens rotate on use; reuse is detected and revokes the family

## Brute-force & enumeration
- [ ] Rate limiting on login and reset (per account and per IP)
- [ ] Lockout/throttling after repeated failures (without enabling easy DoS)
- [ ] Login errors are uniform — no "user not found" vs "wrong password" leak
- [ ] Password reset response is identical whether or not the account exists

## Authorization (adjacent, but check it)
- [ ] Every protected endpoint verifies authorization server-side
- [ ] Object access checks ownership (no IDOR via changing an id)
- [ ] Multi-tenant: queries are scoped to the tenant; no cross-tenant leakage

## Reset & MFA
- [ ] Reset tokens are single-use, short-lived, high-entropy
- [ ] MFA/OTP delivery tradeoffs understood (SMS is weakest)

## Proof
- [ ] The fix is demonstrated with a real request/response or test, not asserted
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall