OnChainScans
JWT Algorithm 'none' / Invalid Signature•RFC 7519 (JSON Web Token) / RFC 7515 (JWS)• LIVE SCANNER EMBEDDED

How to Fix JWT Algorithm 'none' Vulnerabilities (CVE-2015-9235)

Audit JSON Web Tokens for unsigned algorithm spoofing, expired claims, and signature flaws.

Live Diagnostic Tool: JWT / JSON / Regex / Cron / IBAN ValidatorsFull Tool Page
Executive Answer & Impact Analysis

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

1Decode and Audit JWT Claims

Paste the token into the JWT Validator above to inspect headers, payload, expiration timestamps, and algorithm safety.

2Explicitly Enforce Signing Algorithms in Middleware

Specify exact allowed algorithms (e.g. ['RS256']) in verification functions and explicitly reject 'none'.

3Enforce Short Expiration Lifetimes

Configure strict 'exp' claims (15m to 1h) and rotate refresh tokens safely.

Verification Command or Config Pattern

TERMINAL / CONFIGRFC RFC 7519 (JSON Web Token) / RFC 7515 (JWS)
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.