Antpact Toolbox
中文
Home › Blog › Dev & Productivity › JWT Parser: That "login token" you ship is readable by anyone
Dev & Productivity

JWT Parser: That "login token" you ship is readable by anyone

Oct 4, 2026 · 48 views · By Antpact Toolbox Team #dev-jwt #JWT parser #weak JWT secret #JWT forgery #JWT security #alg none #token leak

A reader once messaged me in a bit of a panic. He had built a small SaaS as a side project, used JWT for login, and one morning found a few hundred admin accounts he had never created, plus a chunk of order data copied out overnight.

He had not been phished. Nobody brute-forced a password. Someone had grabbed one ordinary user token, ran it through hashcat with a wordlist, and recovered the signing secret in seconds — because he had shipped the demo default "secret". With that key, they minted their own tokens claiming role: admin, user_id: 1, the server verified the signature, and waved them straight through. No login event, no alert.

That is the whole JWT story in a nutshell: brilliant when done right, a hanging key when done wrong.

What a JWT actually is (and why each part can be read)

A JWT looks like gibberish split by two dots. It is three base64url-encoded chunks:

  • the header says which signing algorithm (alg);
  • the payload carries your claims — sub, role, exp, and whatever else you put there;
  • the signature is what the secret key computes.

Here is the part people miss: the first two parts are encoded, not encrypted. Paste any token into a decoder and the roles, emails, and expiry are laid bare. That leads straight to the first trap.

Trap 1 — Sensitive data in the payload

A medical app once stuffed patient records into the JWT payload. The token got intercepted, base64-decoded, and suddenly 100,000 private records were exposed. Rule of thumb: a JWT guarantees integrity, not confidentiality. Never put ID numbers, phone numbers, or passwords in there.

Trap 2 — A secret that is not one

Besides the "secret" above, the usual suspects are "123456", "password", or the app own name. Those fall instantly against rockyou.txt. The floor for HS256 is 256 bits (32 bytes) per RFC 7518 section 3.2; anything shorter can be enumerated by a modern GPU in minutes. The 2026 Note Mark flaw (CVE-2026-44523, CVSS 10.0) did exactly this — it never checked key length, so attackers cracked the weak secret locally with hashcat -m 16500 and forged any user token for full account takeover.

Then there is the "default secret nobody changed" class. Apache HugeGraph shipped CVE-2024-43441 with a hardcoded default key anyone could use to mint admin tokens; Flowise and Yeti had near-identical hardcoded-default-key bugs (CVE-2026-56271, CVE-2024-46508).

Trap 3 — No signature check, algorithm up for grabs

This is the classic. Older JWT libraries (jsonwebtoken before 4.2.2, tracked as CVE-2015-9235) trusted whatever alg the token declared in its own header. An attacker set alg to none, dropped the signature, and the server skipped verification — role: user became role: admin. RFC 8725 later mandated a server-side algorithm allowlist and rejecting none outright. Through 2025 and 2026, libraries like Authlib and fast-jwt kept surfacing the same class of forgery bug.

Trap 4 — Storing the token in localStorage

Frontends that drop the JWT into localStorage make it trivial for any XSS script to walk off with it. A malicious npm package downloaded 40,000+ times did exactly that in 2024, and the affected company had to force password resets for 3.1 million users. Prefer an HttpOnly cookie when you can.

This is not theoretical — it keeps happening

  • Coupang (2025): South Korea KISA confirmed attackers stole the cryptographic signing key for auth tokens. From June to November 2025, over 30 million accounts names, emails, delivery phones, and real addresses leaked — with no normal login ever happening.
  • Volkswagen plus Stormous (June 2025): stolen data included core auth JWTs affecting roughly 800,000 EVs; those tokens could be used to forge user identity and even track a vehicle live location.
  • Industry data backs the worry: Verizon 2025 Data Breach Investigations Report found 68% of web-app breaches involved improper token handling, and OWASP folds JWT misconfiguration into API2:2023 Broken Authentication.

How to inspect a token with Antpact JWT Parser

My habit now: before I trust any token, I take it apart.

Paste it into Antpact JWT Parser. It splits the three parts cleanly:

  • Check the header alg — if it is none, or you expected RS256 but see HS256, that is a red flag;
  • Check the payload exp to confirm it has not expired, then scan for phone numbers or ID numbers that should never be there;
  • The signature is shown as-is and not verified (verification needs your server secret key, which should never leave your infrastructure) — but you can confirm it is present.

A few hardening notes if you are building the backend:

  • Use a long, random signing secret (at least 32 bytes). No words, no birthdays.
  • Pin an explicit algorithm allowlist on the server — for example only RS256. Never trust what the token claims.
  • Keep only non-sensitive claims in the payload; fetch the rest server-side.
  • Shorten token lifetime and add refresh. Always transport over HTTPS.

🛠JWT ParserUse this tool in Antpact Toolbox →

← Back to blog