JSON Web Token
A signed, self-contained token that carries claims a server can verify without a database lookup.
JSON Web Token is a compact, signed data structure — three base64url segments joined by dots: a header, a payload of claims, and a signature — that a server can verify cryptographically without looking anything up in a database. That's its entire value proposition: a session ID is a pointer that means nothing until you look it up; a JWT is self-contained, carrying the claims (user ID, roles, expiry) directly, verifiable by anyone holding the signing key or, for asymmetric signatures, the public key alone.
That self-containedness is also its sharpest edge. Because a valid JWT is trusted on the signature alone, revoking one before its stated expiry is genuinely hard — there's no session store to delete a row from. Systems that need real-time revocation (someone's access must end now, not when the token expires) end up building a denylist or a short-token-plus-refresh-token scheme anyway, which quietly reintroduces the server-side state JWTs were meant to avoid. Keeping expiry windows short is the usual mitigation, not a fix.
The other recurring failure is trusting the token's own unverified header. Early JWT libraries let the alg field in the header claim none or switch algorithms, and code that read the algorithm from the token instead of hardcoding what it expected could be tricked into skipping verification entirely. The fix is mundane and non-optional: a verifier must dictate the algorithm itself and never take it from the token being verified.
JWTs commonly carry OAuth and OpenID Connect identity claims, and get passed as a bearer token in an Authorization header — a choice with a real tradeoff: an HttpOnly cookie is the one storage a Cross-Site Scripting payload cannot read (its weakness is CSRF, since the browser attaches it automatically), while a bearer token sent from JavaScript must live somewhere script-accessible like localStorage or memory, where any XSS can exfiltrate it.
See also4
Base64
A way to write arbitrary bytes using 64 safe text characters, so binary data can travel through email, JSON, URLs, and other channels built for text, at the cost of a third more size and with no secrecy at all.
Data & Content8 connections
Session Management
How a website remembers that a visitor has signed in across otherwise unrelated requests, usually with a random identifier in a cookie, and the attacks that target that identifier.
Web Platform11 connections
Same-Origin Policy
The browser rule isolating documents by scheme, host, and port, and the mechanisms for relaxing it.
Web Platform30 connections
Content Security Policy
An HTTP header that tells the browser which sources of script, style, and other content a page is allowed to load.
Web Platform14 connections
Related3
Nearby in the graph rather than deliberately chosen. Looser, sometimes surprising.
Linked from9
- Base64Data & Content
A way to write arbitrary bytes using 64 safe text characters, so binary data can travel through email, JSON, URLs, and other channels built for text, at the cost of a third more size and with no secrecy at all.
- Content Security PolicyWeb Platform
An HTTP header that tells the browser which sources of script, style, and other content a page is allowed to load.
- Cross-Site ScriptingWeb Platform
Injecting attacker-controlled script into a page that a victim's browser then executes with the victim's own privileges.
- HTTP CookieWeb Platform
A small piece of state a server asks the browser to store and send back on later requests, governed by attributes that decide exactly where it goes.
- OAuthWeb Platform
A protocol for granting one application limited access to a user's data on another, without handing over the user's password.
- Session ManagementWeb Platform
How a website remembers that a visitor has signed in across otherwise unrelated requests, usually with a random identifier in a cookie, and the attacks that target that identifier.
- Single Sign-OnWeb Platform
Signing in once with a central identity provider and being trusted by many separate applications, through signed assertions passed by browser redirects, which concentrates both convenience and risk in one place.
- Web StorageWeb Platform
The browser's built-in ways to keep data on the user's device, from the simple string store localStorage to the transactional database IndexedDB, and their limits on size, persistence and security.
- Zero Trust NetworkNetworks & Distribution
Zero trust authenticates and authorizes every request individually, treating network location as no proof of anything.