Skip to main content

fast-jwt EUVDEUVD-2026-95347

| CVE-2026-107722 CRITICAL
Improper Verification of Cryptographic Signature (CWE-347)
2026-10-08 GitHub_M GHSA-ww5h-9m49-7xx4
9.8
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

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

  1. Access
    Obtain target's public RSA key bytes
  2. Delivery
    Confirm verifier loads key with non-whitespace prefix and allows HS256
  3. Exploit
    Forge HS256 JWT using public key as HMAC secret
  4. Execution
    Submit forged token to verifier
  5. Impact
    Bypass authentication/authorization

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A04:2025 - Cryptographic Failures
ASVS 5.0
V11 - Cryptography Signature verification
Exploitation Conditions

Exploitation requires BOTH: (1) the fast-jwt verifier loads the RSA/EC public key from a source that left non-whitespace content before the '-----BEGIN PUBLIC KEY-----' header - e.g., a '#' or '//' comment line, an HTTP-style header, a PGP/wrapper prefix, or control/zero-width Unicode (NUL, ESC, U+200B zero-width space, U+200D ZWJ, U+FEFF) introduced via DB encoding corruption, YAML inline comments, or copy-paste from formatted documents; and (2) HS256 is inferred or allowed by the verifier. The attacker must also know the target's public key, which is public by definition. The attack is fully PREVENTED by configuring an asymmetric-only algorithm allowlist (so HS256 is never accepted), and clean PEM keys with no leading bytes are not misclassified - these limiting factors mean the default-with-clean-key case is not exploitable despite the AV:N/PR:N CVSS metrics.

Impact

The input CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N/C:H/I:H/A:H = 9.8 Critical) presents this as a trivially exploitable remote unauthenticated flaw, but that score overstates real-world exploitability because it ignores two hard preconditions visible in the description and GHSA advisory: the verifier must (a) load the RSA public key from a source that introduced a non-whitespace leading byte, and (b) infer or allow HS256 with no asymmetric-only algorithm allowlist. These are non-default conditions, so AC:L is optimistic - AC:H is more faithful. No EPSS score was provided in the input, and the CVE is NOT on CISA KEV, so there is no evidence of active exploitation; however, a verified 10-line PoC and a full fix PR with regression tests are public, meaning publicly available exploit code exists and the technique (RSA→HS256 algorithm confusion, CWE-347) is well-understood and reliable where the preconditions hold. This is the incomplete-fix successor to CVE-2026-34950 / CVE-2023-48223, a lineage that raises the likelihood of opportunistic testing against known fast-jwt deployments. Net: a genuine high-priority patch item for anyone running fast-jwt 6.2.0-6.2.4 who does not pin an asymmetric algorithm allowlist, but the conditional nature means it is not a blanket internet-wide auto-exploitable 9.8 against every default install.

Exploit ScenarioDerived

A service uses fast-jwt (6.2.0-6.2.4) to verify RSA-signed JWTs but loads its public key from a store that prepends non-whitespace content (e.g., a YAML inline comment, a corrupted DB column, or copy-pasted text with a zero-width character). An attacker who knows the public key (public by definition) forges an HS256 token using the public-key bytes as the HMAC secret; because the PEM header is no longer at position 0, fast-jwt misclassifies the key as an HMAC secret and accepts the forged token, bypassing authentication. A verified public PoC exists demonstrating this with the latest affected release.

Act Now Prioritize within 24-48h. Why: CRITICAL severity + public POC available.
1 public PoC Patch available 0.3% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – Oct 08, 2026

Authentication and authorization bypass in fast-jwt 6.2.0 through 6.2.4 (npm, NearForm) lets a remote, unauthenticated attacker forge valid HS256 JWTs using the service's own RSA public key, because non-whitespace bytes ahead of the PEM header cause the library to misclassify the public key as an HMAC shared secret. Exploitation is not trivial and depends on two preconditions being met at once: the verifier must load the asymmetric key from a source that left content such as a '#' or '//' comment line, an HTTP-style header, a PGP/text wrapper, or control or zero-width Unicode (NUL, ESC, U+200B, U+200D, U+FEFF) before '-----BEGIN PUBLIC KEY-----', and the verifier must infer or allow HS256 rather than enforcing an asymmetric-only algorithm allowlist; clean PEM keys and asymmetric-only configurations are not affected. Publicly available exploit code exists (a working PoC is included in the vendor GHSA advisory), no CISA KEV listing or active exploitation is indicated, and the supplied 9.8 CVSS overstates real-world exploitability - the independently assessed vector is AV:N/AC:H/PR:N/UI:N with no availability impact, consistent with the two hard preconditions above.

RemediationAI

Upgrade to fast-jwt 6.3.0 or later (npm install fast-jwt@6.3.0), the vendor-released fix, per the advisory https://github.com/nearform/fast-jwt/security/advisories/GHSA-ww5h-9m49-7xx4, PR https://github.com/nearform/fast-jwt/pull/632, commit https://github.com/nearform/fast-jwt/commit/d96bbc6c5336055a6dbfa318fdbab01197264cfa, and release https://github.com/nearform/fast-jwt/releases/tag/v6.3.0. Before upgrading, note the behavioral change: 6.3.0 raises TokenError (invalidKey) for unrecognized or unsupported PEM headers instead of silently treating them as raw HMAC secrets, so key-loading paths that previously accepted stray or wrapper-prefixed PEM text as a 'secret' will now be rejected - audit and clean those inputs. The strongest compensating control, which fully prevents the attack even on unpatched 6.2.x, is to configure an asymmetric-only algorithm allowlist on the verifier (e.g. algorithms: ['RS256'], or the single exact algorithm expected), since HS256 is then never accepted regardless of how the key is classified; the trade-off is that any service that genuinely also needs HMAC-verified tokens must instantiate a separate verifier with its own policy. In addition, normalize key material at load time by stripping everything before the first '-----BEGIN ...-----' header (equivalent to the 6.3.0 locatePem logic) and rejecting keys that contain a PEM header but no recognized one, rather than allowing them to reach an HMAC fallback, and fix the upstream source of the dirty bytes (DB encoding corruption, YAML inline comments, copy-paste, HTTP/PGP wrappers). Because the attacker only needs the public key, treat public keys as non-secret and monitor for HS256 tokens presented to endpoints that should only accept asymmetric algorithms.

Affected VersionsENISA

fast-jwt 6.2.0, < 6.3.0

Affected Packages

npm fast-jwt fix: 6.3.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 a Node.js JSON Web Token library (npm, maintained by NearForm) that auto-detects the signing algorithm from the key material passed to createVerifier/createDecoder. In the affected path, performDetectPublicKeyAlgorithms() in src/crypto.js applies key.trim() and then tests the result against the start-anchored matcher publicKeyPemMatcher = /^-----BEGIN(?: (RSA))? PUBLIC KEY-----/. Because String.prototype.trim() removes only characters the ECMAScript spec classifies as whitespace (U+0009-U+000D, U+0020, U+00A0, U+1680, U+2000-U+200A, U+2028, U+2029, U+202F, U+205F, U+3000, U+FEFF), any other leading byte keeps the PEM header off position 0, the anchored matcher fails, and execution falls through to the HMAC branch where the full key string - including public-key bytes the attacker already knows - is used as the HS256 secret. This is CWE-347 (Improper Verification of Cryptographic Signature), the same root-cause class as CVE-2023-48223 and CVE-2026-34950: the v6.2.0 fix for CVE-2026-34950 added trim() but narrowed only the whitespace case instead of addressing the class, which the vendor explicitly frames as an incomplete-fix lineage. The 6.3.0 fix introduces an unanchored pemBeginMatcher (/-----BEGIN [A-Z0-9 ]+?-----/) and a shared locatePem() helper that slices the key from its first PEM header and classifies by that header so the private- and public-key detectors can no longer drift apart; it also throws TokenError(codes.invalidKey, 'Unsupported PEM ...') for unrecognized PEM headers rather than silently treating them as raw HMAC secrets. The input CVSS 3.1 vector (9.8, AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) assumes the worst case; the assessed vector is AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N because both a dirty key source and an HS256-permissive verifier are required.

Know when Jwt Attack gets its next vulnerability

  • 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 (GitHub_M) PRIMARY 9.8 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
vuln.today AI 7.4 HIGH

Remote and unauthenticated (AV:N/PR:N), but requires a non-default key-prefix condition plus HS256 allowed, so AC:H; signature forgery yields auth/authz bypass (C:H/I:H) with no direct availability impact (A:N).

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
4.0 AV:N/AC:H/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

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

Lifecycle Timeline

2
Patch available
Oct 08, 2026 - 23:02 EUVD
CVE Published
Oct 08, 2026 - 21:49 cve.org
CRITICAL 9.8

DescriptionCVE.org

fast-jwt provides fast JSON Web Token (JWT) implementation. From 6.2.0 until 6.3.0, fast-jwt can misclassify RSA public-key text as an HMAC secret when the key has non-whitespace content before its PEM header. In src/crypto.js, performDetectPublicKeyAlgorithms trims whitespace but publicKeyPemMatcher remains start-anchored, so comments, control characters, zero-width characters, or wrapper text can prevent PEM detection and reach the HMAC fallback. An attacker who knows the public key bytes can sign arbitrary HS256 claims with that public material when HS256 is inferred or allowed, resulting in authentication or authorization bypass. An asymmetric-only algorithm allowlist prevents the attack. This issue is fixed in version 6.3.0.

Technical POC Analysis

Bug class: CWE-347, Improper Verification of Cryptographic Signature.

Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.

Latest POC

1 public PoC link from github

Sign in to open the public PoC links collected for this CVE.

Executive ViewAI

Why It Matters

Organizations using the npm fast-jwt library versions 6.2.0 through 6.2.4 face a critical authentication weakness that can let attackers forge valid tokens and bypass access controls in affected applications. Because no vendor-released patch is identified at time of analysis and publicly available exploit code exists, leadership should treat any exposed service using these versions as high risk and prioritize inventory plus compensating controls. The issue is most dangerous for applications that load public keys from imperfect sources and allow HS256, so remediation depends on both configuration hardening and future patching.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis; enforce asymmetric-only algorithm allowlists (e.g., RS256/PS256/ES256), reject HS256 in verifiers using RSA public keys, sanitize and validate PEM keys by stripping/rejecting any non-PEM bytes before '-----BEGIN PUBLIC KEY-----' including comment lines, HTTP-style headers, PGP/text wrappers, and control/zero-width Unicode (NUL, ESC, U+200B, U+200D, U+FEFF), load keys only from clean trusted sources, rotate keys and invalidate sessions if vulnerable configurations were exposed, and monitor for anomalous JWT acceptance.

Threat Intelligence Overview

EPSS Score
0.3%
Top 82% exploitable
Prevalence
Medium
popular Node.js/npm JWT library, moderate but not universal deployment
Threat Intel
1
1 source
Social Media
2
Sightings
Data Quality
6 sources
Confidence: High

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 Yes
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity + public POC available
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· derived
Scheduled
Exploitation· derived
Poc
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
High

Priority Score

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

Attack Technique

Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.

CVE-2013-3900 MEDIUM
5.5 Dec 11

Why is Microsoft republishing a CVE from 2013? We are republishing CVE-2013-3900 in the Security Update Guide to update

CVE-2026-48558 CRITICAL POC
9.5 Jun 12

Authentication bypass in SimpleHelp 5.5.15 and prior (plus 6.0 pre-release builds) allows remote unauthenticated attacke

CVE-2026-5430 CRITICAL POC
10.0 Aug 06

Authentication bypass in WSO2 API Manager and related components (Universal Gateway, Traffic Manager, API Control Plane,

CVE-2025-59718 CRITICAL
9.8 Dec 09

Authentication bypass in Fortinet FortiOS, FortiProxy, and FortiSwitchManager allows unauthenticated remote attackers to

CVE-2025-25291 CRITICAL POC
9.3 Mar 12

ruby-saml provides security assertion markup language (SAML) single sign-on (SSO) for Ruby. Rated critical severity (CVS

CVE-2025-25292 CRITICAL POC
9.3 Mar 12

ruby-saml provides security assertion markup language (SAML) single sign-on (SSO) for Ruby. Rated critical severity (CVS

CVE-2022-25898 CRITICAL POC
9.8 Jul 01

The package jsrsasign before 10.5.25 are vulnerable to Improper Verification of Cryptographic Signature when JWS or JWT

CVE-2024-42004 CRITICAL POC
9.8 Dec 18

A library injection vulnerability exists in Microsoft Teams (work or school) 24046.2813.2770.1094 for macOS. Rated criti

CVE-2024-41145 CRITICAL POC
9.8 Dec 18

A library injection vulnerability exists in the WebView.app helper app of Microsoft Teams (work or school) 24046.2813.27

CVE-2024-41138 CRITICAL POC
9.8 Dec 18

A library injection vulnerability exists in the com.microsoft.teams2.modulehost.app helper app of Microsoft Teams (work

CVE-2024-45409 CRITICAL POC
9.8 Sep 10

The Ruby SAML library is for implementing the client side of a SAML authorization. Rated critical severity (CVSS 9.8), t

CVE-2022-35929 CRITICAL POC
9.8 Aug 04

cosign is a container signing and verification utility. Rated critical severity (CVSS 9.8), this vulnerability is remote

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