fast-jwt clockTolerance: Infinity silently bypasses both exp and nbf validation (and persists in the verifier cache)
## Summary `createVerifier({ clockTolerance: Infinity })` silently bypasses both `exp` (expiry) AND `nbf` (not-before) validation. Any expired or not-yet-active token is accepted as valid. The same primitive also corrupts the verifier's internal cache so cached entries inherit infinite validity — they remain valid past a later developer-removed Infinity config until LRU eviction. ## Vulnerable code `src/verifier.js:531-533` — option validation only rejects negative values, not Infinity: ```js if (clockTolerance && (typeof clockTolerance !== 'number' || clockTolerance < 0)) { throw new TokenError(TokenError.codes.invalidOption, 'The clockTolerance option must be a positive number.') } ``` `Infinity` passes (it's a number, not less than 0, truthy). `src/verifier.js:583-602` — clockTolerance flows into the date-claim validators: ```js if (!ignoreNotBefore) { validators.push({ ..., modifier: -clockTolerance }) // → -Infinity } if (!ignoreExpiration) { validators.push({ ..., modifier: +clockTolerance }) // → Infinity } ``` `src/verifier.js:198-205` — applies modifier additively, producing always-pass comparisons: ```js function validateClaimDateValue(value, modifier, now, greater, errorCode, errorVerb) { const adjusted = value * 1000 + (modifier || 0) // → ±Infinity const valid = greater ? now >= adjusted : now <= adjusted // → always true ... } ``` ## Empirical PoC ```js const { createSigner, createVerifier } = require('fast-jwt') const secret = 'test-secret-with-enough-length-to
- Products
- fast-jwt
- Affected versions
- Not specified
- Fixed versions
- 6.3.0
- CVEs
- CVE-2026-107721
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 28 Oct 2026, 10:06 UTC · Revision 1
Source evidence
fast-jwt clockTolerance: Infinity silently bypasses both exp and nbf validation (and persists in the verifier cache)
core-osv · Original sourcePublished 8 Oct 2026, 22:02 UTC
## Summary `createVerifier({ clockTolerance: Infinity })` silently bypasses both `exp` (expiry) AND `nbf` (not-before) validation. Any expired or not-yet-active token is accepted as valid. The same primitive also corrupts the verifier's internal cache so cached entries inherit infinite validity — they remain valid past a later developer-removed Infinity config until LRU eviction. ## Vulnerable code `src/verifier.js:531-533` — option validation only rejects negative values, not Infinity: ```js if (clockTolerance && (typeof clockTolerance !== 'number' || clockTolerance < 0)) { throw new TokenError(TokenError.codes.invalidOption, 'The clockTolerance option must be a positive number.') } ``` `Infinity` passes (it's a number, not less than 0, truthy). `src/verifier.js:583-602` — clockTolerance flows into the date-claim validators: ```js if (!ignoreNotBefore) { validators.push({ ..., modifier: -clockTolerance }) // → -Infinity } if (!ignoreExpiration) { validators.push({ ..., modifier: +clockTolerance }) // → Infinity } ``` `src/verifier.js:198-205` — applies modifier additively, producing always-pass comparisons: ```js function validateClaimDateValue(value, modifier, now, greater, errorCode, errorVerb) { const adjusted = value * 1000 + (modifier || 0) // → ±Infinity const valid = greater ? now >= adjusted : now <= adjusted // → always true ... } ``` ## Empirical PoC ```js const { createSigner, createVerifier } = require('fast-jwt') const secret = 'test-secret-with-enough-length-to
osv:GHSA-687g-22h4-j4w4
fast-jwt
Fixed versions: 6.3.0
Complete source record
{
"id": "a301fe5e6afbfbddb59075a75ffcae766f34608e13ac04f07998dbab2a60c939",
"url": "https://osv.dev/vulnerability/GHSA-687g-22h4-j4w4",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "fast-jwt clockTolerance: Infinity silently bypasses both exp and nbf validation (and persists in the verifier cache)",
"summary": "## Summary `createVerifier({ clockTolerance: Infinity })` silently bypasses both `exp` (expiry) AND `nbf` (not-before) validation. Any expired or not-yet-active token is accepted as valid. The same primitive also corrupts the verifier's internal cache so cached entries inherit infinite validity — they remain valid past a later developer-removed Infinity config until LRU eviction. ## Vulnerable code `src/verifier.js:531-533` — option validation only rejects negative values, not Infinity: ```js if (clockTolerance && (typeof clockTolerance !== 'number' || clockTolerance < 0)) { throw new TokenError(TokenError.codes.invalidOption, 'The clockTolerance option must be a positive number.') } ``` `Infinity` passes (it's a number, not less than 0, truthy). `src/verifier.js:583-602` — clockTolerance flows into the date-claim validators: ```js if (!ignoreNotBefore) { validators.push({ ..., modifier: -clockTolerance }) // → -Infinity } if (!ignoreExpiration) { validators.push({ ..., modifier: +clockTolerance }) // → Infinity } ``` `src/verifier.js:198-205` — applies modifier additively, producing always-pass comparisons: ```js function validateClaimDateValue(value, modifier, now, greater, errorCode, errorVerb) { const adjusted = value * 1000 + (modifier || 0) // → ±Infinity const valid = greater ? now >= adjusted : now <= adjusted // → always true ... } ``` ## Empirical PoC ```js const { createSigner, createVerifier } = require('fast-jwt') const secret = 'test-secret-with-enough-length-to",
"evidence": "osv:GHSA-687g-22h4-j4w4",
"products": [
{
"name": {
"value": "fast-jwt",
"evidence": "/affected/0/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "6.3.0",
"evidence": "/affected/0/ranges"
}
],
"affected_versions": []
}
],
"severity": "medium",
"structured": {
"id": "GHSA-687g-22h4-j4w4",
"aliases": [
"CVE-2026-107721",
"GHSA-687g-22h4-j4w4"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:N"
}
],
"affected": [
{
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "0"
},
{
"fixed": "6.3.0"
}
]
}
],
"package": {
"name": "fast-jwt",
"purl": "pkg:npm/fast-jwt",
"ecosystem": "npm"
},
"database_specific": {
"source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-687g-22h4-j4w4/GHSA-687g-22h4-j4w4.json",
"last_known_affected_version_range": "<= 6.2.4"
}
}
],
"modified": "2026-10-08T22:15:05.893519907Z",
"provider": "osv",
"references": [
"https://github.com/nearform/fast-jwt/security/advisories/GHSA-687g-22h4-j4w4",
"https://github.com/nearform/fast-jwt/commit/c0fb5b88b4c88ff2bdd194ca2c713599ad9e38b6",
"https://github.com/nearform/fast-jwt",
"https://github.com/nearform/fast-jwt/releases/tag/v6.3.0"
],
"provider_metadata": {
"cwe_ids": [
"CWE-613",
"CWE-682"
],
"severity": "MODERATE",
"github_reviewed": true,
"nvd_published_at": null,
"github_reviewed_at": "2026-10-08T22:02:02Z"
}
},
"related_cves": [
{
"value": "CVE-2026-107721",
"evidence": "/aliases"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 104808,
"published_at": "2026-10-08T22:02:02+00:00"
}