JWT's Real Problem Was Never the Idea, It Was the Choices It Allows
JWT lets you choose 'none' as a signing algorithm. PASETO doesn't let you choose at all — versioned, fixed cipher suites instead of a menu of footguns.
On this page
“JWT is insecure” is a claim that needs a footnote, because the JWT specification itself isn’t the vulnerability — the vulnerability is everything JWT’s flexibility allows an implementation to get wrong. PASETO exists specifically as a reaction to that flexibility, and understanding what it actually fixes (and what it doesn’t) matters more than picking a side in a “JWT vs PASETO” framing that makes it sound like a simple upgrade.
What JWT actually is, and where the flexibility lives
A JWT has three parts — header, payload, signature — and the header explicitly declares which algorithm was used to sign it: HS256, RS256, ES256, or, critically, none. The verifying server reads that declaration from the token itself and uses it to decide how to check the signature.
header: { "alg": "HS256", "typ": "JWT" }
payload: { "sub": "user123", "exp": 1735689600 }
signature: HMACSHA256(base64(header) + "." + base64(payload), secret)
That alg field being attacker-controllable — because it’s read from the token being verified, before verification has happened — is the structural root of two well-documented real-world attack classes:
"alg": "none", and a naive verifier configured to accept whatever algorithm the token claims skips signature checking entirely — accepting a completely unsigned, attacker-crafted token as valid.Both attacks exploit the same root cause: the verifier trusted algorithm information supplied by the very token it was trying to verify, instead of the algorithm being a fixed, out-of-band property of the verification code itself.
Modern JWT libraries default to requiring the verifier to explicitly specify an expected algorithm (or an allow-list of algorithms) independent of what the token claims, closing both attack classes. The vulnerability was real and historically exploited, but it was a fixable implementation-discipline problem, not an unfixable flaw in the token format’s core idea.
PASETO’s answer: remove the choice, don’t just document it correctly
PASETO (Platform-Agnostic Security Tokens) takes a structurally different approach: instead of a flexible header declaring which algorithm was used, a PASETO token’s format string — v4.local or v4.public, for example — maps to exactly one predetermined cryptographic recipe, fixed by the specification itself.
v4.local.<encrypted payload> — symmetric encryption, one fixed cipher suite
v4.public.<signed payload> — asymmetric signing, one fixed algorithm
There is no algorithm field for an attacker to manipulate, because there’s no algorithm choice exposed to the token at all — the version number is the algorithm choice, made once, by the specification, not per-token by whoever crafted it.
- Local PASETO — symmetric, confidential
Encrypted with a shared secret key; the same key both creates and verifies tokens. The payload is genuinely confidential — unreadable without the key, not just signed-but-visible like a standard JWT payload.
- Public PASETO — asymmetric, verifiable by many
Signed with a private key, verified with a corresponding public key. Anyone holding the public key can confirm authenticity and read the payload, but only the private key holder could have produced a valid signature.
This maps directly onto a real design decision most JWT implementations have to make manually and can get wrong: do you need confidentiality (nobody but the intended verifier should read the payload) or verifiable authenticity across multiple independent readers? PASETO makes that choice explicit at the format level — local versus public — rather than leaving it as an implicit consequence of which algorithm someone happened to pick.
What switching to PASETO does not fix
Do
Treat PASETO’s actual value as removing a class of implementation mistake (algorithm confusion, insecure algorithm defaults) that a disciplined JWT implementation can also avoid, just without the format enforcing it.
Don't
Expect switching token formats to fix problems that live outside the format entirely — weak secret management, missing or too-long expiration windows, tokens stored insecurely on the client (unprotected localStorage, for instance). Both JWT and PASETO are equally vulnerable to those, because neither is the layer responsible for them.
The actual decision, stripped of format tribalism
The honest framing isn’t “JWT is insecure, use PASETO” — it’s a trade between two different risk models. JWT’s flexibility is genuinely useful (multiple algorithms for different use cases, broad, mature library and tooling support across nearly every stack) and genuinely risky (that same flexibility is what caused real historical vulnerabilities when implementations trusted the wrong things). PASETO’s rigidity removes that specific risk category by removing the choice, at the cost of being a newer standard with narrower ecosystem support than JWT currently has.
Takeaway
The interesting lesson in “JWT vs PASETO” isn’t about which token format wins — it’s about a specific pattern in security design: a flexible format that lets the implementer choose critical parameters (which algorithm, whether to verify at all) is exactly as secure as every implementation using it correctly chooses to be, every time, forever. A format that removes the choice entirely trades away that flexibility for a guarantee that doesn’t depend on every implementer getting it right. Whether that trade is worth making depends on how much you trust your own team’s implementation discipline against how much flexibility and ecosystem maturity your specific system actually needs — not on which acronym sounds more modern.
Frequently asked questions
What's the actual security flaw people mean when they say JWT is risky?
JWT is a container format that supports many possible signing algorithms — including 'none', meaning no signature verification at all — and leaves the choice of algorithm to the implementer, decoded from a header the token itself carries. Historical vulnerabilities exploited this flexibility: forging a token with alg set to 'none', or tricking a server into verifying an RS256-signed token's signature using its own public key as if it were an HS256 secret. The JWT specification isn't broken; the amount of implementation choice it leaves open is what caused real vulnerabilities.
How does PASETO structurally prevent the 'alg:none' style of attack?
PASETO tokens declare a version and purpose (like 'v4.local' or 'v4.public') that map to one fixed, predetermined cryptographic recipe — there's no algorithm field to manipulate, because there's no algorithm choice exposed to the token at all. A 'v4.public' token is always verified with the same fixed asymmetric signing scheme; there's no code path where an attacker can supply a different, weaker algorithm for the verifier to honor.
What's the difference between PASETO's 'local' and 'public' token types?
Local PASETO tokens are symmetrically encrypted — the same key both creates and verifies them, and the payload is confidential, unreadable without that key. Public PASETO tokens are asymmetrically signed — verified with a public key, so anyone holding it can confirm authenticity and read the payload, but only the private key holder could have created it. The choice mirrors a real design decision: local tokens for confidentiality, public tokens for verifiable authenticity across multiple readers.
If JWT's flaws are implementation choices, why not just implement JWT carefully instead of switching to PASETO?
You can, and many production systems do this safely — the flaws are avoidable, not inherent. PASETO's actual value proposition is removing the choice that has to be gotten right rather than trusting every implementation to get it right independently. Whether that trade is worth adopting a newer, less universally supported standard depends on how much you trust your own team's JWT implementation discipline versus how much library and tooling support you need PASETO to already have for your stack.
Does switching from JWT to PASETO fix authentication vulnerabilities unrelated to the token format itself?
No — token format only addresses one specific class of risk (algorithm confusion, insecure default choices at the token layer). Problems like weak secret management, missing expiration checks, tokens that are too long-lived, or improper storage on the client (like unprotected localStorage) exist independent of whether the token format is JWT or PASETO, and switching formats does nothing to fix them.



/* Comments */
Comments are offline right now — we reconnect automatically, nothing is lost.