CVE-2026-35039: fast-jwt Cache Confusion Vulnerability Leading to Identity and Authorization Issues

fast-jwt Updated 03 Apr 2026

Summary

03/04/2026
Yes i
Critical
9.1

CVE-2026-35039: Impact Setting up a custom cacheKeyBuilder method which does not properly create unique keys for different tokens can lead to cache collisions. Affects fast-jwt versions >= 0.0.1, < 6.1.0. Fixed in 6.1.0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

fast-jwt is a popular JavaScript library used for creating and verifying JSON Web Tokens (JWTs). It provides a simple and efficient way to handle authentication and authorization in web applications. However, its caching mechanism can be exploited if not configured correctly, leading to serious security vulnerabilities.

Vulnerability Detail

The vulnerability arises from the improper implementation of the cacheKeyBuilder function, which can produce non-unique keys for different tokens. This can lead to cache collisions, where valid tokens return claims from other tokens, resulting in user impersonation, privilege escalation, cross-tenant data access, and authorization bypass. The issue is particularly critical for applications that enable caching and use custom cacheKeyBuilder functions that can generate identical keys for different users or tokens.

How To Fix

Latest published version: 6.3.5 as of 22 Oct 2026

npm install fast-jwt@6.3.5

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

6.1.0

This is the first release that contains the fix.

npm install fast-jwt@6.1.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If you cannot update the package immediately, consider removing the custom cacheKeyBuilder function or disabling caching altogether. Here are some examples of safe cacheKeyBuilder implementations:

// 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 });

Conclusion

The fast-jwt package has a critical vulnerability (CVE-2026-35039) that can lead to severe security issues due to improper caching mechanisms. It is essential to update to the patched version or implement workarounds to ensure the security of your application.

See every vulnerability recorded for fast-jwt →

Share this vulnerability

FAQ

The CVSS score of this vulnerability is 9.1, indicating a critical level of severity.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.

The consequences include user impersonation, privilege escalation, cross-tenant data access, and authorization bypass, which can severely compromise application security.

Yes, the vulnerability is fixed in version 6.1.0 of the fast-jwt package. It is recommended to update to this version or later.

If you cannot update, consider removing the custom cacheKeyBuilder function or disabling caching to mitigate the risk.

Related vulnerabilities

Recent vulnerabilities recorded for fast-jwt.

How To Fix

Latest published version: 6.3.5 as of 22 Oct 2026

npm install fast-jwt@6.3.5

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

6.1.0

This is the first release that contains the fix.

npm install fast-jwt@6.1.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback