Skip to content

← Actionable
High, CVSS 7.5amended

Forge: PKCS#12 MAC forgery and constant-key PBE via zero iteration count

CVE-2026-118782GHSA-jc66-7q78-782g

What to do

Vendor fix available. Upgrade each affected package to the fixed version on its release line (node-forge 1.4.1), redeploy, then verify what is actually installed.

This page has no inventory attached, so it cannot say whether you are affected. A vendor fix is not proof that your deployment is fixed.

Affected packages

Sources

Severity and exploitation
Exploitation
No confirmed exploitation recorded. Patch Next marks exploitation only from CISA KEV.
CVSS
7.5 · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
EPSS
  • CVE-2026-118782: 0.13% estimated exploitation activity in the next 30 days; percentile 2.23 (FIRST EPSS, 2026-11-03). This is a model estimate, not proof of exploitation or customer exposure.
Source description

As published by the source; long descriptions are shortened.

Summary forge.pkcs12.pkcs12FromAsn1() accepts a PKCS#12 MAC iteration count of zero (or less) from the input, and the PKCS#12 key derivation function then returns a constant key that does not depend on the password or salt. An attacker who does not know the password can modify a PKCS#12/PFX file and compute a MAC that verifies with any password; PKCS#12 PBE-encrypted private keys prepared the same way decrypt with any password. Fixed in node-forge 1.4.1.

Details `p12.pkcs12FromAsn1()` in `lib/pkcs12.js` reads the MAC iteration count (`MacData.iterations`) from the input and passes it to the PKCS#12 key derivation function `pki.pbe.generatePkcs12Key()` in `lib/pbe.js` (also exposed as `forge.pkcs12.generateKey()`) without checking that it is at least 1. The key derivation function (RFC 7292 Appendix B.2) runs its hash loop `iter` times. With an iteration count of 0 (or an empty or negative INTEGER), no hashing is done and the function returns the PKCS#12 diversifier ID byte…

Dates and revisions
Published by the source
Last modified by the source
Source last checked
  1. Revision 2 · amended ·

    Amended from osv record GHSA-jc66-7q78-782g

  2. Revision 1 · created ·

    Published from ghsa record GHSA-jc66-7q78-782g

Agent brief

Preview the exact text before you copy it. Commands are read-only suggestions; review them before running anything.

# Patch Next advisory brief: CVE-2026-118782

Advisory: Forge: PKCS#12 MAC forgery and constant-key PBE via zero iteration count
IDs: CVE-2026-118782, GHSA-jc66-7q78-782g
Record: https://patchnext.com/advisories/cve-2026-118782 (revision 2, source checked 31 Oct 2026, 06:00 UTC)
Inventory: none attached. This brief comes from a public page and does not say whether any deployment is affected.
Severity: High (CVSS 7.5)
Exploitation: no confirmed exploitation recorded. Patch Next confirms exploitation only from CISA KEV.
Vendor response: Vendor fix available; fixed versions by package: node-forge 1.4.1. A vendor fix does not mean a deployment is fixed.

## Affected components
- npm node-forge: affected < 1.4.1; fixed in 1.4.1

## Suggested inspection (read-only)
- `npm ls node-forge --all`: lists every installed copy and version, including transitive ones. Run in the project root after `npm ci`.

## Supported action
Upgrade each affected component to a fixed version on its release line. For a transitive dependency, upgrade the parent package or add an override or constraint, then regenerate the lockfile. Redeploy every environment that ran an affected version.

## Required regression checks
- Run the test suite and a production build.
- Exercise the features that depend on node-forge.
- Repeat the inspection and confirm that only fixed versions remain installed.

## Rollback considerations
- Keep the previous lockfile and deployment artifact. Rolling back reinstates the vulnerable version, so apply any documented mitigation while you fix forward.

## Unresolved questions
- Which deployments run an affected version?
- Exploitation status can change. Check again before lowering the priority.
- Mark the work resolved only after the fixed version is verified in production.

## Sources
- Verified: https://github.com/advisories/GHSA-jc66-7q78-782g (GitHub-reviewed advisory GHSA-jc66-7q78-782g lists affected ranges: npm node-forge >=0 <=1.4.0)
- Verified: https://osv.dev/vulnerability/GHSA-jc66-7q78-782g (OSV record GHSA-jc66-7q78-782g lists affected ranges: npm node-forge >=0 <1.4.1 (fixed))

Commands are suggestions: review each one before running it.

Loading voting…