Quick answers
- Is CVE-2026-34950 exploited in the wild?
- No. Junglewise Threat Intelligence has no report of CVE-2026-34950 being exploited in the wild.
- How severe is CVE-2026-34950?
- Critical severity, with a CVSS score of 9.1, published 6 April 2026.
- Which products and versions are affected?
- fast-jwt (npm) SEMVER:introduced=0,fixed=6.2.0.
- Is there a fix for CVE-2026-34950?
- Yes. fast-jwt (npm): upgrade to 6.2.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
- How is CVE-2026-34950 attacked?
- It is attacked over the network.
- Am I affected by CVE-2026-34950?
- Check whether you run Nearform Fast-Jwt or fast-jwt (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.
How to fix
- fast-jwt (npm): upgrade to 6.2.0 or later
npm install fast-jwt@6.2.0
Technical details
This is a JWT algorithm confusion vulnerability caused by incomplete input validation in the publicKeyPemMatcher regex. The root cause is inconsistency: the private key detection path calls .trim() on the input before regex matching, but the public key detection path does not. When an RSA public key string has leading whitespace, the regex anchor (^) fails to match the "-----BEGIN" marker, causing the library to misclassify the RSA public key as an HMAC secret. An attacker with access to the public key can then forge HS256 tokens using the public key as the HMAC secret, bypassing authentication. The attack requires network access to a vulnerable endpoint; no user interaction or prior authentication is needed. Leading whitespace in PEM keys is common in real-world deployments (database text columns, YAML multiline strings, environment variables, copy-paste). The vulnerability was patched in version 6.2.0 by adding .trim() to the public key matching path.
Affected products
- NearForm fast-jwt <= 6.1.0
Identifiers
- CVE-2026-34950
- GHSA-mvf2-f6gm-w987
Timeline
- 2026-04-02: advisory
- 2026-04-02: patched: patched in version 6.2.0