---
id: "CVE-2026-118779"
kind: "vulnerability"
aliases: ["CVE-2026-118779"]
title: "node-forge: PEM parser regex lets crafted input exhaust CPU"
severity: "high"
cvss: 7.5
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["denial-of-service", "javascript", "node.js", "package", "tls"]
not_affected_if: ["no-untrusted-pem-input", "version-1.4.1-or-later"]
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-118779", "first_seen_at": "2026-10-29T19:26:47+00:00"}]
---

# node-forge: PEM parser regex lets crafted input exhaust CPU

node-forge, a JavaScript TLS and crypto library, has polynomial-time regular expressions in its PEM decoder. A long malformed PEM message can make the process consume excessive CPU, causing denial of service.

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

## How to check

- `npm ls node-forge` to find every installed copy, including transitive dependencies
- Check the resolved `node-forge` version in your lockfile against `1.4.1`

## Fix

- `node-forge` `1.4.1` or later

## Timeline

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

## From the sources

Forge (also called node-forge) is a native implementation of Transport Layer Security in JavaScript. Prior to 1.4.1, the affected implementation used pem.decode(), lib/pem.js, missing END line to process the relevant input or security decision. node-forge used polynomial-time regular expressions in pem.decode(), including when searching for a matching END line and parsing encapsulated headers. An unauthenticated attacker able to supply PEM input to any high-level parser could consume excessive CPU with a long malformed message and cause denial of service. 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_
