
A zero-upload JWT and OAuth token inspector decodes RFC 7519 headers and claims, verifies cryptographic signatures via native browser Web Crypto (crypto.subtle), and audits high-risk misconfigurations without ever transmitting your bearer token over the network. Because a live access token or session JWT grants direct API privileges until expiration, pasting staging or production credentials into a third-party SaaS decoder exposes your sessions to remote logging and telemetry. Use the offline inspector below to decode, verify, and audit tokens purely inside your browser.
Interactive Offline JWT & OAuth Security Inspector
Decode JWS/JWE structures, verify HS256/384/512, RS256/384/512, PS256, and ES256/384 signatures via native Web Crypto, and audit alg:none, kid injection, jku SSRF, clock skew, and over-privileged OAuth scopes.
Zero outbound network calls — keys never leave browser memory.
0 / 100
1. Decoded JOSE Header
2. Decoded JWT Claims Payload
3. Automated RFC 8725 & OAuth Security Audit Findings
Why You Should Never Paste Live JWTs Into Cloud Decoders
JSON Web Tokens (standardized in IETF RFC 7519) power stateless API authentication, OpenID Connect (OIDC) identity assertions, single sign-on gateways, and OAuth 2.0 bearer access tokens across modern web and mobile applications. Whenever an API returns HTTP 401 Unauthorized or 403 Forbidden, a developer’s first instinct is to inspect the token’s exp, aud, iss, and scope claims. Unfortunately, copying a live token—or worse, an HMAC signing secret—into an online decoder backed by third-party analytics, session-replay scripts, or server-side logging creates an immediate credential exposure.
Unlike encrypted session cookies stored inside an HTTP-only server cache, a signed JSON Web Signature (JWS, RFC 7515) is not encrypted. Its header and payload are merely Base64URL-encoded JSON, meaning anyone who sees the string can read every claim inside it—including user IDs, email addresses, tenant IDs, internal role matrices, and authorization scopes. Even more dangerously, if the token has not expired yet, any third party who captures it can replay it directly against your API in an Authorization: Bearer <token> header until exp elapses. Running decoding and cryptographic verification locally via the W3C Web Crypto API (window.crypto.subtle) guarantees zero third-party exposure while supporting full HMAC, RSA, RSA-PSS, and ECDSA verification.
If you are hardening user sessions against token theft and consent phishing across consumer or enterprise accounts, combine this inspector with our session-cookie hijacking and OAuth consent security guide and our FIDO2/WebAuthn passkeys security guide.
Structural Anatomy of JWS vs. JWE (RFC 7515 & RFC 7516)
Engineers routinely use “JWT” as shorthand for a three-segment signed token, yet the JOSE (JSON Object Signing and Encryption) specification family actually defines two distinct compact serializations:
- JSON Web Signature (JWS — RFC 7515, 3 segments): Formatted as
Base64URL(Header).Base64URL(Payload).Base64URL(Signature). Provides integrity and authenticity (detecting tampering and proving who signed the claims) but zero confidentiality. Never place passwords, payment card numbers, API secrets, or sensitive personal data inside a JWS payload. - JSON Web Encryption (JWE — RFC 7516, 5 segments): Formatted as
Header.EncryptedKey.IV.Ciphertext.AuthTag. Provides authenticated encryption (such as AES-256-GCM or AES-256-CBC-HMAC-SHA-512) so the claims remain opaque even to the browser or mobile client carrying the token.
| JWS Algorithm | Cryptographic Primitive | Key Distribution Model | 2026 Production Guidance |
|---|---|---|---|
ES256 / ES384 | ECDSA on NIST P-256 / P-384 + SHA-256/384 | Asymmetric (issuer signs with private key; services verify via JWKS public key) | Recommended default: compact 64-byte signature, fast verification, no shared secret sprawl |
PS256 / RS256 | RSA-PSS or RSASSA-PKCS1-v1.5 (≥2048-bit) | Asymmetric (JWKS / X.509 SPKI public key) | Widely supported across OIDC providers; prefer PS256 over legacy PKCS#1 v1.5 where supported |
EdDSA (Ed25519) | Edwards-curve deterministic signing (RFC 8037) | Asymmetric (32-byte public key, 64-byte signature) | Excellent modern choice for backend microservices; eliminates ECDSA nonce-reuse pitfalls |
HS256 / HS384 / HS512 | Symmetric HMAC-SHA2 | Shared secret (≥32 bytes for HS256, ≥64 bytes for HS512) | Use only inside a single trusted service boundary; any verifier holding the secret can also forge tokens |
none | Unsecured JWT (zero cryptographic signature) | None | Strictly forbid in every authentication and authorization middleware |
How Web Crypto Verifies ECDSA and RSA Signatures Inside the Browser
A subtle engineering detail in RFC 7515 often trips up developers implementing custom JWT verifiers: OpenSSL and ASN.1 DER encode ECDSA signatures as a variable-length DER SEQUENCE { r INTEGER, s INTEGER }, whereas JWS mandates fixed-width raw IEEE P1363 concatenation (r || s, exactly 64 bytes for P-256 ES256 and 96 bytes for P-384 ES384). Fortunately, the W3C Web Crypto API’s crypto.subtle.verify({ name: "ECDSA", hash: "SHA-256" }, ...) natively expects IEEE P1363 raw format—so our inspector verifies ES256 and ES384 tokens directly against JWK or PEM SPKI public keys with zero third-party crypto bundles. Click Generate Live ES256 Keypair + Token above to watch your browser mint an ephemeral P-256 keypair, sign a real token, export the public JWK, and verify it locally in milliseconds.
The 7 Highest-Impact JWT & OAuth Implementation Vulnerabilities (RFC 8725)
Most real-world JWT breaches do not break SHA-256 or elliptic-curve math; they exploit broken verification logic documented in IETF RFC 8725 (JSON Web Token Best Current Practices) and RFC 9700 (OAuth 2.0 Security Best Current Practice):
1. Accepting alg: "none" or Implicitly Trusting the Header’s alg Field
Early JWT libraries read the alg parameter from the untrusted token header and switched validation code paths dynamically. Attackers exploited this in two devastating ways: first, by changing alg to "none" (or mixed-case "NoNe") and stripping the signature segment; second, through algorithm confusion (RS256 → HS256), where a server passes its public RSA PEM key into an HMAC verifier after an attacker switches the header to "alg": "HS256", allowing anyone with the public key to forge arbitrary administrator tokens. Always enforce a strict server-side algorithm allowlist pinned to the key type (for example, algorithms: ["ES256"]) and never derive the algorithm solely from the incoming token header.
2. Key ID (kid) Path Traversal and SQL Injection
The optional kid header tells a verifying API which key to fetch from a keystore, filesystem, or database table. If a backend concatenates kid unsafely into a file path (/keys/${header.kid}.pem) or SQL statement, an attacker supplying kid: "../../dev/null" can force HMAC verification against an empty string, or inject a SQL UNION SELECT returning a known constant key. Treat kid strictly as an opaque lookup key validated against an explicit character allowlist (such as ^[A-Za-z0-9._-]{1,64}$) mapped against an in-memory JWKS dictionary.
3. Untrusted jku, x5u, and Embedded jwk Headers
RFC 7515 defines optional headers pointing to external key URLs (jku for JWK Set URLs, x5u for X.509 certificate chain URLs) or embedding a raw public key directly inside the header (jwk). If a verifier blindly fetches jku over HTTP or trusts an embedded jwk, an attacker can generate their own RSA keypair, sign an admin token, host the public key on an attacker-controlled server (or trigger Server-Side Request Forgery against internal cloud metadata endpoints), and bypass authentication completely. Production verifiers must ignore caller-supplied key URLs and pin keys exclusively to pre-configured Identity Provider metadata discovered via trusted TLS.
4. Missing Audience (aud) and Issuer (iss) Enforcement (Confused Deputy Attacks)
In multi-service architectures sharing one Identity Provider, a token issued for a low-privilege reporting API (aud: "https://reports.example.com") carries a valid cryptographic signature from the same IdP that secures your billing API (aud: "https://billing.example.com"). If the billing service verifies only the signature and exp without checking that aud matches its own canonical resource identifier—and that iss matches the exact expected issuer—an attacker who steals a low-privilege token can replay it across high-value APIs.
5. Weak Symmetric HMAC Secrets
Because HMAC-SHA256 tokens can be verified offline at billions of hashes per second on consumer GPUs, signing HS256 tokens with human-readable passwords or short strings allows offline brute-force key recovery from a single captured JWT. RFC 7518 Section 3.2 mandates a key size equal to or larger than the hash output size: at least 32 random bytes (256 bits) for HS256, 48 bytes for HS384, and 64 bytes for HS512.
6. Immortal or Over-Long Access Tokens and Missing Revocation Strategy
A JWT without an exp claim—or with an expiration set weeks or months in the future—turns every leaked browser log or XSS exfiltration into persistent account takeover. Because stateless JWT verification cannot detect server-side logout unless paired with short lifetimes or revocation checks, RFC 9700 recommends keeping bearer access tokens short-lived (typically 5 to 15 minutes), rotating refresh tokens on every use with reuse detection, and storing browser session credentials in HttpOnly; Secure; SameSite=Strict cookies rather than localStorage where any injected script can steal them.
7. Over-Privileged OAuth 2.0 Scopes and Illicit Consent Grants
Attackers increasingly bypass password and MFA protections altogether through OAuth consent phishing—tricking users into approving malicious third-party apps requesting broad scopes like offline_access, mail.readwrite, directory.readwrite.all, or wildcard * permissions. Auditing decoded scope and scp claims during API reviews and incident response immediately flags tokens whose permissions exceed the task they were issued to perform. Pair least-privilege OAuth scopes with hardware-backed phishing resistance covered in our passkey enclave vs. password manager comparison.
// Minimal RFC 8725 hardened server-side verification policy (pseudocode)
const policy = {
allowedAlgorithms: ["ES256"], // Never trust header.alg; forbid "none" & HS/RS mixing
expectedIssuer: "https://idp.example.com", // Exact string match against iss
expectedAudience: "https://api.example.com", // Prevents cross-service token replay
maxClockSkewSec: 30, // Tight nbf/exp tolerance
ignoreHeaders: ["jku", "x5u", "jwk"], // Fetch keys ONLY from pinned IdP JWKS endpoint
requiredClaims: ["sub", "iss", "aud", "exp", "iat"]
};JWT Validation Checklist for Backend & API Engineers
Before shipping any microservice or API gateway that accepts JWT bearer credentials, verify every control below in automated unit tests:
- Pin verification algorithms explicitly: Reject
alg: "none", reject empty signatures, and bind every JWKS key entry to one explicitalganduse: "sig". - Validate standard claims strictly: Require and verify
iss,aud,exp,nbf(if present), andtyp(for example,at+jwtper RFC 9068 for OAuth access tokens so an OIDC ID token cannot be replayed as an API access token). - Bound clock skew tightly: Allow no more than 30–60 seconds of NTP skew when comparing
expandnbfagainst UTC time. - Protect transport and JWKS endpoints with verified TLS: Always retrieve remote JWKS documents over HTTPS with strict certificate validation—you can audit your Identity Provider’s TLS certificate chain offline using our X.509 PEM Certificate & Post-Quantum Inspector.
- Eliminate token leakage in URLs and logs: Never transmit JWTs in query parameters (
?access_token=...) where they leak into browser history, HTTPRefererheaders, and reverse-proxy access logs. ScrubAuthorizationheaders from application logs and error trackers. - Keep server infrastructure hardened: Protect signing keys in HSMs or cloud KMS rather than plaintext environment files, and harden administrative host access using our SSH Ed25519 & post-quantum KEX hardening guide and interactive engineering tools hub.
Sender-Constrained Tokens: DPoP (RFC 9449) and Mutual-TLS Binding (RFC 8705)
Standard OAuth 2.0 JWTs operate as bearer tokens: any party possessing the string can present it inside an Authorization: Bearer header and impersonate the legitimate user until expiration. If an adversary extracts a bearer JWT from an unpatched browser extension, reverse-proxy debug log, compromised CI runner, or cross-site scripting vulnerability, cryptographic signature validation alone cannot tell the resource server that the caller is not the rightful owner.
Modern high-assurance APIs solve bearer replay with sender-constrained tokens, binding the JWT cryptographically to a client-held private key via the RFC 7800 cnf (Confirmation) claim:
- OAuth 2.0 Demonstrating Proof-of-Possession (DPoP — IETF RFC 9449): The client generates an ephemeral asymmetric keypair (for example, non-extractable ECDSA P-256 inside IndexedDB/Web Crypto) and sends a freshly signed
DPoPproof JWT on every API call binding the HTTP method (htm), target URI (htu), timestamp (iat), and access-token hash (ath). The authorization server embeds the public key’s JWK SHA-256 thumbprint inside the access token ascnf.jkt. Even if an attacker steals the access token, replaying it without the client’s private key fails verification immediately. - Mutual-TLS Client-Certificate-Bound Access Tokens (IETF RFC 8705): For backend service-to-service APIs and open-banking gateways, the authorization server records the SHA-256 thumbprint of the client’s X.509 certificate inside
cnf["x5t#S256"]. Every downstream resource server compares the incoming mTLS leaf certificate hash againstcnf["x5t#S256"], making stolen tokens completely useless outside the authenticated TLS client host. You can inspect client certificates and compute matching SHA-256 hashes offline using our X.509 PEM Certificate Inspector.
Zero-Downtime JWKS Key Rotation & Emergency Session Revocation
Hardcoding a single static signing key guarantees operational fragility: if the key leaks, rotating it abruptly logs out every active user and breaks running microservices simultaneously. Follow a deterministic three-stage JWKS lifecycle instead:
- Stage 1 — Publish Before Signing: Generate a new asymmetric keypair with a unique, date-stamped
kid(for example,es256-2026-12) and publish its public JWK to/.well-known/jwks.jsonalongside the currently active key. Allow all resource servers to refresh their JWKS cache (typically 5–15 minutes) before signing any tokens with the new key. - Stage 2 — Switch Active Signer: Configure the Identity Provider to sign newly minted tokens using the new
kidwhile continuing to keep the previous public key published in the JWKS endpoint for at leastmax_access_token_ttl + max_clock_skew. - Stage 3 — Retire Legacy Public Key: Once every token signed by the previous key has naturally expired, remove the old JWK entry from
jwks.jsonand destroy the retired private key inside your HSM or KMS.
When an account compromise occurs mid-session, short-lived access tokens (5–15 minutes) combined with rotating refresh tokens and reuse detection (RFC 9700 §4.14.2) contain the blast radius. Every refresh exchange invalidates the previous refresh token and issues a fresh child token in the same token family. If an attacker replays an already-rotated refresh token, the authorization server detects the family reuse, revokes the entire session tree immediately, and forces re-authentication with a phishing-resistant factor such as a hardware passkey.
| Session Control Layer | Recommended Configuration | Threat Neutralized |
|---|---|---|
| Access Token TTL | 5–15 minutes with explicit exp & iat | Limits window of leaked bearer JWT replay |
| Token Binding | DPoP (cnf.jkt) for SPAs/mobile; mTLS (cnf.x5t#S256) for B2B APIs | Blocks off-device token exfiltration and replay |
| Browser Storage | Backend-for-Frontend (BFF) with HttpOnly; Secure; SameSite=Strict cookies | Prevents XSS scripts from reading tokens via localStorage |
| Emergency Kill-Switch | Per-user auth_time / jti revocation check on sensitive endpoints (wire transfers, MFA changes) | Stops active hijacked sessions even before exp elapses |
Frequently Asked Questions About JWT & OAuth Token Security
Is it safe to decode a live JWT in this browser inspector?
Yes. Decoding, RFC 8725 security auditing, and Web Crypto signature verification run 100% locally inside your browser memory with zero outbound network requests. Still, as a general operational rule, avoid pasting production signing private keys into any browser tab and rotate test secrets regularly.
Does signing a JWT with HS256, RS256, or ES256 encrypt its payload?
No. A three-part JWS token only Base64URL-encodes its header and payload, so anyone possessing the token string can decode and read every claim without needing the key. Signing guarantees tamper resistance and issuer authenticity; if payload confidentiality is required, use five-part JSON Web Encryption (JWE, RFC 7516).
Why is the JWT alg:none attack still a critical vulnerability?
If a server dynamically trusts the alg header inside an incoming JWT instead of enforcing a fixed algorithm allowlist, an attacker can set alg to none, modify claims such as sub or role to administrator privileges, strip the signature, and pass authentication without knowing any cryptographic key.
Should you choose ES256, RS256, or HS256 for modern OAuth access tokens?
Prefer asymmetric algorithms such as ES256 (ECDSA P-256), EdDSA, or PS256/RS256 for OAuth and distributed microservices because verifiers only need the public JWKS key and cannot forge tokens. Reserve symmetric HS256 for single-service contexts using at least 32 random bytes of key entropy.
Why is storing JWT access tokens in browser localStorage discouraged?
Any JavaScript executing on the page—including a compromised third-party dependency or cross-site scripting (XSS) payload—can read localStorage directly and exfiltrate bearer tokens. Storing session tokens in HttpOnly, Secure, SameSite cookies (or using a Backend-for-Frontend session pattern) substantially reduces token-theft impact.
Primary Technical Standards & References
- IETF RFC 7515 (JWS), RFC 7516 (JWE), RFC 7517 (JWK), RFC 7518 (JWA), and RFC 7519 (JWT)
- IETF RFC 8725 — JSON Web Token Best Current Practices
- IETF RFC 9068 — JSON Web Token (JWT) Profile for OAuth 2.0 Access Tokens
- IETF RFC 9700 — Best Current Practice for OAuth 2.0 Security
- W3C Web Cryptography API (
SubtleCrypto) Specification
Written and prepared by Kshitij Gupta.



