Skip to main content

node-forge CVE-2026-118782

| EUVDEUVD-2026-113341 HIGH
Improper Validation of Integrity Check Value (CWE-354)
2026-10-29 GitHub_M GHSA-jc66-7q78-782g
7.5
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Obtain target PKCS#12/PFX file
  2. Delivery
    Substitute attacker certificate and private key
  3. Exploit
    Set MacData.iterations to zero (DER 02 01 00)
  4. Execution
    Compute HMAC-SHA1 with constant key 0x03×20
  5. Impact
    Victim app reports MAC verified under any password

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A08:2025 - Software or Data Integrity Failures
ASVS 5.0
V15 - Secure Coding and Architecture Integrity verification
Exploitation Conditions

Exploitation requires that the application import PKCS#12/PFX files or PKCS#8 ENCRYPTED PRIVATE KEY input from an untrusted source via forge.pkcs12.pkcs12FromAsn1() or forge.pki.decryptPrivateKeyInfo(), and rely on password-based MAC verification or successful PBE decryption to establish that the file was produced by someone who knows the password; this is the default API and call pattern, so no non-default configuration is needed. The flaw is reached specifically through the PKCS#12 MAC path and the PKCS#12 PBE schemes pbeWithSHAAnd3-KeyTripleDES-CBC and pbewithSHAAnd40BitRC2-CBC (including shrouded key bags and encrypted SafeContents). Limiting factors: content protected with PBES2/PBKDF2 is NOT affected; the attacker gains no knowledge of the password or the original private key; and the attack only matters where PKCS#12 input comes from an untrusted party - applications that only load their own trusted keystores are not meaningfully exposed. No password, decryption oracle, or user interaction is required, only one offline HMAC computation.

Impact

This is a genuine integrity-bypass issue with a confirmed, working PoC, but its real-world urgency is scoped by how the library is used. The vendor CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N = 7.5 High) reflects a network-reachable, low-complexity, no-privilege, no-interaction attack whose only impact is integrity (C:N/A:N) - the attacker forges a valid MAC / decrypts PBE content so a tampered PKCS#12 verifies under any password, but does not learn the password or original key. No EPSS score and no CISA KEV entry were provided in the input, so there is no signal of mass or active exploitation; the vuln.today Decision label is 'this_week' (not act_now/emergency), consistent with a serious but not actively-exploited flaw. The AV:N rating should be read carefully: the mechanism is actually malicious PKCS#12/PFX or PKCS#8 data being imported, so 'network' applies only where the application ingests such files from untrusted remote sources - the practical risk concentrates on apps that import PKCS#12/PFX or encrypted private keys from untrusted parties and trust MAC/decryption success as proof of authenticity. Signals are consistent rather than conflicting (vendor CVSS 3.1 and 4.0 both rate High; PoC is real; no KEV/EPSS to contradict), so this is a legitimate patch priority for affected consumers rather than a high-CVSS-but-hollow finding, but it is not a drop-everything emergency absent exploitation data.

Exploit ScenarioDerived

An application uses node-forge to import PKCS#12/PFX files or PKCS#8 encrypted private keys supplied by untrusted parties and treats a successful password-based MAC check (or successful decryption) as proof the file came from someone who knows the password. An attacker who does not know the password replaces the file's contents with their own certificate and private key, sets MacData.iterations to 0, and computes a valid HMAC-SHA1 using the fixed constant key (0x03 repeated 20 times), so forge.pkcs12.pkcs12FromAsn1() reports the file as verified under whatever password the application supplies. Working exploit code exists: a PoC is published in the GHSA advisory and committed to the repository under tests/pocs/, requiring only a single offline HMAC and no oracle, password, or user interaction.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Oct 29, 2026

PKCS#12 MAC forgery and constant-key password-based decryption in node-forge 1.4.0 and earlier let anyone who does not know a PFX password tamper with a PKCS#12 file - swapping in attacker-chosen certificates or an unencrypted private key - and have forge.pkcs12.pkcs12FromAsn1() report the MAC as verified under whatever password the application supplies. The root cause is that a MacData iteration count of zero or less is accepted from the input, collapsing the RFC 7292 Appendix B.2 key derivation to a public constant (0x03 repeated); the same KDF is used by the pbeWithSHAAnd3-KeyTripleDES-CBC and pbewithSHAAnd40BitRC2-CBC schemes, so shrouded key bags, encrypted SafeContents and PKCS#8 ENCRYPTED PRIVATE KEY input handled via forge.pki.decryptPrivateKeyInfo() likewise decrypt with any password. The vendor advisory ships a working proof-of-concept and the fix commit adds it to tests/pocs/; no CISA KEV listing exists and exploitation is limited to applications that import PKCS#12 or encrypted PKCS#8 material from untrusted parties and rely on MAC verification or successful decryption as proof of password knowledge. With CVSS 3.1 scored 7.5 (AV:N/AC:L/PR:N/UI:N, integrity-only impact) this is a genuine integrity bypass but not an emergency for deployments that only load their own trusted keystores; it should be remediated this week given the public PoC.

RemediationAI

Vendor-released patch: node-forge 1.4.1. Upgrade the npm dependency to 1.4.1 or later (patch commit d9584aa56824972858366d5187b3d29e46bf3656, advisory https://github.com/digitalbazaar/forge/security/advisories/GHSA-jc66-7q78-782g, release https://github.com/digitalbazaar/forge/releases/tag/v1.4.1); 1.4.1 rejects iteration counts below 1 with 'PKCS#12 MAC iteration count must be >= 1.' and 'PKCS#12 key derivation iteration count must be >= 1.', covering MAC verification, both PKCS#12 PBE schemes and direct forge.pkcs12.generateKey() callers. If an immediate upgrade is not possible, the vendor's only stated workaround is to reject inputs whose MacData.iterations is present and less than 1 before calling forge.pkcs12.pkcs12FromAsn1(); for encrypted private keys using the PKCS#12 PBE schemes the vendor notes there is no simple workaround other than inspecting the pkcs-12PbeParams iteration count before decryption or upgrading - both options require custom pre-parse ASN.1 inspection, add parsing complexity that can itself diverge from forge's parser, and do not cover every call path into the shared KDF. Because the integrity value derives from a constant, non-cryptographic validation of the MAC or of decryption success cannot be substituted. Applications whose PKCS#12 input is exclusively self-generated can treat this as lower priority, but should still take the update as part of the next scheduled dependency refresh, consistent with the this_week priority label and the public proof-of-concept.

Affected VersionsENISA

forge < 1.4.1

Affected Packages

npm node-forge fix: 1.4.1
euvd forge fix: 1.4.1

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in npm, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

node-forge is a pure-JavaScript implementation of TLS and related PKI primitives, so it re-implements PKCS#12 (RFC 7292) parsing and key derivation in lib/pkcs12.js and lib/pbe.js. The weakness is CWE-354 (Improper Validation of Integrity Check Value), with CWE-1284 (Improper Validation of Specified Quantity in Input) as the mechanism: MacData is defined as iterations INTEGER DEFAULT 1 and RFC 8018 requires INTEGER (1..MAX) for the analogous PBKDF parameter, but forge passed the attacker-supplied MacData.iterations straight into pki.pbe.generatePkcs12Key() without a lower bound. The RFC 7292 Appendix B.2 KDF runs its hash loop 'iter' times; at zero iterations no hashing occurs and the function returns the diversifier ID byte repeated (0x03 x 20 for an HMAC-SHA1 MAC key), independent of password and salt, so a single offline HMAC is enough to forge a MAC over arbitrary AuthenticatedSafe content. The same KDF backs pki.pbe.getCipherForPKCS12PBE() for pbeWithSHAAnd3-KeyTripleDES-CBC and pbewithSHAAnd40BitRC2-CBC, whose pkcs-12PbeParams iterations are also read from the input; at zero iterations the key and IV degrade to constants (0x01 and 0x02 repeated), reachable from shrouded key bags, encrypted SafeContents in pkcs12FromAsn1(), and forge.pki.decryptPrivateKeyInfo() for ENCRYPTED PRIVATE KEY PEM input. PBES2/PBKDF2-encrypted content is explicitly unaffected. The upstream fix adds bounds checks in both lib/pkcs12.js (MAC verification) and lib/pbe.js (KDF entry point), covering the MAC path, both PKCS#12 PBE schemes and direct forge.pkcs12.generateKey() callers; it is related to but distinct from CVE-2025-12816 / GHSA-5gfm-wpxj-wjgq, which involved an ASN.1 validator desynchronization that caused MacData to be skipped entirely.

Know when Forge gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 7.5 HIGH
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
vuln.today AI 7.5 HIGH

Attacker needs no credentials and only an offline HMAC (PR:N/AC:L); impact is integrity bypass of the authenticity check (I:H) with no password/key disclosure (C:N) and no availability effect (A:N).

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
None

Lifecycle Timeline

2
Patch available
Oct 29, 2026 - 19:18 EUVD
CVE Published
Oct 29, 2026 - 18:51 cve.org
HIGH 7.5

DescriptionCVE.org

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.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 6 npm packages depend on node-forge (3 direct, 3 indirect)

Ecosystem-wide dependent count for version 1.4.1.

Technical POC Analysis

CWE-354 (Improper Validation of Integrity Check Value), with a secondary CWE-1284 (Improper Validation of Specified Quantity).

Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.

Executive ViewAI

Why It Matters

CVE-2026-118782 in node-forge (versions ≤1.4.0) allows an attacker to tamper with PKCS#12 files without knowing the password, potentially injecting malicious certificates or private keys. This affects any application that imports PKCS#12 files using the vulnerable library, compromising the integrity of cryptographic materials and undermining trust in certificate-based authentication and encryption.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.1%
Top 98% exploitable
Prevalence
High
very widely used JavaScript/npm crypto library (node-forge), millions of installs
Threat Intel
1
1 source
Social Media
1
Sightings
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
High

Priority Score

38
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +38
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.

More in Forge

View all
CVE-2025-12816 HIGH POC
8.6 Nov 25

An interpretation-conflict (CWE-436) vulnerability in node-forge versions 1.3.1 and earlier enables unauthenticated atta

CVE-2020-7720 HIGH POC
7.3 Sep 01

The package node-forge before 0.10.0 is vulnerable to Prototype Pollution via the util.setPath function. Rated high seve

CVE-2026-85393 HIGH
8.7 Sep 03

RSA PKCS#1 v1.5 signature forgery in node-forge through v1.4.0 enables unauthenticated network attackers to craft signat

CVE-2025-66031 HIGH
8.7 Nov 26

Forge (also called `node-forge`) is a native implementation of Transport Layer Security in JavaScript. Rated high severi

CVE-2026-118779 HIGH
7.5 Oct 29

Regular expression denial of service in node-forge's pem.decode() allows remote, unauthenticated attackers to block the

CVE-2026-119191 HIGH
7.5 Oct 29

Denial of service in node-forge (Forge) 1.3.2 through 1.4.0 lets remote, unauthenticated attackers exhaust CPU time and

CVE-2026-119188 HIGH
7.5 Oct 29

Denial of service in node-forge's JavaScript TLS implementation: a connection created with forge.tls.createConnection()

CVE-2026-119187 HIGH
7.5 Oct 29

Call stack exhaustion in node-forge's TLS record processing (all versions through 1.4.0) allows a remote peer to crash o

CVE-2022-24772 HIGH
7.5 Mar 18

Forge (also called `node-forge`) is a native implementation of Transport Layer Security in JavaScript. Rated high severi

CVE-2022-24771 HIGH
7.5 Mar 18

Forge (also called `node-forge`) is a native implementation of Transport Layer Security in JavaScript. Rated high severi

CVE-2026-119190 HIGH
7.4 Oct 29

Certificate chain validation in node-forge (Forge) through version 1.4.0 can be bypassed because the parser maps the dep

CVE-2025-66030 MEDIUM
6.3 Nov 26

Forge (also called `node-forge`) is a native implementation of Transport Layer Security in JavaScript. Rated medium seve

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy