Categories
CVE-2026-107722 critical CVSS 9.8

Vulnerability in fast-jwt (CVE-2026-107722)

Summary

Vulnerability in fast-jwt (CVE-2026-107722). Successful exploitation can lead to full system takeover. Exploitable via performDetectPublicKeyAlgorithms. Mitigation: upgrade to 6.3.0 or later.

Original description

The description as published by the source.

Summary

The fix for CVE-2026-34950 (CVSS 9.1, released in v6.2.0) is incomplete. It adds key.trim() to the PEM-detection path in src/crypto.js, but String.prototype.trim() only strips characters classified as whitespace by the ECMAScript specification. The subsequent ^-anchored regex (/^-----BEGIN(?: (RSA))? PUBLIC KEY-----/) still requires the PEM header at position 0 — so any non-whitespace leading byte (control chars, zero-width unicode, # comments, HTTP-style headers, PGP wrappers) bypasses detection and falls through to the HMAC verification path, using the RSA public key as the HMAC shared secret. Net result: the exact same RSA→HS256 algorithm-confusion attack the original CVE addressed is fully re-enabled with a slightly different leading byte.

Attack prerequisites are identical to CVE-2026-34950: attacker knows the target's public RSA key (which is public by definition), and the target loads that key from a source whose content may have a non-whitespace prefix (DB column with corrupted encoding, YAML config with inline comment, copy-paste from formatted document, etc.).

Verified on fast-jwt@6.2.2 (latest as of 2026-04-23) with a 10-line PoC.

Details

Post-patch code (src/crypto.js, lines ~74-171 in performDetectPublicKeyAlgorithms):

function performDetectPublicKeyAlgorithms(key) {
    const trimmedKey = key.trim()  // <-- CVE-2026-34950 patch added this
    if (publicKeyPemMatcher.test(trimmedKey)) {
        // tr…

Source: GitHub Security Advisories (Global) NVD GitHub Advisory

Auto-generated summary

Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.

A vulnerability tracked as CVE-2026-107722 has been found in fast-jwt.
Attackers can target a specific entry point like performDetectPublicKeyAlgorithms over the network to misuse the product.
Successful exploitation can lead to full system takeover. CVSS score: 9.8/10.
What to do: upgrade fast-jwt to 6.3.0 or later.
If unsure, ask your IT team or search "fast-jwt CVE-2026-107722" on the vendor's site.

CVE-2026-107722 (fast-jwt) — CWE-347 / CVSS v3 9.8
Attack vector: remote (network-reachable) / unauthenticated / no user interaction
Attack surface: performDetectPublicKeyAlgorithms / key / algorithms
Patched: 6.3.0 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.

❓ What is the problem

A vulnerability (CWE-347) exists in fast-jwt. Attackers reach the vulnerable code path via performDetectPublicKeyAlgorithms without authentication.

📍 Affected scope

Check the vendor advisory for the affected versions of fast-jwt. Attack surface: performDetectPublicKeyAlgorithms / key / algorithms.

🔥 Severity

Severity: Critical (CVSS 9.8/10). Successful exploitation can lead to full system takeover.

🔧 How to fix

Update to 6.3.0.

🛡️ Workaround

Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.

🔍 Detection

Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'fast-jwt' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.

Response actions

Concrete steps and command examples for SOC/SRE teams to execute in order

  1. 1
    Identify exposure identify
    grep -r 'fast-jwt' . | grep -v node_modules

    リポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で fast-jwt を grep し、稼働しているサービス・バージョンを把握する。

  2. 2
    Apply patch patch
    Upgrade fast-jwt to 6.3.0

    ステージング環境で 6.3.0 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。

  3. 3
    Post-deployment verification verify
    Confirm patched version is live in production

    パッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。

Affected packages

npm fast-jwt
[{"type":"SEMVER","events":[{"introduced":"6.2.0"},{"fixed":"6.3.0"}]}]

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details