Improper Validation of Specified Quantity in Input Affecting node-forge package, versions <1.4.1


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.21% (11th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JS-NODEFORGE-22113982
  • published1 Nov 2026
  • disclosed30 Oct 2026
  • creditUnknown

Introduced: 30 Oct 2026

NewCVE-2026-119186  (opens in a new tab)
CWE-1284  (opens in a new tab)
CWE-354  (opens in a new tab)

How to fix?

Upgrade node-forge to version 1.4.1 or higher.

Overview

node-forge is a JavaScript implementations of network transports, cryptography, ciphers, PKI, message digests, and various utilities.

Affected versions of this package are vulnerable to Improper Validation of Specified Quantity in Input in the modes.gcm.prototype.start method in lib/cipherModes.js. An attacker can have forged ciphertext accepted as authentic, and alter known plaintext to chosen values, by supplying an empty authentication tag, because a zero-like tagLength is stored without validation and afterFinish() computes truncate(16 % (tagLength / 8)), which for a zero value evaluates to 16 % 0 = NaN and empties the tag, so decipher.finish() compares two empty strings and returns true. This is reached only when the application calls forge.cipher.createDecipher('AES-GCM', ...) with a zero-like tagLength, such as one derived from the received tag length or an unset configuration value, while the default 128-bit tag and any fixed valid tagLength are unaffected.

CVSS Base Scores

version 4.0
version 3.1