Autonomous validation of authentication security. Checks password hashing, cookie configuration, CSRF protection, and session management for OWASP compliance.
This SKILL automatically activates when:
**/auth/** are created/modifiedPassword Hashing:
@node-rs/argon2)Cookie Security:
secure: true (HTTPS-only)httpOnly: true (XSS prevention)sameSite: 'lax' or 'strict' (CSRF mitigation)Session Configuration:
CSRF Protection:
Rate Limiting:
Input Validation:
🔒 Authentication Security Validation
✅ P1 Checks (Critical):
✅ Password hashing: Argon2id with correct params
✅ Cookies: secure, httpOnly, sameSite configured
✅ Session secret: 32+ characters
⚠️ P2 Checks (Important):
⚠️ No rate limiting on login endpoint
✅ Input validation present
✅ CSRF protection enabled
ℹ️ P3 Suggestions:
ℹ️ Consider adding session rotation
ℹ️ Consider 2FA for sensitive operations
📋 Summary: 1 warning found
💡 Run /es-auth-setup to fix issues
Good Patterns ✅:
// Argon2id with correct params
const hash = await argon2.hash(password, {
memoryCost: 19456,
timeCost: 2,
outputLen: 32,
parallelism: 1
});
// Secure cookie config
cookie: {
secure: true,
httpOnly: true,
sameSite: 'lax'
}
Bad Patterns ❌:
// Weak hashing
const hash = crypto.createHash('sha256').update(password).digest('hex'); // ❌
// Insecure cookies
cookie: {
secure: false, // ❌
httpOnly: false // ❌
}
// Weak session secret
password: '12345' // ❌ Too short
Complex scenarios escalate to better-auth-specialist agent:
/validate and /es-deploy commands