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


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.14% (4th 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-22114204
  • published1 Nov 2026
  • disclosed26 Oct 2026
  • creditOren Yomtov, zebbern, Brian Lee

Introduced: 26 Oct 2026

NewCVE-2026-118776  (opens in a new tab)
CWE-1284  (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.cbc.prototype.unpad and modes.ecb.prototype.unpad methods in lib/cipherModes.js. An attacker can have malformed ciphertext accepted as valid and silently strip up to four blocks of trailing plaintext, by manipulating the final bytes of malleable CBC or ECB ciphertext, because the unpadding reads only the last byte as the padding count, rejects it only when it exceeds four blocks, and never verifies that the remaining padding bytes equal that count. This matters only when the application relies on decipher.finish() to decide whether decrypted data is valid, and the added capability is small because unauthenticated CBC and ECB ciphertext is already malleable.

Workaround

This vulnerability can be avoided by authenticating CBC or ECB ciphertext with an HMAC before decrypting, or using an authenticated mode such as AES-GCM, which removes the reliance on padding validity to detect tampering.

CVSS Base Scores

version 4.0
version 3.1