liveBook · Manning

None attack

As explained in Grokking Software Architecture

The alg none exploit is a JWT attack in which an implementation accepts a token declaring no signature algorithm and therefore skips signature verification.

The none attack tricks a backend into accepting a JWT with no signature check. If the backend trusts the token’s alg: none header, an attacker can edit the payload and claim admin rights. section 11.3.2

A forged admin token

An attacker changes the header to { "alg": "none", "typ": "JWT" }, edits the payload to { "user": "attacker", "role": "admin" }, and removes the signature. A misconfigured backend may accept it. section 11.3.2

Reduce the risk by enforcing JWT checks:

  • Pin the JWT library to the expected algorithm, such as RS256. section 11.3.2
  • Verify signatures using public keys fetched from the identity provider’s JWKS endpoint, and check token expiry. section 11.3.2
Figure 11.4 How a backend logic error allows forged tokens via the "none" algorithm, mitigated by explicitly pinning the verification algorithm to RS256.

See how explicitly pinning the verification algorithm prevents the forged-token path. section 11.3.2

How Grokking Software Architecture covers it

How deep it goes
Traces how an attacker edits a token and identifies algorithm pinning, signature verification, and expiry checks as safeguards.
Examples
Shows a modified JWT header, an attacker-controlled admin payload, and a deleted signature.
What you can do after
Configure JWT verification to accept only the expected algorithm and validate signatures and expiry.
How it connects
Connects JWTs with signature verification, JWKS, and OAuth and OIDC identity providers.

This explainer was generated by Manning's knowledge graph from the text of Grokking Software Architecture. The section links point to the parts of the book it draws on.