A JWT is not sealed. alg is a claim, not a fact.

Three base64url strings joined by dots — and the browser can retype any of them. What stops a forgery is the check on the right, not the encoding.

1 header 2 payload 3 signature

Verifier A — decode only

const claims = jwt.decode(token); if (claims.role === "admin") grantAdmin();

Verifier B — verify, algorithm pinned

const claims = jwt.verify(token, serverKey, { algorithms: ["HS256"] });

    1 Header

    2 Payload

    3 Signature