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