Join our Newsletter — 33% off our NHI Course
Home› FAQ› Authentication, Authorisation & Trust› What causes Insecure JSON Web Tokens (JWT)?
Authentication, Authorisation & Trust

What causes Insecure JSON Web Tokens (JWT)?

← Back to all FAQ
By NHI Mgmt Group Editorial Team Updated October 20, 2026 Domain: Authentication, Authorisation & Trust

Insecure JSON Web Tokens are caused by weak token design or verification, such as accepting unsigned or wrongly signed tokens, trusting token claims without server-side checks, or using long-lived tokens that are easy to replay. Teams should verify issuer, audience and signature correctly, enforce short lifetimes, and reject tokens when the required claims or signing controls are missing.

Why JWTs Become Insecure in Practice

JWTs usually become insecure when teams treat the token as self-authenticating trust instead of a credential that still needs strict verification. The common failure mode is not the format itself, but weak signing, weak claim validation, or accepting a token without checking whether it was actually issued for the system that receives it.

A safe JWT design has to answer three questions every time a token is used: who issued it, who it is meant for, and whether the signature and claims still match the current request. If any one of those checks is skipped, a token that looks structurally valid can still be malicious, expired, or simply intended for a different service.

Long-lived bearer tokens make the problem worse because replay becomes easy once a token is exposed. That is why token lifetimes, issuer checks, audience checks, and signature validation belong together as one control set, not as optional hardening.

What Weak JWT Verification Usually Looks Like

The most dangerous implementation mistakes are predictable. Teams may accept tokens with no signature, trust a token just because it parses, ignore issuer or audience mismatches, or rely on client-side claims for authorization decisions that should happen on the server.

Verification failures often appear in middleware shortcuts, custom auth code, or libraries that are configured too loosely. A token can also be insecure when a service accepts tokens from more than one issuer without explicitly pinning the expected signing keys and claim rules for each trust relationship.

Another frequent issue is claim overtrust. A JWT can say a user is an admin, but that claim is only meaningful if the server verifies the token source and the authorization model behind that claim. Claims are evidence, not authority by themselves.

How Replay, Scope Creep, and Missing Claims Create Exposure

JWT insecurity is not only about forgery. Even a correctly signed token can become unsafe if it is valid for too long, can be reused across contexts, or is accepted after the relevant session or entitlement has already changed.

This is why token scope matters. A token intended for one API or one tenant should not be accepted everywhere, and a token issued for one workflow should not silently authorize a different one. The narrower the token’s audience and lifetime, the smaller the blast radius when it leaks.

For teams building token-heavy platforms, the safer pattern is to treat missing required claims as a hard failure, not a warning. If the application depends on a claim for authorization or tenancy isolation, the absence or mismatch of that claim should stop the request immediately.

Where JWT handling is part of a broader access design, the practical control questions often overlap with NHIs and token-based access, especially when service-to-service authentication depends on bearer material rather than interactive logins.

Risk and Threat Considerations

Insecure JWT handling creates a direct path from token exposure to unauthorized access. Attackers do not need to break the whole system if they can reuse a bearer token, forge one through weak verification, or exploit a service that trusts claims more than the signing and issuer context.

Failure mechanism: The application accepts a token that is unsigned, wrongly signed, issued by an unexpected source, or still accepted after it should have expired, so the attacker can impersonate the original holder or escalate privileges without re-authentication.

Impact: The result can be account takeover, cross-service access, privilege escalation, session replay, or tenant boundary failure, with the severity determined by how much authority the token carries and how broadly it is accepted.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP API Security Top 10 and OWASP Non-Human Identity Top 10 address the attack and risk surface, while NIST SP 800-53 Rev 5 sets the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP API Security Top 10API2 — Broken AuthenticationJWT verification failures are authentication failures for APIs that accept bearer tokens.
Recommendation — Validate JWT signatures, issuers, audiences and expirations before granting API access.
NIST SP 800-53 Rev 5IA-5 — Authenticator ManagementJWT lifetime, rotation and replay risk map to authenticator lifecycle control.
IA-9 — Service Identification and AuthenticationJWTs often authenticate services and workloads in machine-to-machine flows.
Recommendation — Set short token lifetimes and revoke or rotate credentials when exposure is suspected. Authenticate non-human callers with tightly scoped, verifiable tokens and mutual trust rules.
OWASP Non-Human Identity Top 10NHI-02 — Secret LeakageLeaked JWTs act as bearer secrets that can be replayed until invalidated.
NHI-07 — Long-Lived SecretsLong-lived JWTs are easier to replay after disclosure or theft.
Recommendation — Reduce token exposure and rotate any JWT material that may have leaked. Prefer short-lived tokens and avoid long validity windows for bearer credentials.

Practitioner Guidance

What to verify: Confirm that every JWT check is enforced server-side, including signature validation, issuer, audience, expiration, and any required custom claims. If one of those checks is done only in client code, treat the control as incomplete.

Decision rule: If a token can authorize production access, keep it short-lived and narrowly scoped, and prefer a design that fails closed when a claim is missing or ambiguous. If the token can be replayed after exposure, assume the exposure will eventually be used.

Practitioner takeaway: JWTs are safe only when the application treats them as verifiable credentials with explicit trust boundaries, not as self-declaring truth.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on October 20, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org