Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

nbf validation fails when a non-integer value is passed in

Open
#817 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, node.js

Research direction

Start at verify.js around line 50 and reproduce the fractional nbf example from the issue. Check the nbf validation against the current timestamp; done means a valid token with a non-integer nbf is not rejected because the clock value was rounded down.

Written by the indexing model from the issue text.

Description

Rounding down the current time when validating the nbf claim can result in a valid token being rejected if the nbf value is non-integer.
https://github.com/auth0/node-jsonwebtoken/blob/74d5719bd03993fcf71e3b176621f133eb6138c0/verify.js#L50

Example:

nbf = 1_646_822_341.111
Date.now() = 1_646_822_341_999
clockTimestamp = Math.floor(Date.now() / 1000) = 1_646_822_341
nbf > clockTimestamp
Dominant language
JavaScript
Stars
18.2k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from auth0/node-jsonwebtoken

All issues in auth0/node-jsonwebtoken

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.