Skip to content

JWT using insecure 'none' algorithm

Description

Using 'algorithm="none"' in JWT disables signature verification, which allows token forgery. Always use a secure algorithm like HS256 or RS256.

Examples

Insecure Code

python
jwt.encode(payload, "none")

Secure Code

python
jwt.encode(payload, "HS256")

Remediation

Replace 'none' with a secure algorithm like 'HS256' or 'RS256' in jwt.encode and jwt.decode functions.

Rule Details

FieldValue
IDCODE-0510
CategoryCrypto
SeverityMEDIUM
CWECWE-327
ConfidenceHIGH
ImpactHIGH
LikelihoodMEDIUM
ExploitabilityEASY
Tagsjwt, insecure algorithm
OWASPA02:2021-Cryptographic Failures