Because JWTs are bearer credentials, anyone who copies one can often use it until the token expires. Longer lifetimes increase the replay window and reduce the chance that revocation, logging, or user review will catch misuse before access is abused across multiple systems.
Why long-lived JWTs are dangerous for NHI access
JWTs are usually bearer tokens, which means possession is enough. For NHI access, that becomes a replay problem: if a token is copied from logs, memory, a proxy, or a misconfigured integration, it can often be used anywhere the issuer will still accept it. Longer lifetimes directly expand the abuse window and make detection, rotation, and revocation less effective.
Why the token format matters less than the trust model
A JWT is not risky because it is a JWT, it is risky because teams often treat it like a portable access credential. If the token is self-contained and valid until expiry, the verifier may never ask whether the original workload is still trusted. That makes lifetime, audience restriction, and sender-constraining controls central to the design, not optional hardening.
Long-lived tokens also tend to survive environment changes. A service can be decommissioned, a secret can be rotated, or a permission can be removed, yet a still-valid token may continue to work until the expiry clock runs out. In NHI environments, that gap matters because machine access is often embedded in automation, so a forgotten token can outlive the owner’s awareness.
What makes the blast radius so large
The main risk is that one copied token may unlock many repeated actions before anyone notices. If the token is accepted across multiple services, the attacker does not need to escalate privilege immediately, they only need to reuse the same bearer credential inside the token lifetime. That creates a wide replay window, especially where logs, CI/CD jobs, sidecars, or brokers handle tokens at scale.
Long lifetimes also reduce the value of after-the-fact controls. Logging tells you the token was used, but not that it should still be trusted. Review processes may only run weekly or monthly, which means misuse can complete long before human inspection. Token and Session Security Guide is useful here because it frames lifetime, replay, revocation, and binding as one control problem rather than separate hygiene tasks.
Risk and Threat Considerations
Long-lived JWTs create a durable theft and replay opportunity: once an attacker or insider copies the token, they can often keep using it until expiry, even if the original host, job, or secret source has already been remediated. The risk is highest when tokens are accepted broadly, appear in automation paths, or are not sender-constrained.
Failure mechanism: bearer semantics allow reuse of the same token after disclosure, while long expiry delays invalidation and extends the attacker’s usable window. If the token also carries broad audience or scope, one compromise can turn into repeated access across multiple systems.
Impact: misuse can look like legitimate service traffic, which slows detection and increases the chance of data exposure, unwanted changes, or lateral movement before revocation catches up.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10 addresses the attack and risk surface, while NIST SP 800-53 Rev 5 and NIST Zero Trust (SP 800-207) set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-02 — Secret Leakage | Long-lived JWTs become dangerous when copied or exposed. |
| NHI-07 — Long-Lived Secrets | The question is specifically about the risk created by long token lifetimes. | |
| NHI-04 — Insecure Authentication | Bearer JWTs rely on weak possession-based trust when not bound to sender or context. | |
| Recommendation — Reduce token exposure and shorten usable secret lifetime. Prefer short-lived credentials and justify any extended validity. Bind authentication material to stronger proof where possible. | ||
| NIST SP 800-53 Rev 5 | IA-5 — Authenticator Management | JWT lifetime, rotation, and revocation are authenticator lifecycle concerns. |
| AC-6 — Least Privilege | Token scope and audience directly shape the blast radius of a stolen JWT. | |
| AU-6 — Audit Record Review, Analysis, and Reporting | Long-lived tokens depend heavily on detection because misuse may persist until expiry. | |
| Recommendation — Set lifecycle limits and revoke authenticators promptly. Constrain token privileges to the minimum required access. Review token-use logs quickly enough to catch replay before expiry. | ||
| NIST Zero Trust (SP 800-207) | Zero Trust Architecture | Short-lived, continuously re-evaluated trust reduces the value of stolen bearer tokens. |
| Recommendation — Reassess trust continuously instead of relying on long-lived token validity. | ||
Practitioner Guidance
What to prioritise: Treat JWT lifetime as a blast-radius decision, not a convenience setting. If a token can reach production systems, assume compromise is a realistic outcome and shorten expiry before you rely on detective controls.
What to verify: Confirm the token is audience-restricted, has the narrowest feasible scope, and is not accepted after the underlying workload, secret, or trust relationship has changed. If revocation is weak, the expiry window matters even more.
Decision rule: If the token can authenticate unattended automation, prefer short-lived credentials with binding or exchange controls; if it is a long-lived bearer token, require compensating monitoring and a documented reason for the exception.
Practitioner takeaway: The longer a JWT remains valid, the more it behaves like an unrevoked password for a machine, so the control objective is to reduce replay value, not merely to rotate the token eventually.
Related resources from NHI Mgmt Group
- Why do long-lived API tokens and copied credentials create so much risk in application-to-application access?
- Why do SaaS integrations create NHI risk even when access is short lived?
- Why do long-lived AWS credentials create more risk than task-scoped access?
- Why do long-lived secrets create more NHI risk than short-lived federated tokens?