Insecure JSON Web Token (Excessive Lifetime)
- CWE 613
- OWASP 2025-A07
The token stays valid for a very long time, many days or more according to its iat and exp claims. The longer a bearer token lives, the larger the window in which a leaked token can be replayed, and the more likely it is that it is still valid when it leaks.
Remediation
Shorten the lifetime of access tokens to minutes or hours.
Use refresh tokens for long sessions, store them server side, rotate them on every use and revoke them on logout and on password change.
Bind long lived credentials to the client where possible, for example with sender constrained tokens.
References
Go Back to List
Search Vulnerability
You may also see
- Insecure JSON Web Token (Unsigned)
- Insecure JSON Web Token (Weak Signing Secret)
- Insecure JSON Web Token (Missing Expiration)
- Insecure JSON Web Token (Excessive Lifetime)
- Insecure JSON Web Token (Sensitive Claims)
- Insecure JSON Web Token (Untrusted Key Reference)
- Insecure JSON Web Token (Exposed in URL)
- Insecure JSON Web Token (Cleartext Transmission)
- Insecure JSON Web Token
- Insecure Session Management