Description
fast-jwt provides fast JSON Web Token (JWT) implementation. In 6.1.0 and earlier, the publicKeyPemMatcher regex in fast-jwt/src/crypto.js uses a ^ anchor that is defeated by any leading whitespace in the key string, re-enabling the exact same JWT algorithm confusion attack that CVE-2023-48223 patched.
Published: 2026-04-06
Score: 9.1 Critical
EPSS: n/a
KEV: No
Impact: JWT Algorithm Confusion – Unauthorized Token Forgery
Action: Apply Patch
AI Analysis

Impact

The vulnerability arises from an incomplete patch of a prior JWT algorithm confusion flaw. In fast‑jwt versions 6.1.0 and earlier, the public key matching regular expression incorrectly accepts a key string that begins with whitespace, causing the regex to fail at the start anchor. This re‑enables the ability to manipulate the algorithm field of a JWT and trick the library into verifying a forged token. The flaw is categorized as CWE‑327, representing the misuse of cryptographic algorithms. If exploited, an attacker could generate valid‑looking tokens that grant unauthorized access to protected resources, undermining confidentiality and integrity of the service.

Affected Systems

The affected product is the nearform fast‑jwt library. Versions 6.1.0 and any earlier releases contain the flaw; newer releases are not affected. This applies to all applications that depend on fast‑jwt for JWT verification, especially those using RSA public key verification.

Risk and Exploitability

With a CVSS score of 9.1, the vulnerability is considered critical. While an EPSS score is not available, the high severity rating indicates a significant risk if the flaw is present. The attack likely occurs remotely by supplying a crafted JWT with a whitespace‑prefixed RSA public key to services that use fast‑jwt, allowing token forgery. The vulnerability does not appear in the CISA Known Exploited Vulnerabilities catalog, but the lack of a patch in older versions makes it a high‑risk issue for systems still running 6.1.0 or earlier.

Generated by OpenCVE AI on April 6, 2026 at 19:39 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade fast‑jwt to the latest stable release where the regex has been corrected.
  • In environments where an immediate upgrade is not possible, ensure that any JWT key strings are trimmed of leading whitespace before being passed to the library.

Generated by OpenCVE AI on April 6, 2026 at 19:39 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-mvf2-f6gm-w987 fast-jwt: Incomplete fix for CVE-2023-48223: JWT Algorithm Confusion via Whitespace-Prefixed RSA Public Key
History

Tue, 07 Apr 2026 00:00:00 +0000

Type Values Removed Values Added
First Time appeared Nearform
Nearform fast-jwt
Vendors & Products Nearform
Nearform fast-jwt

Mon, 06 Apr 2026 20:00:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Mon, 06 Apr 2026 16:45:00 +0000

Type Values Removed Values Added
Description fast-jwt provides fast JSON Web Token (JWT) implementation. In 6.1.0 and earlier, the publicKeyPemMatcher regex in fast-jwt/src/crypto.js uses a ^ anchor that is defeated by any leading whitespace in the key string, re-enabling the exact same JWT algorithm confusion attack that CVE-2023-48223 patched.
Title fast-jwt has an incomplete fix for CVE-2023-48223: JWT Algorithm Confusion via Whitespace-Prefixed RSA Public Key
Weaknesses CWE-327
References
Metrics cvssV3_1

{'score': 9.1, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N'}


Subscriptions

Nearform Fast-jwt
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-04-06T18:43:16.088Z

Reserved: 2026-03-31T17:27:08.661Z

Link: CVE-2026-34950

cve-icon Vulnrichment

Updated: 2026-04-06T18:43:12.442Z

cve-icon NVD

Status : Received

Published: 2026-04-06T16:16:38.017

Modified: 2026-04-06T16:16:38.017

Link: CVE-2026-34950

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-04-06T21:31:48Z

Weaknesses