Vulnerabilities

Security fix · CVE-2026-118779

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

Published Oct 30, 2026 · catalog updated Oct 30, 2026 · Forge: Regular expression denial

Last checked Nov 4, 2026. A connected source was read within the last 7 days.

Check if you run it

No confirmed exploitation is on record for CVE-2026-118779. EPSS is 0.56%. Act only if a listed version of Forge: Regular expression denial is installed.

Gaps on this record

  • The stored product name is a package slug. The name on this page is taken from the title (Forge: Regular expression denial).
  • No vendor fix or required action is stored. Compare the linked advisory before you change production.
Severity
High7.5
Known exploitation
Not in CISA/VulnCheck KEV
EPSS
0.56%
Remediation
Version ranges on file
Affected products
npm node-forge

### Summary , 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 in 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 ( ). 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 in the input. The work grows polynomially with the input length (roughly cubic for repeated BEGIN/END lines with mismatched labels, quadratic for a BEGIN line followed by many newlines). The encapsulated header parsing in the same function had two smaller quadratic cases: trimming each header line with , and an unanchored header regex that retries at every position of a long line without a colon. These are reachable when a message does match. All PEM entry points call , including , , , , , and . The fix replaces the message regular expression with a scanner that indexes the END lines once and matches each BEGIN line in linear time, finding the same messages as before. The one difference: a label containing ( ) was matched as if possible; now only the shortest label, , is used. RFC 7468 labels can't contain . Header parsing now trims lines with a loop and only starts a header match at the beginning of a run of printable characters, which gives the same result. #### Patches Fixed in node-forge 1.4.1. PEM messages and encapsulated head

Are you affected?

Enter the version you run. The result uses only the ranges stored on this record.

The check returns affected, not affected, or incomplete. It does not guess a version that is missing from the record.

  • npm node-forge<= 1.4.0

How to fix CVE-2026-118779

What to do

Three questions, each answered from this record only. Confirm the vendor advisory before you patch.

Should you patch?

No confirmed exploitation is on record for CVE-2026-118779. EPSS is 0.56%. Act only if a listed version of Forge: Regular expression denial is installed.

Which versions are affected?

Compare what you have installed with <= 1.4.0. Compare the installed version with the linked vendor advisory before you change production.

What should an analyst verify?

CWE-1333: Inefficient Regular Expression Complexity; CWE-400: Uncontrolled Resource Consumption. EPSS 0.56%. There is no CISA KEV listing. No Exploit-DB or Metasploit reference is linked. Use the source links for the original advisory.

Code

The project this record applies to. Exploit listings stay in References.

Timeline

Detection, updates, and resolution for this record.

  1. Oct 30, 2026 · GitHub Advisory Database

    Detected

    ### Summary , 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

  2. Oct 30, 2026 · GitHub Advisory Database

    Updated

    ### Summary , 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

Sources

  • CVE.orgVulnerability recordCVE-2026-118779

    Official CVE identifier

    cve.org
  • GitHub Advisory DatabasePackage advisoryGHSA-7wch-p9px-956x

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

    github.com
  • GitLab Advisory DatabasePackage advisoryCVE-2026-118779

    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

    advisories.gitlab.com

References

Freshness

Last verified in this catalog Nov 3, 2026. Significant claims (KEV, EPSS, CVSS, affected ranges) come from the source rows above — open the original publisher for the authoritative advisory.

  • GitHub Advisory DatabaseNov 4, 2026
  • GitLab Advisory DatabaseNov 3, 2026
  • CVE.orgOct 31, 2026