Have you ever seen a JWT token that reveals way more than it should?
In offensive security, we always inspect JWTs for:
Weak or guessable signing keys (e.g., "secret")
Use of none algorithm
Missing or improperly enforced exp claims
Sensitive data in payload (passwords, tokens)
JWTs are NOT encrypted by default. Don’t store secrets inside them before encrypting sensitive data.
You may not believe but this is extremely common in JWT tokens, especially by junior developers because they think tokens are safe and unreadable so they just put all relevant info inside, because this is an “EASY WAY” of coding...
Password inside JWT?!
Never store passwords (even hashed) in a JWT payload. JWTs are just base64-encoded—not encrypted! We can break hashed passwords too. We can also break some encryption algorithms like MD5, so you should choose a good algorithm for encryption.
Credit Card Info in Payload?
Huge PCI-DSS violation and security risk. This data could be exposed in logs, browser storage, or intercepted.
Long expiration (exp)
A token that lives forever is a token that can be stolen and reused forever.
Weak Signature Key
A predictable or short secret (use a better signing key) can be brute-forced, allowing attackers to forge tokens.
Here’s a nice website you can use to decode JWT tokens: https://jwtauditor.com/

Comments
Post a Comment