Every week, developers copy a live bearer token from Chrome DevTools or curl and paste it straight into the first "JWT Decoder" search result — sending user IDs, email addresses, tenant roles, SSO claims, and internal API scopes to a third-party server they don't control.
Because a JSON Web Token's header and payload are just Base64URL-encoded JSON, inspecting them never requires a backend call. You can decode headers, verify timestamps, and audit common security smells 100% locally inside your browser with Local JWT Security Auditor.
Here are the 7 JWT bugs that routinely cause subtle auth outages or security findings in production SaaS apps.
1. Accepting alg: "none" or Confusing Symmetric vs Asymmetric Keys (HS256 / RS256)
Always enforce an explicit algorithms: ["RS256"] (or "ES256") allowlist in your backend verifier. Never let the unverified token header.alg dictate which verification path runs.
2. Missing iss (Issuer) and aud (Audience) Checks in Multi-Tenant Auth
If multiple microservices or environments (staging vs prod) share an identity provider, verifying only the signature and exp allows a token minted for Service A to authenticate against Service B unless aud and iss are strictly matched.
3. Clock Skew Breaking iat / nbf Validation Across Containers
Even a 5-second NTP drift between your IdP and an API container makes freshly issued tokens fail nbf (Not Before) checks immediately after OAuth login. Standardize a bounded clockTolerance (e.g., 10–30s), not 0 and not hours.
4. Storing Mutable Permissions or PII Inside Long-Lived Access Tokens
If a JWT carries a role: "admin" claim with a 24-hour exp, revoking that user's access in Postgres won't take effect until the token expires. Keep access tokens short-lived (5–15 min) or pair role revocation with a version/session check.
5. Confusing Token Expiration (exp) With Idle Session Revocation
Debugging why SSO users get logged out unexpectedly mid-session often comes down to inspecting the decoded exp minus iat delta alongside refresh-token rotation behavior.
6. Over-Stuffing Custom Claims Into Cookies (> 4 KB Silent Truncation)
Embedding dozens of group UUIDs inside a JWT stored in an HttpOnly cookie quietly crosses the 4096-byte browser cookie limit and triggers mysterious 401 loops for power users.
7. Ignoring Key ID (kid) Path Traversal or Missing JWKS Caching
During JWKS rotation, failing to cache keys briefly causes thundering-herd latency spikes against your IdP, while passing an unsanitized kid into filesystem lookups creates critical path-traversal risk.
Free 100% Client-Side Security & DevOps Toolkit (Zero Server Uploads)
All utilities below run purely in browser memory with zero backend telemetry:
- Local JWT Security Auditor: JWT Inspector
- K8s & Docker CIS Security Auditor (12 Checks): K8s Audit Tool
-
.env→ KubernetesSecret/ExternalSecretConverter: Env → K8s Secret - Multi-Doc YAML ↔ JSON & K8s Validator: YAML ↔ JSON Tool
- AWS VPC CIDR · SRE SLO · Cron · Chmod Calculators: Solo Founder Toolkit
Need production-hardened Nginx, Docker, Kubernetes, and Terraform baselines? Check out our templates (20% off with code PH20):
- SaaS Deploy & SRE Starter Pack 2026 (
$15.20withPH20): Ko-fi Direct | Gumroad (PH20) - All-Access 5-in-1 Indie Founder Bundle (
$19.20withPH20): Ko-fi Direct | Gumroad (PH20)
What JWT lifetime (exp) do you ship in production APIs — 5 minutes, 15 minutes, or longer?