Skip to content

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

Open

Description

@jeffcann

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.

var clockTimestamp = options.clockTimestamp || Math.floor(Date.now() / 1000);

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

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions