JWT Signature Not Verified
The application accepts JSON Web Tokens without checking their signature, so anyone can change the claims in a token, such as the user ID or role, and the change is trusted.
| Severity | Critical |
| CVSS 3.1 | 9.1 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N Open in the calculator |
| CVSS 4.0 | 9.3 CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N Open in the calculator |
| CWE | CWE-347: Improper Verification of Cryptographic Signature |
| OWASP Top 10 | A04:2025 Cryptographic Failures |
| MITRE ATT&CK | T1606 Forge Web Credentials, T1190 Exploit Public-Facing Application |
| Category | Cryptographic Failures |
Description
A JSON Web Token (JWT) carries claims, such as the user's identity, their role and the token's expiry, in a payload that is only Base64url encoded. Its integrity depends entirely on the signature, which the server must check against a trusted key before any claim is used. The application decodes and trusts the token's claims without verifying that signature, so a token whose payload has been altered is still accepted.
An attacker can therefore create or modify tokens to claim any identity or privilege the application recognises, for example by changing the user identifier to impersonate another user, or by setting a role claim to administrator. No credentials are needed beyond, at most, one token from which to copy the format, and the result is normally access to every account and function protected by the token, including administrative functions.
The usual cause is code that calls a library's decode function rather than its verify function (for example jwt.decode() in the Node.js jsonwebtoken package, which does not check the signature, or PyJWT's decode() with signature verification switched off), a verification step that is skipped for some routes or token types, or a check that runs only when a signature is present. API gateways and internal services that assume another component has already verified the token are a frequent source, and in a microservice architecture the access may extend to every service that relies on the same unverified token.
The weakness can be confirmed by changing a claim in a valid token, such as the subject or role, while leaving the original signature in place, or by removing the signature altogether, and observing that the modified token is accepted. Tools such as jwt_tool and the JWT Editor extension for Burp Suite automate these checks. Acceptance of tokens whose header names the none algorithm is a closely related fault, described in the separate finding on JWT algorithm confusion.
Remediation
Verify every token's signature before using any of its claims:
- Use the library's verification function, never a decode-only function, wherever a token is received, and treat any verification failure as an authentication failure.
- Configure verification explicitly: the expected key, the list of accepted algorithms, and the expected issuer (
iss) and audience (aud). Check the expiry (exp) and not-before (nbf) times. - Reject tokens with no signature, tokens using the
nonealgorithm, and tokens signed with any algorithm or key other than the one configured. - Verify in shared middleware or at the API gateway, and also in each service that makes decisions on the claims, rather than relying on another component having done it.
If forged tokens may already have been used, rotate the signing keys and review logs for tokens with unexpected claims. Confirm the fix by repeating the tests with modified, unsigned and re-signed tokens and checking that each is rejected.
References
Add This Finding to Your Library
In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.
Free trialYour trial starts when your portal goes live, not when you sign up, so the time you spend setting up does not count. · No card required
Only need the reporting? Our reporting tool is free and open source, with the same library.