01Description
The application's handling of JSON Web Tokens was weak, for example accepting unsigned tokens, allowing algorithm switching, using a guessable signing secret, or issuing tokens without expiry.
02Impact
Where tokens can be forged or modified, an attacker can impersonate any user or grant themselves additional roles. Long-lived tokens extend the usefulness of any stolen token.
03Severity
Typically
High
Typically High. Critical where tokens can be forged (for example with the none algorithm, algorithm confusion or a crackable secret). Medium for weaknesses such as missing expiry.
04How to verify
- 1Decode tokens and review the algorithm, claims and expiry.
- 2Test acceptance of tokens with the alg set to none and with modified claims.
- 3Attempt offline cracking of HMAC secrets against common wordlists.
- 4Test algorithm confusion between asymmetric and symmetric algorithms.
Testing note: only test systems you are authorized to test, within the agreed scope and rules of engagement. Verification steps are written for professional testers and avoid destructive techniques.
05Remediation
- 1Validate signatures with a fixed, expected algorithm using a maintained library.
- 2Use long random secrets or asymmetric keys, and rotate them.
- 3Set short expiry times and validate audience and issuer claims.
- 4Support token revocation for logout and compromise.
Draft findings like this from your own evidence
Book a demo