Skip to content

exp claim doesnt support scientific notation #706

Description

@ajayd942

Checklist

  • I have looked into the Readme and Examples, and have not found a suitable solution or answer.
  • I have looked into the API documentation and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.

Description

If we have a jwt token, with exp claim value as

"exp": 1.733162101e+26,

the library fails to decode the token. We get a JWTDecodeException with error "The claim 'exp' contained a non-numeric date value."

According the RFC on JWT(https://datatracker.ietf.org/doc/html/rfc7519#section-2), a NumericDate should adhere to IEEE Std 1003, according to which scientific notation representation is valid.

Reproduction

  1. Create a jwt token with exp claim in scientific notation.
  2. Try to decode the token. It will fail with "The claim 'exp' contained a non-numeric date value."

Additional context

No response

java-jwt version

4.4.0

Java version

17

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis points to a verified bug in the code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions