Skip to content

fix: reject non-NumericDate exp, nbf, and iat claims - #337

Open
SashaMIT wants to merge 1 commit into
decentralized-identity:masterfrom
SashaMIT:fix/verify-numeric-date-claims
Open

fix: reject non-NumericDate exp, nbf, and iat claims#337
SashaMIT wants to merge 1 commit into
decentralized-identity:masterfrom
SashaMIT:fix/verify-numeric-date-claims

Conversation

@SashaMIT

Copy link
Copy Markdown

Summary

  • verifyJWT treated exp, nbf, and iat as present only when they were truthy. exp: 0 and string values such as "never" skipped the RFC 7519 NumericDate window while the signature still verified.
  • Fail closed when those claims are present but not a finite number. exp: 0 is expired (1970-01-01). Missing claims stay optional, matching the existing policy flags.
  • Pin policies.now on the hardcoded did:key VC. That fixture expired on 2025-12-04 and already failed on tip.

Test plan

  • yarn test 326/326
  • Revert-test: the four new assertions fail when the guards are removed
  • yarn lint

Threat-model: the signer already controls the payload. The remaining verifier guard is the validity window. A present non-NumericDate claim turned that guard into a no-op.

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