Skip to content

fix: reject NumericDates outside Instant range#790

Open
ANSHUL-REAL wants to merge 1 commit into
auth0:masterfrom
ANSHUL-REAL:fix/out-of-range-numeric-date
Open

fix: reject NumericDates outside Instant range#790
ANSHUL-REAL wants to merge 1 commit into
auth0:masterfrom
ANSHUL-REAL:fix/out-of-range-numeric-date

Conversation

@ANSHUL-REAL

Copy link
Copy Markdown

Fixes #782

Instant.ofEpochSecond throws DateTimeException when a registered NumericDate is outside the range supported by Instant. Catch that exception while parsing date claims and convert it to the library's existing JWTDecodeException boundary.

This adds a regression test using Long.MAX_VALUE for a NumericDate claim.

Validation:

  • ./gradlew :java-jwt:test --tests com.auth0.jwt.impl.PayloadDeserializerTest -x :java-jwt:compileModuleInfoJava

@ANSHUL-REAL
ANSHUL-REAL requested a review from a team as a code owner July 24, 2026 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Out-of-range NumericDate claims can throw unchecked DateTimeException during verification

1 participant