01
None Algorithm Attack
A token whose header declares alg: none carries no signature. If a verifier accepts it, anyone can edit the payload and claim to be any user.
What to look for: tokens with alg none or an empty signature part, and a verifier that trusts the header instead of enforcing the algorithm it expects.
Potential impact: complete authentication bypass and account takeover.
Mitigation: reject alg none unless it is explicitly expected, and pin the accepted algorithm in server configuration - never let the token choose it.
02
HS256 / RS256 Algorithm Confusion
RS256 signs with an asymmetric key pair (private key signs, public key verifies); HS256 uses one shared symmetric secret. If a verifier that expects RS256 is tricked into treating the RSA public key as the HMAC secret, an attacker can re-sign forged tokens with that public key - which is public by design.
What to look for: HS tokens presented to an RS256 issuer, and verification code that selects the algorithm or key type from the token header.
Potential impact: forged tokens for any user, including administrators.
Mitigation: enforce one expected algorithm per key, keep HMAC secrets and RSA keys strictly separate, and use a library that binds keys to algorithms.
03
Weak Signing Secret
An HMAC token is only as strong as its secret. A short or common secret can be recovered offline by testing candidate secrets against the signature - no contact with the server is needed.
What to look for: HS256/384/512 tokens that verify against common secrets or dictionary words when tested locally.
Potential impact: signing secret successfully recovered - tokens signed using this same secret may be forgeable. Investigate other tokens and services that share this signing key; do not assume every token from the same issuer uses the same key.
Mitigation: use a long, random, high-entropy secret (at least 256 bits for HS256), store it in a secrets manager, and rotate it on suspicion.
04
Signature Verification Bypass
Some implementations decode a token but never verify its signature - or skip verification on some code paths, such as an empty signature or an unfamiliar algorithm. Any edited payload is then accepted as genuine.
What to look for: decode-only library calls, verification wrapped in optional checks, and endpoints that accept tampered tokens.
Potential impact: arbitrary claim forgery - any user, role, or privilege can be claimed.
Mitigation: verify the signature on every request with a vetted library, fail closed on any verification error, and test tampered tokens in CI.
05
KID Parameter Injection
The kid header tells the server which key to load - often a file path or a database lookup. Used without validation, an attacker-controlled kid can steer that lookup.
What to look for: kid values containing path traversal sequences, quotes or SQL syntax, or shell metacharacters - and key lookups that use kid directly as a path, query, or command.
Potential impact: local file inclusion, directory traversal, SQL injection, or command injection on the server.
Mitigation: treat kid as an opaque identifier matched against an allowlist of known keys - never as a file path, SQL fragment, or shell argument.
06
JKU Header Injection
The jku header points to a URL where the verifier fetches the key set. If the verifier fetches whatever URL the token supplies, an attacker hosts their own keys and signs with the matching private key.
What to look for: a jku header in tokens, especially URLs on unfamiliar hosts or over plain HTTP, and verifiers with no URL allowlist.
Potential impact: forged tokens accepted as genuine, because the verifier fetched attacker-controlled keys.
Mitigation: only fetch keys from allowlisted issuer URLs over HTTPS, or ignore jku entirely and use pre-configured keys.
07
JWK Header Injection
A header can embed the verification key itself as a jwk. A verifier that trusts an embedded key accepts a key supplied by the token - the attacker generates a pair, embeds the public key, and signs with the private key.
What to look for: a jwk object in the header and verification code that prefers an embedded key over configured issuer keys.
Potential impact: complete signature forgery with an attacker-generated key pair.
Mitigation: ignore embedded jwk keys, or only accept them when pinned to a trusted issuer through a separate trust mechanism.
08
Expiration Validation Issues
The exp claim only protects a token if the server enforces it. Missing, ignored, or mis-compared expiry lets tokens live far beyond their intended lifetime.
What to look for: tokens with no exp, expired tokens that still work, expiry set before issue time, or lifetimes of months or years on access tokens.
Potential impact: stolen or leaked tokens remain usable long after they should have died.
Mitigation: require exp on every token, reject expired tokens, keep access-token lifetimes short, and allow only a small clock-skew tolerance.
09
Audience Validation Issues
The aud claim names the service a token was issued for. A service that skips the audience check may accept tokens minted for a different, lower-value service that shares the same signing key.
What to look for: tokens with no aud claim, and services that accept tokens whose aud names another service.
Potential impact: cross-service token reuse and privilege escalation between services.
Mitigation: require every service to check that aud names itself, and use distinct keys per service where possible.
10
Issuer Validation Issues
The iss claim states who issued the token. Without an issuer check, a verifier may accept tokens from any issuer that happens to share - or be confused with - a trusted key.
What to look for: tokens with no iss claim, unexpected issuer values, and verification that does not pin keys to specific issuers.
Potential impact: tokens from untrusted issuers accepted as first-party credentials.
Mitigation: match iss against an explicit allowlist and bind each issuer to its own keys and algorithms.
11
Token Replay
A JWT is a bearer token - whoever presents it is believed. Without server-side tracking, a captured token can be replayed until it expires, and logout often does not stop it.
What to look for: tokens with no jti, long lifetimes, and no revocation or reuse detection on the server.
Potential impact: a stolen token grants full access for its entire lifetime, from anywhere.
Mitigation: keep lifetimes short, record jti values where one-time use matters, support revocation for sensitive sessions, and bind tokens to a client or channel where feasible.
12
Sensitive Information Exposure
A JWT payload is base64url-encoded, not encrypted - anyone holding the token can read every claim. Secrets or personal data placed in claims are effectively published to every holder and every log the token passes through.
What to look for: passwords, API keys, access or refresh tokens, client secrets, database credentials, private keys, internal URLs, email addresses, or phone numbers inside claims.
Potential impact: credential theft and privacy exposure without any attack on the server at all.
Mitigation: keep only the minimum claims a verifier needs, never place secrets in a token, and use encrypted tokens (JWE) or opaque references when claim contents must stay confidential.