← ClaudeAtlas

auditing-jwt-verification-and-key-trustlisted

Audit how a service verifies JSON Web Tokens for the classic verification bypasses: an algorithm-confusion attack where a token switches the signing algorithm so a public key is used as a symmetric secret or the algorithm is set to none, a key selected from an attacker-controllable header (a key id, a JWKS URL, or an embedded key) so the token names its own signer, a signature that is decoded but not actually verified, and claims (expiry, issuer, audience) that are parsed but not enforced. Covers services that accept and verify JWTs to authenticate or authorize a caller. Use when a JWT is the credential and its verification is the boundary. The forged or unverified token is the source, the authenticated or authorized action it grants is the sink, and the algorithm confusion, attacker-chosen key, or unverified claim that accepts it is the bug.
UnboundCompute/security-agent-skills · ★ 4 · AI & Automation · score 80
Install: claude install-skill UnboundCompute/security-agent-skills
# Auditing JWT verification and key trust: the token names its own signer unless you stop it A JSON Web Token is a signed claim, and its security is entirely in how the verifier checks the signature and the claims. The failures are a small, famous set, and they recur because the token itself carries the parameters an attacker wants to control. The algorithm lives in the token header, so a verifier that trusts it can be steered into algorithm confusion, verifying an RS256 token as HS256 using the public key as the shared secret, or accepting an algorithm of none with no signature at all. The key can be selected from the header too, a key id, a JWKS URL, or an embedded key, so a token can name a signer the attacker controls. A verifier that decodes the token and reads the claims but never actually checks the signature accepts anything. And a verifier that checks the signature but not the expiry, issuer, and audience honors expired or wrong-context tokens. The audit pins the algorithm and key on the server side and confirms the signature and claims are enforced. You audit this by presenting manipulated tokens and confirming each is refused. ## When to use - A service accepts JWTs and verifies them to authenticate or authorize a caller. - The signing algorithm or key may be chosen from token-supplied fields (alg, kid, jku, embedded key). - Claims such as expiry, issuer, and audience may be parsed but not enforced during verification. ## Scope check Test JWT verification only