Skip to content

← Actionable
High, CVSS 7.5amended

Forge: Regular expression denial of service in PEM decoding (pem.decode)

CVE-2026-118779GHSA-7wch-p9px-956x

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:N/A:H
EPSS
  • CVE-2026-118779: 0.56% estimated exploitation activity in the next 30 days; percentile 46.43 (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 `pem.decode()`, which every node-forge API that parses PEM input uses, split messages with a regular expression that takes polynomial time on input without a matching END line, and parsed encapsulated headers with regular expressions that take quadratic time on long header lines. A remote attacker can block the Node.js event loop for seconds to minutes with a crafted input of a few tens of kilobytes. Fixed in node-forge 1.4.1.

Details `pem.decode()` in `lib/pem.js` found PEM messages with this regular expression: /\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g The optional headers group and the body group are adjacent, lazy, and share characters (whitespace and the base64 alphabet), and the match must end with an END line whose label equals the BEGIN label (`\1`). When no such END line follows, the engine tries every split of the text between the two groups, for every label split and at every BEGIN line…

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

    Amended from osv record GHSA-7wch-p9px-956x

  2. Revision 1 · created ·

    Published from ghsa record GHSA-7wch-p9px-956x

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-118779

Advisory: Forge: Regular expression denial of service in PEM decoding (pem.decode)
IDs: CVE-2026-118779, GHSA-7wch-p9px-956x
Record: https://patchnext.com/advisories/cve-2026-118779 (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-7wch-p9px-956x (GitHub-reviewed advisory GHSA-7wch-p9px-956x lists affected ranges: npm node-forge >=0 <=1.4.0)
- Verified: https://osv.dev/vulnerability/GHSA-7wch-p9px-956x (OSV record GHSA-7wch-p9px-956x lists affected ranges: npm node-forge >=0 <1.4.1 (fixed))

Commands are suggestions: review each one before running it.

Loading voting…