Skip to main content
Vulnerability Database/CVE-2026-107720

CVE-2026-107720: fast-jwt Authentication Bypass Vulnerability

CVE-2026-107720 is an authentication bypass flaw in fast-jwt that allows attackers to submit tokens with arbitrary claims without a signing key. This post explains its impact, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-107720 Overview

CVE-2026-107720 is an authentication bypass vulnerability in the fast-jwt library, a widely used fast JSON Web Token (JWT) implementation for Node.js. Versions prior to 6.3.1 allow the createVerifier function to accept unsigned JWTs when the key is an empty string or null and the algorithms option is a non-empty allowlist. The flaw lets attackers forge tokens containing arbitrary claims without possessing any signing key, resulting in authentication or authorization bypass in applications relying on fast-jwt for session validation. The issue is tracked under [CWE-20] Improper Input Validation and fixed in fast-jwt version 6.3.1.

Critical Impact

Attackers can submit forged JWTs with arbitrary claims and bypass authentication checks in applications using vulnerable fast-jwt configurations.

Affected Products

  • fast-jwt versions prior to 6.3.1
  • Node.js applications using createVerifier with a falsy synchronous key and non-empty algorithms allowlist
  • Downstream services relying on fast-jwt for JWT-based authentication or authorization

Discovery Timeline

  • 2026-10-08 - CVE-2026-107720 published to NVD
  • 2026-10-09 - Last updated in NVD database

Technical Details for CVE-2026-107720

Vulnerability Analysis

The vulnerability resides in the createVerifier logic of fast-jwt. When a caller constructs a verifier with a falsy synchronous key (empty string or null) and provides a non-empty algorithms allowlist, the verifier skips the prepareKeyOrSecret step while leaving allowedAlgorithms active. Because hasKey evaluates to false and the token signature is empty, the verifySignature gate is also bypassed. The verifier then accepts the unsigned token as valid, and only subsequent claim validators execute. An attacker who crafts a JWT with arbitrary claims and an empty signature can authenticate as any user whose claims the application trusts.

Root Cause

The root cause is incomplete input validation on the combination of key and algorithm options in src/verifier.js. The original code only rejected non-string, non-object, non-function keys. It did not reject falsy keys when the algorithm allowlist contained anything other than "none". This logic gap left verifiers in an inconsistent state where signature verification was effectively disabled while the verifier still reported success.

Attack Vector

Exploitation requires that a target application instantiate createVerifier with an empty or null key and a non-empty algorithms allowlist. The attacker crafts a JWT with the desired header, arbitrary payload claims, and an empty signature segment, then submits it to the vulnerable endpoint. The async key resolver path, non-empty keys, and empty-key-with-no-algorithms configurations are not affected.

javascript
// Patch from src/verifier.js (sanitized excerpt)
const keyType = typeof key
const allowsOnlyNone = allowedAlgorithms.length > 0 && allowedAlgorithms.every(algorithm => algorithm === 'none')

/*
  Unsigned tokens carry no signature, so they are the only ones verifiable without a
  key. Mirroring createSigner, only a truthy key is refused here: that stops a real
  key from silently pairing with the "none" algorithm, while still accepting the
  empty string and null that callers have long used to build such a verifier.
*/
if (allowsOnlyNone) {
  if (key) {
    throw new TokenError(
      TokenError.codes.invalidOption,
      'The key option must not be provided when the only allowed algorithm is "none".'
    )
  }
} else if (keyType !== 'string' && keyType !== 'object' && keyType !== 'function') {
  throw new TokenError(
    TokenError.codes.invalidOption,
    'The key option must be a string, a buffer or a function returning the algorithm secret or public key.'
  )
} else if (!key && keyType !== 'function') {
  // An empty or null key can never verify a signature.
  throw new TokenError(/* ... */)
}

Source: GitHub Commit e22a151

Detect Identity Attacks the Moment Authentication Fails

Singularity™ Identity surfaces credential misuse, lateral movement, and privilege escalation in real time, so you can contain the breach before it spreads.

Stop Identity Attacks

Detection Methods for CVE-2026-107720

Indicators of Compromise

  • JWT tokens received by application endpoints with an empty signature segment (for example, header.payload.)
  • Authentication success events for tokens whose header algorithm matches an allowlisted algorithm but no signature was verified
  • Unexpected privilege escalation or session anomalies in services that depend on fast-jwt for authorization decisions

Detection Strategies

  • Perform a software composition analysis sweep for fast-jwt versions prior to 6.3.1 across all Node.js services and container images.
  • Grep source repositories for createVerifier calls where the key argument may resolve to an empty string or null while algorithms is set.
  • Add application-layer logging that records JWT header algorithm, signature length, and verification outcome to surface tokens accepted without signatures.

Monitoring Recommendations

  • Alert on authentication events where the JWT signature segment is empty or length is zero.
  • Monitor for sudden shifts in user claim distributions, such as new administrative claims appearing on previously standard sessions.
  • Correlate authentication logs with upstream reverse-proxy logs to detect replay of malformed JWTs from unusual source addresses.

How to Mitigate CVE-2026-107720

Immediate Actions Required

  • Upgrade fast-jwt to version 6.3.1 or later in all Node.js applications and rebuild dependent container images.
  • Audit every createVerifier instantiation and ensure the key option is always a non-empty string, buffer, or key-resolving function when verifying signed tokens.
  • Explicitly set the algorithms allowlist and never include "none" unless unsigned tokens are intentionally supported.

Patch Information

The fix is included in fast-jwt 6.3.1. The patch, available in GitHub Commit e22a151 and merged via Pull Request #649, rejects falsy synchronous keys unless the only allowed algorithm is "none". Full release notes are in the GitHub Release v6.3.1, and the vendor security advisory is published as GHSA-8wpc-h4q6-8fxv.

Workarounds

  • If immediate upgrade is not possible, remove any createVerifier calls where the key argument can be empty or null and provide a hard-coded or environment-sourced secret.
  • Add a middleware layer that rejects incoming JWTs whose signature segment is empty before they reach fast-jwt.
  • Restrict the algorithms option to the minimum set required and never include "none" in production allowlists.
bash
# Upgrade fast-jwt to the patched version
npm install fast-jwt@^6.3.1

# Verify the installed version
npm ls fast-jwt

# Audit the project for known advisories
npm audit --production

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.