The Ravens’ API uses a JWT to know who you are. The token has a header that names the signing algorithm, and the Hacker left the library accepting the value none — a token with no signature at all. You hold a guest token.
The Ravens API checks your session with a JWT in the Authorization header. The app shows your current guest token and lets you edit the header and payload and choose how to sign. The server trusts any token whose header says alg none, with no signature.
Forge a token that makes the server treat you as admin.
The server accepted a token with algorithm none and your role became admin.
Why the solution worked
A JWT states in its header how it was signed, and the mistake is that the server believes that header: if it says none, the server accepts the token with no signature, so anyone writes any payload. The fix: the server fixes the accepted algorithm itself (it does not read it from the token), always rejects none, verifies the signature with a strong secret key, and only then trusts the payload.
The root cause
The server reads the algorithm from the token header — attacker-controlled data — and obeys it, accepting alg none with no signature check. Verification must pin an expected algorithm, not take it from the token.
How the code is fixed
The algorithm is the server’s decision, not the token’s. none is not a signing algorithm; it is the absence of one.
Vulnerable code
function verify(token) {
const { header, payload, signature } = parse(token);
if (header.alg === 'none') return payload; // trusts an unsigned token
if (!checkHmac(signingInput, signature, SECRET)) throw new Error('bad');
return payload;
}
Safe code
function verify(token) {
// The server decides the algorithm; it never reads it from the token, and never accepts none.
return jwt.verify(token, SECRET, { algorithms: ['HS256'] });
}
Impact in the real world
The alg none flaw has historically allowed forging any token and impersonating any user in well-known JWT libraries, with no secret needed.
How defenders detect it
Defenders reject alg none explicitly, pin the allowed algorithm in verification code, and alert on tokens with a none header or an empty signature.