A developer pastes a token from a browser session into a decoder, just to check an expiry time, and sees the user's full name, email address, home region and an internal account tier laid out in plain text. Nobody hacked anything. The token was never encrypted in the first place, and the person who built the login flow assumed that a long string of random-looking characters meant the contents were hidden.
That assumption is one of the most common and most expensive misunderstandings in token-based authentication. The string looks scrambled, so people treat it like a sealed envelope. It is closer to a postcard with a tamper-evident sticker on it. Everyone who handles it can read the message, and the sticker only tells you whether somebody changed it along the way.
What a JWT Actually Is
A JSON Web Token, defined in RFC 7519, is three pieces of text joined by dots. The first piece describes the token, the second carries the claims, and the third is a signature. The first two pieces are not encrypted. They are JSON documents run through Base64URL encoding, which is a way of making text safe to put in a URL or a header.
Encoding is not secrecy. Base64URL is a reversible format with no key involved, so any person, script or browser console can turn those characters back into readable JSON in a fraction of a second. If you want to see it for yourself, Wikipedia's article on JSON Web Tokens lays out the structure with an annotated example.
Why the Payload Is Readable by Design
The design goal of a standard signed token is integrity, not confidentiality. The server wants to hand a client a claim such as "this request belongs to user 4821, and the token expires at 3 pm" and later be able to trust that claim without a database lookup. A signature makes that possible, because changing a single character in the payload breaks the signature check.
Hiding the claims was never part of that bargain. A client application often needs to read the payload too, for example to show a username or to know when to refresh. If the contents were sealed, that would be impossible without an extra call to the server. So readability is a feature of the format, and the mistake is in what we choose to put inside it.
Photo by David McElwee on Pexels
The Signature Protects Against Edits, Not Against Eyes
It helps to be precise about what the signature does. When the server issues a token, it computes a signature over the header and payload using a secret key, or a private key in the case of asymmetric algorithms. When the token comes back, the server recomputes the signature and compares. A mismatch means the contents were altered or the token was forged.
None of that stops a reader. A signature proves who issued the token and that the claims are unchanged. It says nothing about who is allowed to look. Anyone who copies the token, whether from a browser, a log file, a proxy, a screenshot or a pasted support ticket, can read every claim in it.
Where Tokens Quietly End Up
The real exposure is rarely a dramatic interception. It is the ordinary places a token travels once it exists. A bearer token goes into an Authorization header, and from there it can appear in application logs, reverse proxy logs, error tracking tools, browser developer tools, and HTTP archive files that people export to share with a colleague.
Some of those places are far less protected than the database. A debugging session that begins with "can you send me the failing request" can put a full token, with every claim in it, into a chat thread or a ticketing system. The more personal data you put inside the token, the more places that data now lives, and each one is a place you did not plan to secure.
Claims That Should Never Go in a Standard JWT
A useful rule is to treat the payload as public to anyone who can touch the token, then decide what you are comfortable with that audience seeing. Several kinds of data fail that test almost every time.
Credentials and secrets. Passwords, password hashes, API keys, refresh secrets and database connection details do not belong in a payload under any circumstances. This sounds obvious, yet it shows up in real systems, usually because someone serialized a whole user object into the token for convenience.
Sensitive personal data. Government identifiers, full dates of birth, home addresses, phone numbers, health details and financial account numbers should stay out. Even an email address is worth a second thought, since it is personal data in many privacy regimes and tends to leak into logs.
Internal system detail. Database table names, internal hostnames, feature flag names, and staff-only role labels give an attacker a free map of how your backend is organized. A claim called "tier" with the value "internal-admin-readonly" tells a reader exactly which accounts are worth targeting.
Anything that changes often. A token is a snapshot. If you put a user's current balance, subscription status or permission list inside it, the token keeps reporting those values until it expires, even after they change. That is a correctness problem as much as a privacy one.
What Is Reasonable to Include
None of this means claims are dangerous. The registered claims in the standard exist because they are small, useful and low risk: the issuer, the subject, the audience, the expiry time, the issued-at time and a unique token id. A subject that is an opaque identifier, not a name or an email, is almost always enough to look up everything else on the server.
A good habit is to keep the token lean and let it point to data, not carry it. An identifier that means nothing to an outsider is safe to expose. A full profile is not. When a service needs more detail, it can fetch it from a store it controls, with its own access checks, rather than trusting a copy baked into a token weeks ago.
Photo by Letícia Alvares on Pexels
When You Genuinely Need the Contents Hidden
Sometimes a claim has to travel inside the token and must not be readable in transit. The standards cover that case. RFC 7516 defines JSON Web Encryption, which wraps the payload so that only the intended recipient can open it. Encrypted tokens look similar from the outside, but they have five parts instead of three, and a decoder that only understands signed tokens cannot display them.
Encryption adds real complexity, including key distribution, rotation and a performance cost, so most teams choose a different route. They keep sensitive data on the server and send only a reference. That is simpler to reason about, easier to revoke, and keeps the token small, which matters because tokens ride along on every single request.
"Every time I audit a login flow, the token payload tells me more than the documentation does. If a claim would embarrass you in a support screenshot, it does not belong in a signed token." - Dennis Traina, founder of 137Foundry
Checking What Your Own Tokens Reveal
The most reliable way to learn what your tokens expose is to read one the way an outsider would. Take a token from a test account, never a real customer's, and decode it. Look at every key in the header and the payload and ask a blunt question about each one: would I be comfortable if this appeared in a screenshot posted publicly?
The free JWT Decoder by EvvyTools splits a token into its header, payload and signature, explains the registered claims, shows an expiry countdown, and lets you compare two tokens side by side. That comparison view is handy for spotting claims that appear in one environment but not another, which often reveals debug data that was never meant to reach production. Because the decoding step only needs the text of the token itself, it is a quick way to audit a sample without touching your servers.
Treat Pasted Tokens as Live Credentials
One more habit follows from all of this. A token you paste into any tool, chat or ticket should be treated as a live credential until it has expired. Even a decoder that processes everything in your browser, as a well built one should, cannot protect a token you also pasted into an email.
Prefer short lifetimes so a leaked token has a small window of use, and prefer test tokens for debugging. If a real token has been shared somewhere it should not have been, revoke the session or rotate the signing key, depending on how your system issues them. The OWASP Cheat Sheet Series has practical guidance on token handling, and the MDN web docs on HTTP authentication explain how bearer credentials travel in headers.
A Short Review Checklist
- Does the payload contain anything that would be a problem if a stranger read it?
- Are the subject and any identifiers opaque, rather than names or email addresses?
- Is the expiry short enough that a leaked token stops working quickly?
- Do your logs and error tracker redact the Authorization header?
- Do you keep fast-changing data, such as permissions and balances, on the server rather than in the token?
- Do you have a plan to revoke sessions or rotate keys if a token leaks?
Working through that list takes about ten minutes and catches the problems that cause the most trouble later.
Where This Leaves You
A JWT is a good tool for carrying a small, verifiable statement between systems. It is a poor container for anything you would not say out loud in a public room. The signature keeps people from changing the message, and it does nothing to keep them from reading it.
If you want a deeper walk through the structure itself, the earlier guide on how to read the three parts of a token covers each section in detail, and the EvvyTools tools directory lists the other free utilities in the same category. For the rest of our writing on developer topics, browse the EvvyTools blog, or start from the EvvyTools homepage.