CVE-2026-107724: fast-jwt Token Forgery via Misclassified JWK JSON

fast-jwt Updated 09 Oct 2026

Summary

08/10/2026
Yes i
High
7.4

CVE-2026-107724: fast-jwt treats raw public JWK JSON as an HMAC secret, enabling HS256 token forgery. Affects fast-jwt versions >= 6.2.4, < 6.3.0. Fixed in 6.3.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 library in the Node.js ecosystem used for creating and verifying JSON Web Tokens (JWTs). It provides a simple interface for handling JWTs, supporting various algorithms for signing and verification. However, a critical vulnerability has been identified in version 6.2.4, where raw public JSON Web Key (JWK) is incorrectly treated as an HMAC secret, leading to potential token forgery.

Vulnerability Detail

The vulnerability arises from the way fast-jwt classifies input keys. In version 6.2.4, raw serialized public JWK JSON is mistakenly classified as an HMAC secret when it does not match PEM public-key formats. This misclassification allows an attacker to forge HS256 tokens using the public JWK as an HMAC key, leading to authentication or authorization bypass. The attacker can create valid tokens with arbitrary claims, which may result in unauthorized access to sensitive data or elevated privileges.

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.3.0

This is the first release that contains the fix.

npm install fast-jwt@6.3.0

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

Workaround

As a temporary workaround, avoid passing raw serialized public JWK or JWKS JSON text as the verifier key. Instead, use PEM-encoded public keys for verification. This can be done by generating a PEM key pair and using the public key in your verification process.

Conclusion

The fast-jwt library has a significant vulnerability that allows for token forgery due to the misclassification of public JWK JSON as HMAC secrets. It is crucial for users of this library to update to the patched version 6.3.0 or later to ensure the security of their applications. Additionally, using PEM-encoded keys can help mitigate risks until the update is applied.

See every vulnerability recorded for fast-jwt →

Share this vulnerability

FAQ

The CVSS score of this vulnerability is 7.4, indicating a high severity level.

The affected version is fast-jwt 6.2.4. Versions 6.3.0 and later have the vulnerability fixed.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Visit Vulert Scanner to check if your application is affected without needing to sign up.

An attacker could forge JWT claims, leading to authentication bypass, unauthorized access, or privilege escalation within the application.

Yes, you can mitigate the risk by avoiding the use of raw public JWK or JWKS JSON as verifier keys and instead using PEM-encoded public keys.

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.3.0

This is the first release that contains the fix.

npm install fast-jwt@6.3.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