You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.
Agree, I prefer the library being strict rather than lenient on checks, we should validate iat if it’s present in the JWT to ensure it’s not issued in the future (probably also applying the leeway since clocks can be slightly out of sync sometimes). Happy to accept a pull request for this!
The function
jwt.ValidateWithLeeway
checks the times on thenbf
andexp
claims. It does not check theiat
claim. The standard RFC 7519 states that this field is optional, and does not require that the time on this field be checked. However, if it is issued in the future, something suspicious is happening. It seems to me that it would be good to be paranoid?If this seems acceptable, I'm happy to attempt to submit a pull request for this, since it will only require a few lines of code to be added here: https://github.com/square/go-jose/blob/v2/jwt/validation.go#L97
Found while checking an implementation of validation for Google's Identity-Aware Proxy, which includes a test case for this: https://cloud.google.com/iap/docs/special-urls-and-headers-howto#testing_jwt_verification
The text was updated successfully, but these errors were encountered: