Home » Vulnerabilities Knowledge Base » Algorithm value in the JWT token is found to be set to ‘none’
This vulnerability arises when a JWT (JSON Web Token) has its alg (algorithm) field set to “none”, and the server fails to validate or enforce proper signature verification.
In this case, the token includes no cryptographic signature, yet some improperly configured backends still treat the token as valid. This flaw allows attackers to forge tokens without knowing the secret key or private key.
1. Authentication Bypass:
Attackers can craft their own JWT with arbitrary claims (like user: admin) and no signature. If the backend accepts alg: none, it will treat the token as valid, even without verifying it.
2. Privilege Escalation
An attacker can inject any role, permission, or user ID into a self-signed (unsigned) JWT, giving themselves admin or elevated access.
3. Unauthorized API Access
If APIs rely on JWT claims for authorization (e.g., user ID or access level), an attacker can:
Best Practices to Prevent JWT ‘none’ Algorithm Exploits:
Never Trust the ‘alg’ Field from the Client
Hardcode the expected algorithm (e.g., RS256) on the server-side. Do not choose the algorithm based on the JWT header.
The alg: none vulnerability is a reminder that security should never rely on user-provided claims. Always verify tokens using trusted cryptographic methods and never trust what’s in the header without backend enforcement.
Content Sniffing
Certain browsers, try to determine the content type and encoding of the response even when these properties are defined correctly...
Content Sniffing
Certain browsers, try to determine the content type and encoding of the response even when these properties are defined correctly...
Content Sniffing
Certain browsers, try to determine the content type and encoding of the response even when these properties are defined correctly...
Content Sniffing
Certain browsers, try to determine the content type and encoding of the response even when these properties are defined correctly...