How to Fix JWT Algorithm 'none' Vulnerabilities (CVE-2015-9235)
Audit JSON Web Tokens for unsigned algorithm spoofing, expired claims, and signature flaws.
A JWT Algorithm 'none' vulnerability (CVE-2015-9235) occurs when authentication middleware accepts tokens with header '{"alg": "none"}', allowing attackers to forge arbitrary user privileges without knowing the secret key.
Root Cause Analysis
Legacy JWT verification libraries allow the token header's 'alg' parameter to dictate verification rather than strictly enforcing a predetermined cryptographic algorithm (e.g. RS256/HS256).
Step-by-Step Resolution Procedure
Paste the token into the JWT Validator above to inspect headers, payload, expiration timestamps, and algorithm safety.
Specify exact allowed algorithms (e.g. ['RS256']) in verification functions and explicitly reject 'none'.
Configure strict 'exp' claims (15m to 1h) and rotate refresh tokens safely.
Verification Command or Config Pattern
import { jwtVerify } from "jose";
// Strictly enforce RS256 and reject alg='none'
const { payload, protectedHeader } = await jwtVerify(token, publicKey, {
algorithms: ["RS256"], // Never allow 'none'
issuer: "https://auth.example.com",
audience: "https://api.example.com",
});Frequently Asked Remediation Questions
Why was the 'none' algorithm created?
The 'none' algorithm was intended for environments where cryptographic integrity is guaranteed by transport security (like TLS mutual auth). In web APIs, it should never be accepted.
Can an attacker change claims in a signed JWT?
If the server properly validates cryptographic signatures using secret/public keys, any change to claims invalidates the signature and causes verification failure.
What is the difference between HS256 and RS256?
HS256 uses a shared symmetric secret key. RS256 uses asymmetric cryptography (private key signs, public key verifies), which is safer for distributed microservices.
Is it safe to paste production JWTs on OnChainScans?
Yes. OnChainScans decodes JWT tokens 100% locally in browser memory via the jose library. Your tokens are never transmitted to any server.
Complementary Diagnostic Scanners
All 34 toolsSoftware Dependency (CVE) Scanner
Parses dependency manifests to map exact semver ranges against the National Vulnerability Database (NVD) and GitHub Advisory database for CVSS scores.
Used Car VIN & Recall Scanner
Verifies 17-character VIN check digits via Modulo 11 weighted algorithms, decoding World Manufacturer Identifiers (WMI) and pulling open safety recall notices.
Used Phone IMEI Validator
Applies the Luhn (Mod 10) algorithm to 15-digit IMEI strings to verify authenticity, decoding the 8-digit Type Allocation Code (TAC) for exact device model and origin.
Related Troubleshooting & RFC Playbooks
How to Fix SPF PermError: 'Too Many DNS Lookups' (RFC 7208)
Resolve the 10-lookup limit that causes receiving mail servers (Gmail, Outlook) to reject your emails.
How to Fix NET::ERR_CERT_AUTHORITY_INVALID SSL Handshake Errors
Repair broken intermediate certificate bundles and establish a trusted X.509 chain of trust.
How to Fix ERR_TOO_MANY_REDIRECTS & Circular Redirect Loops
Diagnose infinite HTTP 301/302 redirects between Cloudflare Flexible SSL, Nginx, and CMS canonical rules.