CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-107720

CVE-2026-107720: Signature Verification Bypass in NearForm fast-jwt

Amit Schendel
Amit Schendel
Senior Security Researcher

Oct 9, 2026·7 min read·23 visits

Executive Summary (TL;DR)

A flaw in fast-jwt prior to 6.3.1 allows attackers to forge JSON Web Tokens and bypass authorization checks entirely if the library is configured with a blank/null key and an explicit list of allowed algorithms.

CVE-2026-107720 is a critical signature verification bypass vulnerability in NearForm's fast-jwt Node.js library. Under specific configurations where the token verifier is initialized with a falsy cryptographic key (such as an empty string or null) and a non-empty algorithms allowlist, the library erroneously skips signature validation. This allows unauthenticated remote attackers to submit fabricated, unsigned JSON Web Tokens and bypass the authorization boundary of the application entirely.

Vulnerability Overview

The NearForm fast-jwt library is a high-performance JSON Web Token (JWT) parsing and verification utility for Node.js environments. Applications rely on this library to validate the integrity and authenticity of authentication tokens presented by clients. The vulnerability exposed in CVE-2026-107720 resides in the input validation and signature enforcement boundaries during the verifier initialization and token verification phases.

When developers initialize the token verifier, they supply cryptographic secrets or public keys alongside a set of allowable signature algorithms. The attack surface is exposed when these systems are configured dynamically, and key resolution yields falsy parameters such as an empty string ('') or null. Under this configuration, the engine fails to raise an exception, leading to an insecure operational state.

This security vulnerability is cataloged under both CWE-20 (Improper Input Validation) and CWE-347 (Improper Verification of Cryptographic Signature). By abusing this logical flaw, remote attackers can craft a token structure that explicitly bypasses the cryptographic check, allowing the modification of claims and the execution of unauthorized actions within the system.

Root Cause Analysis

The root cause of this vulnerability lies in a systemic logical disconnect between createVerifier (the instantiation routine) and verifyToken (the token evaluation routine).

During verifier setup, if an explicit algorithms list is supplied alongside a falsy key value, the initialization logic evaluates typeof key. Because typeof '' evaluates to 'string' and typeof null evaluates to 'object', the basic type validation passes successfully. The configuration then encounters a conditional execution block designed to prepare cryptographic secrets:

if (key && keyType !== 'function') {
  prepareKeyOrSecret();
}

Because the key is falsy, the if condition evaluates to false, and the preparation routine is completely bypassed. This bypass is critical because prepareKeyOrSecret() contains the key length assertions that would otherwise trigger an immediate error. Because no exception is thrown, the verifier is returned in an active but uninitialized state with hasKey set to false.

When an incoming token is checked, the validation logic evaluates whether a key and signature exist. If an attacker submits an unsigned token, both hasKey and the token signature are falsy. The logic evaluates the check !hasKey && !signature as true, which causes the verification gate to skip cryptographic validation entirely. This condition is intended to permit the use of the none algorithm, but it does so without ensuring that none is the only permitted algorithm in the configuration.

Code Analysis

Analyzing the difference between the vulnerable codebase and the patched implementation highlights the exact logical gaps that enabled the bypass.

Vulnerable Logic in src/verifier.js

In the vulnerable implementation, the instantiation phase did not prevent a mismatch between algorithms and the presence of a real key:

// In vulnerable versions:
const keyType = typeof key
if (key && keyType !== 'function') {
  // Only executed if key is truthy.
  // This meant falsy keys skipped critical configuration safety gates.
  prepareKeyOrSecret()
}

During verification, the function evaluated the following:

// In verifyToken execution path:
const hasKey = !!this.key
const signature = token.signature
 
if (!hasKey && !signature) {
  // Bypasses the signature verification process entirely
  return token.payload
}

Patched Logic in src/verifier.js

The patch introduced in version 6.3.1 implements strict enforcement boundaries at instantiation time. It ensures that any falsy key configuration coupled with a non-none algorithm list causes the initialization to fail-closed immediately:

// Patched logic in version 6.3.1:
const keyType = typeof key
const allowsOnlyNone = allowedAlgorithms.length > 0 && allowedAlgorithms.every(algorithm => algorithm === 'none')
 
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') {
  // Ensures a falsy key is rejected unless the only allowed algorithm is strictly 'none'
  throw new TokenError(
    TokenError.codes.invalidKey,
    'The key option is required unless the only allowed algorithm is "none".'
  )
}

By moving these checks to the instantiation boundary, fast-jwt prevents applications from deploying insecure verifier configurations that could silently permit signature bypasses.

Exploitation Methodology

Exploiting this vulnerability relies on an attacker constructing an unsigned JWT containing forged claims and delivering it to an application configured with a falsy secret key.

Attack Prerequisites

  • The target application must initialize createVerifier with a dynamic key value that resolves to a falsy value (such as an empty string '' or null). This typically occurs when key configurations are loaded from uninitialized or missing environment variables.
  • The verifier must be configured with an explicit list of allowed algorithms that does not enforce only 'none' (such as ['HS256']).

Payload Construction

JSON Web Tokens consist of three base64url-encoded parts separated by periods: the header, the payload, and the signature. An unsigned token contains an empty signature segment, resulting in a trailing period.

// Script to generate a forged unsigned token
const header = { alg: 'HS256', typ: 'JWT' };
const payload = { sub: 'admin', role: 'superuser', exp: Math.floor(Date.now() / 1000) + 3600 };
 
const encodedHeader = Buffer.from(JSON.stringify(header)).toString('base64url');
const encodedPayload = Buffer.from(JSON.stringify(payload)).toString('base64url');
 
// Construct the unsigned token (note the trailing period and absent signature)
const forgedToken = `${encodedHeader}.${encodedPayload}.`;
console.log(forgedToken);

When this token is presented to the vulnerable application, the system parses the empty signature, matches it against the uninitialized verifier, bypasses the cryptographic validation block, and processes the forged administrative claims.

Impact Assessment

The impact of this vulnerability is critical, representing a total compromise of the authentication and authorization layer of the target application. Successful exploitation permits complete authentication bypass, administrative privilege escalation, and unauthorized access to resources governed by the JWT validation mechanisms.

Because authentication tokens are typically used to convey user identities, access rights, and permission scopes, an attacker who can successfully bypass the signature check can impersonate any arbitrary identity within the application, including superusers or administrative staff.

The high attack complexity classification (AC:H) in the CVSS metric reflects the requirement that the target application must be configured with a falsy key option alongside an explicit list of allowed algorithms. However, in containerized or cloud-native environments where configuration keys are passed via dynamic environment variables, uninitialized environment variables can silently trigger this specific state, heightening the practical threat level.

Remediation and Mitigation

Remediating this vulnerability requires immediate updates to the dependency tree of affected software and, where updates are delayed, implementing configuration verification.

Dependency Upgrades

To resolve the underlying issue permanently, upgrade the fast-jwt package to version 6.3.1 or newer. This version enforces strict checks during the verifier creation phase and raises a fatal exception if a falsy key is passed with signature-based algorithms.

npm install fast-jwt@6.3.1

Defense-in-Depth Configurations

Ensure that the environment variables or configuration files containing cryptographic secrets are strictly checked during the application bootstrapping process. If a secret is missing, empty, or undefined, the application must crash immediately rather than falling back to default values.

// Implement strict key checking on startup
const jwtSecret = process.env.JWT_SECRET;
if (!jwtSecret || jwtSecret.trim() === '') {
  throw new Error('FATAL: JWT_SECRET environment variable is missing or empty');
}

This defensive pattern prevents the application from entering a vulnerable operational state even if an older, vulnerable version of the library is active.

Official Patches

NearFormPull Request #649 fixing key validation logical flaw
NearFormRelease tag v6.3.1 containing the security patch

Fix Analysis (1)

Technical Appendix

CVSS Score
7.4/ 10
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N

Affected Systems

All Node.js applications using NearForm fast-jwt versions prior to 6.3.1

Affected Versions Detail

Product
Affected Versions
Fixed Version
fast-jwt
NearForm
< 6.3.16.3.1
AttributeDetail
CWE IDCWE-347 (Improper Verification of Cryptographic Signature)
Attack VectorNetwork (AV:N)
CVSS v3.1 Score7.4 (High)
Exploit StatusProof of Concept (PoC) available
CISA KEV StatusNot listed
ImpactComplete authentication and authorization bypass

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
CWE-347
Improper Verification of Cryptographic Signature

The software does not verify or incorrectly verifies the cryptographic signature for data.

References & Sources

  • [1]Official Security Advisory (GitHub)
  • [2]Official Fix Commit
  • [3]NVD CVE Entry

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•2 days ago•CVE-2026-58254
6.5

CVE-2026-58254: Authorization Bypass in NATS Server Message Tracing for Leaf Node Connections

NATS Server prior to versions 2.12.8 and 2.14.3 contains an incorrect authorization vulnerability (CWE-863) in its message tracing subsystem. When evaluating whether a connection is permitted to publish trace events to a destination subject specified in the Nats-Trace-Dest header, the server only checks standard client permissions and omits permission checks for leaf node connections. This allows a connected leaf node operator with restricted publishing privileges to emit internal trace events to unauthorized subjects and suppress standard message delivery using the Nats-Trace-Only header.

Alon Barad
Alon Barad
11 views•10 min read
•2 days ago•CVE-2026-63341
7.5

CVE-2026-63341: Unauthenticated Denial of Service via Unbounded Topic Depth in Aedes MQTT Broker

CVE-2026-63341 is a high-severity Denial of Service (DoS) vulnerability in the Aedes MQTT broker for Node.js affecting all versions prior to 1.1.1. The flaw stems from missing input validation on the hierarchical depth of incoming MQTT topic strings before they are passed to the underlying topic-matching engine, qlobber. Because qlobber enforces a hardcoded limit of 100 topic levels and throws a synchronous exception when this threshold is exceeded, an attacker can send a single MQTT packet containing 101 or more forward-slash-separated levels to trigger an uncaught exception that immediately terminates the Node.js broker process.

Alon Barad
Alon Barad
16 views•12 min read
•2 days ago•CVE-2026-61725
6.1

CVE-2026-61725: Path Traversal and Arbitrary File Overwrite in sevenz-rust2

CVE-2026-61725 is a path traversal vulnerability (CWE-22) in the sevenz-rust2 Cargo package prior to version 0.21.1. The vulnerability occurs because the decompression utility fails to validate or sanitize archive entry filenames before joining them with the destination directory path via std::path::Path::join. An attacker who supplies a crafted 7z archive containing parent directory traversal sequences or absolute paths can write or overwrite arbitrary files on the host filesystem with the privileges of the extracting process.

Alon Barad
Alon Barad
6 views•12 min read
•2 days ago•CVE-2026-77309
8.8

CVE-2026-77309: Unauthenticated Remote Code Execution in NASA-AMMOS AIT-GUI via Incomplete File Cleanup and Path Traversal

CVE-2026-77309 (GHSA-jrjx-9jjw-747m) is a high-severity unauthenticated remote code execution vulnerability affecting NASA-AMMOS AIT-GUI versions 1.0.0 through 2.5.0. The flaw results from chaining an incomplete file cleanup error in the telemetry query endpoint (/tlm/query) with a directory traversal flaw in the script execution endpoint (/script/run). An attacker on an adjacent network can stage arbitrary Python statements into a static file on disk and execute that file under the privileges of the AIT-GUI web server process.

Amit Schendel
Amit Schendel
16 views•10 min read
•2 days ago•CVE-2026-77332
2.3

CVE-2026-77332: Surfaced-Memory Envelope Injection and Stored Prompt Injection in memtomem-stm

A vulnerability classified under CWE-116 (Improper Encoding or Escaping of Output) exists in memtomem-stm versions 0.1.0 through 0.1.33. The software acts as a Model Context Protocol (MCP) short-term memory proxy gateway for AI agent architectures. When surfacing retrieved memories and scratchpad items into downstream Large Language Model (LLM) context envelopes, the SurfacingFormatter component fails to properly sanitize untrusted memory attributes. An attacker with the ability to plant untrusted content into the agent's long-term or working memory store can inject arbitrary structural delimiters, close the <surfaced-memories> XML boundary prematurely, visually obscure instructions using Unicode bidirectional overrides, and execute stored prompt injection attacks against downstream LLM agents.

Alon Barad
Alon Barad
19 views•10 min read
•2 days ago•CVE-2026-77331
2.0

CVE-2026-77331: Race Condition and Session State Corruption in memtomem-stm

CVE-2026-77331 (GHSA-72jh-722p-rqr3) is a concurrency and session-state synchronization vulnerability in memtomem-stm, a short-term memory proxy gateway for AI agents. In versions 0.1.2 prior to 0.1.34, concurrent Model Context Protocol (MCP) Remote Procedure Call (RPC) failures or mid-flight task cancellations can initiate duplicate reconnect loops and permit dirty or cancelled transport sessions to be reused. This deficiency results in session-state integrity loss and local service degradation.

Amit Schendel
Amit Schendel
8 views•9 min read