What it is
JWT vulnerabilities stem from weak verification: accepting the 'none' algorithm, confusing RS256 and HS256 so the public key is used as an HMAC secret, brute-forcing weak signing secrets, or trusting unvalidated claims like role and expiry.
How to test for it
Decode the token and inspect the header and claims, then try algorithm downgrade and key-confusion attacks, attempt to crack short HMAC secrets offline, and tamper with claims to probe whether the signature is actually verified server-side.
How to prevent it
Pin the expected algorithm during verification, never accept 'none', use strong random secrets or proper asymmetric keys, validate every security-relevant claim (iss, aud, exp), and keep token lifetimes short with revocation where needed.