Rules
All ESLint security rules provided by eslint-plugin-jwt-security
13 Security Rules
Comprehensive coverage of JWT security including algorithm confusion, token validation, and CVE-specific vulnerabilities.
All Rules
| Rule | 🧠 | 💼 | 🔧 | 💡 | ⚠️ | Docs |
|---|---|---|---|---|---|---|
| no-algorithm-confusion Prevent algorithm confusion attacks using symmetric algorithms with asymmetric keys | 🟢 | |||||
| no-algorithm-none Disallow JWT "none" algorithm which bypasses signature verification (CVE-2022-23540) | 🟢 | |||||
| no-decode-without-verify Disallow trusting decoded JWT payload without signature verification | 🟢 | |||||
| no-hardcoded-secret Disallow hardcoded secrets in JWT sign/verify operations | 🟢 | |||||
| no-sensitive-payload Prevent storing sensitive data in JWT payload which is only base64-encoded | 🟢 | |||||
| no-timestamp-manipulation Prevent disabling automatic timestamp generation which enables replay attacks | 🟢 | |||||
| no-weak-secret Require strong secrets (256+ bits) for HMAC-based JWT signing | 🟢 | |||||
| require-algorithm-whitelist Require explicit algorithm specification in JWT verify operations | 🟢 | |||||
| require-audience-validation Require audience (aud) claim validation in JWT verify operations | 🟢 | |||||
| require-expiration Require expiration claim (exp) or expiresIn option in JWT signing | 🟢 | |||||
| require-issued-at Require iat (issued at) claim for token freshness validation | 🟢 | |||||
| require-issuer-validation Require issuer (iss) claim validation in JWT verify operations | 🟢 | |||||
| require-max-age Require maxAge option in verify operations to enforce token freshness | 🟢 |
Rule Categories
Algorithm Security
Rules preventing algorithm confusion attacks (CVE-2022-23540) and ensuring proper algorithm whitelisting.
Token Validation
Rules requiring proper validation of audience, issuer, expiration, and issued-at claims.
Secrets & Keys
Rules detecting hardcoded secrets and weak signing keys.
Payload Security
Rules preventing sensitive data exposure in JWT payloads.
Building secure JavaScript with Interlace? Star the repo to get new rules and CWE coverage as we ship them — or follow the AI-code-security benchmarks behind them.