HIGH AI PREVALENCE: MEDIUM auth.rust.jwt.no-expiration-validation
JWT expiration validation is turned off by setting validate_exp: false on the jsonwebtoken Validation.
Why AI tools produce this: AI coding tools produce this regularly, typically when prompted for a shortcut or a quick fix.
Why this matters
With exp checking disabled, decode accepts tokens that have already expired, so a leaked or stolen access token stays usable forever. For OAuth/OIDC this defeats token lifetimes and revocation-by-expiry, letting an attacker replay old tokens.
Leave validate_exp at its default true so expired tokens are rejected. Build the validator with Validation::new(Algorithm::HS256) (or your issuer's algorithm) and do not turn off validate_exp.
VULNERABLE
SAFE
Suppressing this rule
If a finding is a genuine false positive, scope the suppression to the exact line and leave a reason, never disable the rule project-wide. Disable directives are line-scoped by design.
// oauthlint-disable-next-line auth.rust.jwt.no-expiration-validation -- <reason>