Skip to content

Reject non-finite exp/nbf/iat values and tighten validation#1013

Open
AzmeerX wants to merge 1 commit intoauth0:masterfrom
AzmeerX:fix/validate-exp-nbf-iat-infinite-tests
Open

Reject non-finite exp/nbf/iat values and tighten validation#1013
AzmeerX wants to merge 1 commit intoauth0:masterfrom
AzmeerX:fix/validate-exp-nbf-iat-infinite-tests

Conversation

@AzmeerX
Copy link

@AzmeerX AzmeerX commented Mar 16, 2026

Description

  1. Reject non-finite registered claim values (exp, nbf, iat) by tightening validation to require finite numbers.
  2. Align tests to assert errors for Infinity, -Infinity, and NaN values instead of silently coercing them.
  3. Keeps current API intact while preventing tokens with invalid temporal claims from being produced.

Testing

Commands run locally (Node v20.20.0 and above):
npm test -- test/claim-iat.test.js
npm test -- test/claim-nbf.test.js
npm test -- test/claim-exp.test.js
npm test

Checklist

All active GitHub checks for tests, formatting, and security are passing
The correct base branch is being used, if not the default branch

@AzmeerX
Copy link
Author

AzmeerX commented Mar 16, 2026

let me know if you have any query about the commit or need any further change

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.

1 participant