The vulnerability is a type confusion issue in the jsonwebtoken library for Rust. When validating JWT claims like nbf (not before) or exp (expiration time), the library's validate function did not correctly handle cases where the claim was provided in an incorrect format (e.g., a String instead of a Number).
The internal TryParse enum would represent this as FailedToParse. However, the validation logic only checked for the Parsed state and silently ignored FailedToParse and NotPresent states. This meant that if validate_nbf or validate_exp was enabled, but the claim was not in the required_spec_claims list, an attacker could provide a malformed claim (e.g., {"nbf": "99999999999"}) to bypass the time-based validation.
The fix, introduced in commit abbc3076742c4161347bc6b8bf4aa5eb86e1dc01, adds explicit checks in the jsonwebtoken::validation::validate function to return an InvalidClaimFormat error if validate_nbf or validate_exp is enabled and the corresponding claim failed to parse.
The vulnerable function is therefore jsonwebtoken::validation::validate, as it contained the flawed logic that skipped validation for malformed claims. An attacker exploiting this would cause this function to execute and incorrectly approve a token.