---
id: "CVE-2026-118782"
kind: "vulnerability"
aliases: ["CVE-2026-118782"]
title: "node-forge: zero iteration count lets crafted PKCS#12 bypass password integrity checks"
severity: "high"
cvss: 7.5
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["javascript", "node-forge", "node.js", "package"]
not_affected_if: ["no-forge-pkcs12-parsing", "no-untrusted-pkcs12", "pbes2-only"]
published_at: "2026-10-29T19:17:20+00:00"
first_seen_at: "2026-10-29T19:26:47+00:00"
updated_at: "2026-10-29T19:27:25+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-118782", "first_seen_at": "2026-10-29T19:26:47+00:00"}]
---

# node-forge: zero iteration count lets crafted PKCS#12 bypass password integrity checks

Versions of node-forge before 1.4.1 accept a PKCS#12 iteration count of zero or less, so the derived key ignores the password and salt. Crafted PKCS#12 or PKCS#8 encrypted key input can then bypass integrity checks or be decrypted with predictable keys.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the installed node-forge version with `npm ls node-forge`
- Search lockfiles for `node-forge` at versions below `1.4.1`
- Look for code calling `forge.pkcs12.pkcs12FromAsn1` or `forge.pki.decryptPrivateKeyInfo` on untrusted input

## Fix

- node-forge: move to `1.4.1` or later

## Timeline

- 2026-10-29T19:26:47+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-118782

## From the sources

Forge (also called node-forge) is a native implementation of Transport Layer Security in JavaScript. Prior to 1.4.1, node-forge accepted a PKCS#12 MAC or PKCS#12 password-based encryption iteration count of zero or less. pki.pbe.generatePkcs12Key() then returned a constant key independent of the password and salt, allowing crafted PKCS#12 input processed by forge.pkcs12.pkcs12FromAsn1() to bypass password-based integrity checks. Predictable encryption keys and IVs also affected PKCS#12 PBE using pbeWithSHAAnd3-KeyTripleDES-CBC or pbewithSHAAnd40BitRC2-CBC, including shrouded key bags, encrypted SafeContents, and PKCS#8 ENCRYPTED PRIVATE KEY input processed independently by forge.pki.decryptPrivateKeyInfo(). PBES2/PBKDF2-encrypted content is unaffected. This issue is fixed in version 1.4.1.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
