Security Best Practices
Production hardening checklist for bx-jwt — allowlists, key sizes, clock skew, and common pitfalls.
1. Reject alg:none (Built-in)
alg:none (Built-in)2. Lock Down the Algorithm Allowlist
// ModuleConfig.bx
allowedAlgorithms = [ "HS256", "RS256" ]3. Use Compliant HMAC Key Sizes
Algorithm
Minimum
4. Tune Clock Skew Per Environment
5. Always Assert Issuer / Audience
6. Keep Lifetimes Short
7. Stamp kid and Verify Through It
kid and Verify Through It8. Never Trust jwtDecode() Output
jwtDecode() Output9. Encrypt PII / PHI With JWE
10. Store Keys Outside the Codebase
Quick Checklist
Related
Last updated
Was this helpful?
