Critical · 9.8 Node.js & npm GHSA-ww5h-9m49-7xx4 CVE-2026-107722 GHSA-5hjw-83fp-phq9 CVE-2026-107723
Four fast-jwt Vulnerabilities Allow JWT Signature and Claim-Validation Bypass
Four related vulnerabilities in the fast-jwt npm package allow attackers to forge or bypass JWT verification under specific configurations, including an incomplete patch of a prior algorithm-confusion issue. Updating to the fixed versions resolves all four.
By PatchBriefing ·
Produced automatically from official sources with the help of AI. How we work →
- OSV.dev database 1mo ago · view ↗
- NVD (NIST) database 1mo ago · view ↗
- OSV.dev database 1mo ago · view ↗
- NVD (NIST) database 1mo ago · view ↗
- OSV.dev database 1mo ago · view ↗
- NVD (NIST) database 1mo ago · view ↗
- OSV.dev database 1mo ago · view ↗
- NVD (NIST) database 1mo ago · view ↗
- CVE.org database 1mo ago · view ↗
- CVE.org database 1mo ago · view ↗
- CVE.org database 1mo ago · view ↗
AI summary
Four vulnerabilities have been disclosed in fast-jwt, a JSON Web Token (JWT) implementation for Node.js maintained by nearform. All four affect how createVerifier validates tokens and, under specific configuration conditions, allow an attacker to forge valid-looking tokens or bypass claim checks such as expiry, issuer, or audience validation. Fixes for all four issues are available in fast-jwt version 6.3.0 or 6.3.1, depending on the specific issue.
What happened
Four distinct but related vulnerabilities were disclosed in fast-jwt on 2026-10-08. CVE-2026-107722 is an incomplete patch of an earlier algorithm-confusion issue: fast-jwt can still misclassify RSA public-key text as an HMAC secret if the key has non-whitespace content (such as comments, control characters, or zero-width characters) before its PEM header, because the detection logic trims whitespace but the PEM matcher remains start-anchored. CVE-2026-107724 is a related variant in version 6.2.4 where fast-jwt can treat raw serialized public JWK or JWKS JSON as an HMAC secret. CVE-2026-107723 concerns createVerifier accepting a validly signed JWT whose payload is a JSON array rather than an object; because the claim-validator loop looks for named properties, it silently skips checks for expiry, issuer, audience, subject, token ID, and nonce when the payload is an array. CVE-2026-107720 describes createVerifier accepting an unsigned JWT when the verification key is an empty string or null while an algorithm allowlist is explicitly set, allowing a token with arbitrary claims to pass verification without a valid signature.
Technical cause
In CVE-2026-107722, the function performDetectPublicKeyAlgorithms in src/crypto.js trims whitespace before checking a key, but the publicKeyPemMatcher regular expression remains start-anchored, so any non-whitespace prefix before the PEM header prevents correct detection and causes the key to fall through to the HMAC code path. CVE-2026-107724 has the same root function treating non-PEM JSON strings (raw public JWK/JWKS data) as symmetric key material. CVE-2026-107723 stems from src/decoder.js checking only that a payload is an object without rejecting arrays; the subsequent claim-validator loop depends on named properties (exp, nbf, iss, aud, sub, jti, nonce) that simply do not exist on an array, so those checks are silently skipped rather than failed. CVE-2026-107720 arises because falsy synchronous keys (empty string or null) bypass the prepareKeyOrSecret logic; the allowedAlgorithms check remains active and hasKey is false, but the empty signature on the token avoids the verifySignature gate entirely.
Why it matters
All four issues affect authentication or authorization decisions based on JWTs. CVE-2026-107722 and CVE-2026-107724 allow an attacker who knows the bytes of a public key (which is, by definition, not secret) to sign arbitrary HS256 claims using those bytes as if they were an HMAC secret, provided HS256 is inferred or permitted by the verifier configuration. CVE-2026-107723 allows an attacker who can produce or influence a validly signed token to bypass expiry, issuer, audience, subject, revocation, or replay protections carried in standard claims, because those checks are silently skipped rather than enforced, when the application has not enabled the opt-in requiredClaims option. CVE-2026-107720 allows an attacker to submit a token with arbitrary claims and no valid signature at all, bypassing authentication entirely, in deployments where the synchronous key is empty or null and an algorithm allowlist is explicitly configured.
Who is affected
Applications using fast-jwt to verify JWTs are affected depending on configuration. CVE-2026-107722 affects configurations where HS256 is inferred or explicitly allowed alongside RSA keys; an asymmetric-only algorithm allowlist prevents the attack. CVE-2026-107724 affects version 6.2.4 specifically, under similar conditions involving raw JWK/JWKS serialization used as an HMAC secret; applications using supported PEM keys with an asymmetric-only allowlist are not affected. CVE-2026-107723 affects any application relying on fast-jwt's automatic claim validation (exp, nbf, iss, aud, sub, jti, nonce) without enabling the opt-in requiredClaims option; signature verification itself is not bypassed in this case. CVE-2026-107720 affects deployments that use a synchronous verification key set to an empty string or null together with an explicitly configured algorithm allowlist; non-empty keys, an empty key without an algorithm allowlist, and the asynchronous key-resolver path are not affected.
Affected versions and fixes
CVE-2026-107722 affects fast-jwt from version 6.2.0 up to but not including 6.3.0; it is fixed in 6.3.0. CVE-2026-107724 affects version 6.2.4; it is fixed in 6.3.0. CVE-2026-107723 affects fast-jwt prior to 6.3.0; it is fixed in 6.3.0. CVE-2026-107720 affects fast-jwt prior to 6.3.1; it is fixed in 6.3.1.
Recommended action
Update fast-jwt to version 6.3.1, which includes fixes for all four issues described here (6.3.0 resolves the three algorithm-confusion and claim-validation issues, 6.3.1 additionally resolves the empty/null key bypass). In addition, review verifier configuration: use an asymmetric-only algorithm allowlist where RSA/EC keys are used, avoid relying solely on inferred algorithms, ensure verification keys are never empty strings or null in synchronous configurations, and consider enabling the opt-in requiredClaims option to enforce presence of standard claims regardless of payload structure.
PatchBriefing score
9.8 / 10 · Critical
Official CVSS: 9.8
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS 0.0051 (36 percentile)
Why this score
The PatchBriefing score equals the official CVSS score; when this article covers several vulnerabilities, the highest one. Signals such as known exploitation and EPSS are listed separately and do not change the score.
Affected versions
- fast-jwt ≥ 6.2.0 < 6.3.0
- vulnerable
- ≥ 6.3.0
- patched
- fast-jwt ≥ 0 < 6.3.0
- vulnerable
- ≥ 6.3.0
- patched
- fast-jwt ≥ 0 < 6.3.1
- vulnerable
- ≥ 6.3.1
- patched
- fast-jwt ≥ 6.2.4 < 6.3.0
- vulnerable
- fast-jwt
- vulnerable
- ≥ 6.3.0
- patched
Reported fixes
Update fast-jwt to version 6.3.1, which includes fixes for all four issues described here (6.3.0 resolves the three algorithm-confusion and claim-validation issues, 6.3.1 additionally resolves the empty/null key bypass). In addition, review verifier configuration: use an asymmetric-only algorithm allowlist where RSA/EC keys are used, avoid relying solely on inferred algorithms, ensure verification keys are never empty strings or null in synchronous configurations, and consider enabling the opt-in requiredClaims option to enforce presence of standard claims regardless of payload structure.
How this was built
11 source records were collected, matched and used to prepare the report above.
-
OSV.dev database
-
NVD (NIST) database
-
OSV.dev database
-
NVD (NIST) database
-
OSV.dev database
-
NVD (NIST) database
Revision history
- Generated
- Generated
- Generated
- Published
- Generated