Nexus Void Research
JWT, JSON Web Token, API Security, Authentication, Algorithm Confusion, CWE-347
What Is JWT Authentication? JSON Web Token Security
What is JWT authentication? How JSON Web Tokens work, the top JWT vulnerabilities (alg none, algorithm confusion, CWE-347), and how to secure them.
JWT authentication is a method of verifying a user or service by passing a digitally signed JSON Web Token (JWT) with each request, so the server can trust the caller's identity without storing a session. JWT security depends entirely on that signature being verified correctly: if an attacker can forge a token the server wrongly accepts, they bypass authentication completely. The most dangerous JWT vulnerabilities are signature-verification failures like the "none" algorithm and algorithm-confusion attacks.
Understanding JWT authentication is essential because JSON Web Tokens sit at the center of modern APIs, single sign-on, and microservices. A JWT is a compact, URL-safe token with three parts separated by dots: a header (which names the signing algorithm), a payload (the claims, such as user ID and roles), and a signature. The server issues a signed token at login, the client sends it back on every request, and the server verifies the signature to confirm the token is authentic and unaltered. Standardized as RFC 7519 by the IETF and widely implemented through libraries and gateways from vendors like Auth0, Okta, and WSO2, the JWT is the default credential of the API era, which is exactly why its failure modes matter.
How does JWT authentication work?
A JWT carries its own proof of authenticity, which is what makes it "stateless." Instead of the server keeping a session record and looking it up on every request, the token itself contains the claims and a signature that binds them. The flow is straightforward: a user authenticates once, the server creates a JWT signed with a secret (HMAC, the HS256 family) or a private key (RSA or ECDSA, the RS256 family), and returns it. The client stores the token and attaches it, usually in an Authorization header, to each subsequent request. The server recomputes or verifies the signature and, if it matches and the token has not expired, trusts the claims inside.
That statelessness is the appeal and the risk in one property. There is no server-side session to invalidate, so a leaked or forged token is valid until it expires. Everything therefore rests on two things being correct: the signature must be verified, and it must be verified against the algorithm the server actually intended.
What are the most common JWT vulnerabilities?
JWT security failures almost always trace back to how the token's signature is handled, not to the cryptography itself. The recurring weaknesses map to CWE-347, improper verification of a cryptographic signature, and they show up in real products with maximum-severity consequences.
Attack | What goes wrong | Impact |
|---|---|---|
"none" algorithm | Server accepts a token whose header says | Full auth bypass with an unsigned token |
Algorithm confusion | Server is tricked into verifying an RS256 token as HS256, using the public key as an HMAC secret | Forged tokens accepted as valid |
Unsupported / unexpected algorithm | Server validates a token signed with an algorithm it should have rejected | Auth bypass, often to administrator |
Weak HMAC secret | HS256 secret is short or guessable and gets brute-forced | Attacker signs their own valid tokens |
Missing expiry or claim checks | Server ignores | Replay and token reuse across services |
The live example as of September 2026 is WSO2 API Manager CVE-2026-5430, a critical flaw (CVSS up to 10.0, CWE-347) in which a JWT signed with an unsupported algorithm was incorrectly validated, letting an unauthenticated attacker be accepted as an administrator. Security firm watchTowr reported honeypots capturing forged admin tokens in the wild, a concrete reminder that these are not textbook risks.
What is a JWT algorithm-confusion attack?
Algorithm confusion is the JWT attack that catches even careful teams. It exploits the fact that a single verification routine may accept multiple algorithm families. A server expects tokens signed with RS256, an asymmetric scheme where a private key signs and a public key verifies. The public key is, by design, not secret. If the verification code lets the attacker switch the header to HS256 (a symmetric scheme where the same key signs and verifies), a naive implementation will use the RS256 public key as the HMAC secret. Because that public key is known, the attacker can forge a valid HS256 signature and the server accepts it. The fix is to pin the expected algorithm at verification time and reject anything else, rather than trusting the algorithm the token declares.
How do you secure JWT authentication?
Secure JWT handling is mostly about refusing to trust the token's own claims about how it should be checked. A practical checklist, drawn from OWASP guidance and the IETF JWT best-practices RFC 8725:
Pin the accepted algorithm server-side and reject
alg: noneand any unexpected algorithm outright.Never let the token's header choose the verification method or key.
Use strong, long, random secrets for HMAC, and protect signing keys the way you protect any credential.
Always validate the standard claims: expiry (
exp), audience (aud), and issuer (iss).Keep token lifetimes short and pair them with refresh tokens so a leaked JWT has a small window.
Verify with a maintained, well-reviewed library rather than hand-rolling parsing.
None of these is exotic, and that is the point: the WSO2 case and the long line of "none" and algorithm-confusion bugs before it are failures of verification discipline, not of the JWT standard. This is where a CVSS score tells you severity but not whether your build is actually exposed, because the only way to know is to test the token path directly.
Why JWT security needs continuous verification
An authentication gateway is the control that gates everything behind it, so a JWT verification bug is not one vulnerability among many; it is a skeleton key. That is why we argue security has to be verifiable by design and confirmed continuously rather than assumed. You cannot read a config and conclude your JWT handling is safe. You confirm it by sending a token signed with an unexpected algorithm, an alg: none token, and a token with an expired or wrong-audience claim, and watching whether each is correctly rejected on your actual deployment. Treating the credential layer as attack surface to be exercised, the same way we treat an unauthenticated admin bypass in a build server, is what turns "we use JWTs correctly" from a claim into evidence.
Frequently asked questions
What does JWT stand for?
JWT stands for JSON Web Token, an open standard (RFC 7519) for a compact, digitally signed token that carries claims about a user or service between parties.
Is JWT authentication secure?
JWTs are secure when the signature is verified correctly against a pinned algorithm and the standard claims are checked. Most JWT breaches come from implementation mistakes such as accepting alg: none, algorithm confusion, or weak HMAC secrets, not from the standard itself.
What is the difference between JWT and a session?
A traditional session stores state on the server and hands the client an opaque ID; a JWT is stateless and carries its claims and signature inside the token, so the server does not need to look anything up. The tradeoff is that a JWT cannot be trivially revoked before it expires.
What is the JWT "none" algorithm attack?
It is an attack where the token header sets alg to none, signaling no signature. A server that honors this accepts an unsigned, attacker-controlled token, bypassing authentication entirely. Verifiers must reject none and any algorithm they did not explicitly expect.
How do I prevent JWT algorithm-confusion attacks?
Pin the exact algorithm your server accepts at verification time, never derive the algorithm or key from the incoming token's header, and keep verification and signing keys strictly separated so a public key can never be used as an HMAC secret.
Our read
The JWT is a good design being undone, again and again, by verifiers that trust the token to describe how it should be checked. Every major JWT vulnerability, from the classic none bug to the WSO2 algorithm-confusion flaw exploited in 2026, is the same mistake wearing a new hat: the server let attacker-controlled input decide the security decision. The verifiable-by-design takeaway is to treat your authentication layer as the highest-value attack surface you own and to prove it rejects malformed and misused tokens through continuous testing, rather than trusting that a library or a checklist closed the category. A signature you did not actually verify is not authentication; it is a suggestion.
Standard and best-practice detail per the IETF (RFC 7519, RFC 8725) and OWASP; the WSO2 CVE-2026-5430 example and exploitation detail per the vendor advisory and watchTowr. Sources linked above.
Related: WSO2 API Manager CVE-2026-5430: JWT bypass exploited, What is CVSS?, and What is path traversal?.
DATA SOURCES
IETF RFC 7519 — https://datatracker.ietf.org/doc/html/rfc7519 ; IETF RFC 8725 (JWT BCP) — https://datatracker.ietf.org/doc/html/rfc8725 ; OWASP — https://owasp.org/
PAGE CONTENTS
// FROM THE LAB
Pentesting is easy and affordable now.
Continuous VAPT you can run every month, with a report built for AI-built apps.
RUN A VAPT ->
// CYBER NETWORK
Shape the next analysis.
A curated network of security practitioners who help set our research agenda. By application.
APPLY TO JOIN ->
Get new research first
We publish original analysis and experiments on how attackers actually move. Follow along:
RECENT POSTS
VIEW ALL RESEARCH ->