Skip to main content

CVE-2026-35039

CRITICAL
Insufficient Verification of Data Authenticity (CWE-345)
2026-04-03 https://github.com/nearform/fast-jwt GHSA-rp9m-7r4c-75qg
9.1
CVSS 3.1 · Vendor: https://github.com/nearform/fast-jwt
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Deploy application with weak cacheKeyBuilder
  2. Delivery
    Submit authentication requests with different tokens
  3. Exploit
    Trigger cache collision in token verification
  4. Execution
    Extract claims from mismatched cached token
  5. Impact
    Assume identity of different user

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A08:2025 - Software or Data Integrity Failures
ASVS 5.0
V15 - Secure Coding and Architecture Data authenticity verification
Exploitation Conditions

Requires custom cacheKeyBuilder implementation that fails to generate unique keys per token. Attacker needs network access to submit tokens that collide in cache. No authentication or user interaction required. Affects applications using vulnerable token caching logic.

Impact

Real-world risk is HIGH for affected configurations but LIMITED in scope. The CVSS 9.1 (Critical) rating reflects severe potential impact: network-accessible (AV:N), low complexity (AC:L), no privileges required (PR:N), with high confidentiality and integrity impact. However, exploitation requires a very specific configuration-both caching enabled AND a poorly designed custom cacheKeyBuilder-making this a developer-introduced vulnerability rather than a default-state flaw. The GitHub advisory confirms patch availability, reducing remediation friction. No KEV listing or public exploit code exists, suggesting exploitation has not occurred at scale, but the technical simplicity (AC:L) means any affected application could be exploited trivially once identified. SSVC assessment: exploitation status is none confirmed, technical impact is total (user impersonation/privilege escalation), automatable is yes (once vulnerable config identified). Priority depends on deployment prevalence-organizations should audit fast-jwt usage immediately, but the subset of truly vulnerable deployments is likely small given the requirement for custom, flawed cacheKeyBuilder implementations.

Exploit ScenarioDerived

An attacker authenticates as a low-privilege user and obtains a valid JWT from the application's identity provider. The application uses fast-jwt with a custom cacheKeyBuilder that groups tokens by audience type (admin-users vs regular-users). When an administrator authenticates and their high-privilege token is verified and cached under the 'admin-users' key, the attacker presents their own token with the same audience value. The flawed cacheKeyBuilder produces an identical cache key, causing fast-jwt to return the cached admin token's claims instead of verifying the attacker's actual token. The application now processes the attacker's request with administrator identity and permissions, enabling privilege escalation, cross-tenant data access, or complete authorization bypass. No public exploit code exists, but exploitation requires only presenting tokens that trigger cache key collisions, which is trivial given the low attack complexity.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Apr 03, 2026

Cache key collisions in fast-jwt's custom cacheKeyBuilder implementations enable token confusion attacks, allowing remote attackers to impersonate users and escalate privileges without authentication. The vulnerability affects Node.js applications using fast-jwt with both caching enabled AND custom cache key builder functions that generate non-unique keys. No public exploit identified at time of analysis, though EPSS data unavailable and exploitation likelihood is high given the network-accessible attack vector (AV:N) and low complexity (AC:L). Applications using default caching behavior are NOT affected.

RemediationAI

Vendor-released patch available per GitHub advisory at https://github.com/nearform/fast-jwt/security/advisories/GHSA-rp9m-7r4c-75qg, though specific patched version number is not provided in available data. Immediate mitigation options include: remove custom cacheKeyBuilder implementations and rely on the secure default hash-based key generation; if custom builder is required, ensure uniqueness by including token-specific identifiers such as subject (sub), audience (aud), and issued-at timestamp (iat) in the cache key formula; disable caching entirely by setting cache to false in verifier configuration. Organizations should audit all fast-jwt deployments by searching codebases for cacheKeyBuilder function definitions and analyzing whether returned keys guarantee uniqueness across all possible token combinations. The advisory provides code examples distinguishing vulnerable patterns (grouping by audience or user type) from safe implementations (including sub, aud, and iat). Upgrade to patched version once available and verify configuration follows secure caching practices per advisory guidance.

Affected Packages

npm fast-jwt fix: 6.2.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in npm

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Fast-jwt is an NPM package (pkg:npm/fast-jwt) providing JSON Web Token verification for Node.js applications. The vulnerability stems from CWE-345 (Insufficient Verification of Data Authenticity) in the token caching mechanism. When developers implement custom cacheKeyBuilder functions, the library uses the returned string as a cache lookup key for verified token data. If the key-building logic groups multiple distinct tokens under the same cache key-such as by audience alone rather than including unique identifiers like subject (sub) or issued-at (iat)-the cache returns cached claims from a different token. This breaks the fundamental security assumption that verified token data corresponds to the presented JWT, leading to identity confusion at the application layer. The default implementation uses a secure hash of the full token, making it collision-resistant, but the library permits developer override without validating uniqueness guarantees.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/nearform/fast-jwt) PRIMARY 9.1 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N

Primary rating from Vendor (https://github.com/nearform/fast-jwt) · only source for this CVE.

CVSS VectorVendor: https://github.com/nearform/fast-jwt

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
None

Lifecycle Timeline

2
Patch released
Apr 03, 2026 - 08:30 nvd
Patch available
CVE Published
Apr 03, 2026 - 04:07 nvd
CRITICAL 9.1

DescriptionCVE.org

Impact

Setting up a custom cacheKeyBuilder method which does not properly create unique keys for different tokens can lead to cache collisions. This could cause tokens to be mis-identified during the verification process leading to:

  • Valid tokens returning claims from different valid tokens
  • Users being mis-identified as other users based on the wrong token

This could result in:

  • User impersonation - UserB receives UserA's identity and permissions
  • Privilege escalation - Low-privilege users inherit admin-level access
  • Cross-tenant data access - Users gain access to other tenants' resources
  • Authorization bypass - Security decisions made on wrong user identity

Affected Configurations

This vulnerability ONLY affects applications that BOTH:

  1. Enable caching using the cache option
  2. Use custom cacheKeyBuilder functions that can produce collisions

VULNERABLE examples:

// Collision-prone: same audience = same cache key
cacheKeyBuilder: (token) => {
  const { aud } = parseToken(token)
  return `aud=${aud}`
}

// Collision-prone: grouping by user type
cacheKeyBuilder: (token) => {
  const { aud } = parseToken(token)
  return aud.includes('admin') ? 'admin-users' : 'regular-users'
}

// Collision-prone: tenant + service grouping
cacheKeyBuilder: (token) => {
  const { iss, aud } = parseToken(token)
  return `${iss}-${aud}`
}

SAFE examples:

// Default hash-based (recommended)
createVerifier({ cache: true })  // Uses secure default

// Include unique user identifier
cacheKeyBuilder: (token) => {
  const { sub, aud, iat } = parseToken(token)
  return `${sub}-${aud}-${iat}`
}

// No caching (always safe)
createVerifier({ cache: false })

Not Affected

  • Applications using default caching
  • Applications with caching disabled

Assessment Guide

To determine if a consumer application is affected:

  1. Check if caching is enabled: Look for cache: true or cache: <number> in verifier configuration
  2. Check for custom cache key builders: Look for cacheKeyBuilder function in configuration
  3. Analyze collision potential: Review if the application's cacheKeyBuilder can produce identical keys for different users/tokens
  4. If no custom cacheKeyBuilder: The project is NOT affected (default is safe)

Mitigations

While fast-jwt will look to include a fix for this in the next version, immediate mitigations include:

  • Ensure uniqueness of keys produced in cacheKeyBuilder
  • Remove custom cacheKeyBuilder method
  • Disable caching

Executive ViewAI

Why It Matters

CVE-2026-35039 affects Node.js applications using fast-jwt library with custom cache key builders, enabling attackers to forge authentication tokens and assume arbitrary user identities without credentials. Organizations running fast-jwt with non-default caching configurations face immediate risk of account takeover and privilege escalation; this requires urgent identification and patching of affected deployments.

Business Impact: Severe
Compensating Controls

Apply vendor patch. If patch deployment delayed: disable custom cacheKeyBuilder implementations and revert to default caching behavior; implement strict token expiration (short TTL); deploy additional authentication validation layer independent of cached tokens; monitor for anomalous authentication patterns and privilege escalation attempts.

Threat Intelligence Overview

EPSS Score
0.0%
Top 94% exploitable
Threat Intel
1
1 source
Data Quality
5 sources
Confidence: Medium
NVD CVE.org EPSS Vulnrichment GHSA GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Out-of-Cycle
Exploitation
None
System Exposure· derived
Open
Automatable
Yes
Human Impact
Very High
Technical Impact
Total

Priority Score

46
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +46
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Privilege escalation occurs when an attacker leverages flaws in access control mechanisms to gain permissions beyond what they were originally granted.

Affected Products (CPE)CVE.org

pkg:npm/fast-jwt

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy