{"id":"GHSA-7wch-p9px-956x","revision":null,"records":[{"revision":"a8fec8ee1d254e3ea2dd7978de836a42","observedAt":"2026-10-29T21:48:56.968+00:00","statement":{"source":"cve-program","id":"CVE-2026-118779","aliases":[],"title":"Forge: Regular expression denial of service in PEM decoding (pem.decode)","description":"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.","state":0,"publishedAt":"2026-10-29T18:45:55.093+00:00","modifiedAt":"2026-10-29T20:23:11.602+00:00","affected":[{"ecosystem":"Vendor product","name":"forge","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"digitalbazaar\",\n                    \"product\": \"forge\",\n                    \"versions\": [\n                        {\n                            \"version\": \"< 1.4.1\",\n                            \"status\": \"affected\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"severity":"HIGH"}],"references":["https://github.com/digitalbazaar/forge/security/advisories/GHSA-7wch-p9px-956x","https://github.com/digitalbazaar/forge/commit/412345db583cd28a9d23636d0d93e9f751b935f3","https://github.com/digitalbazaar/forge/releases/tag/v1.4.1"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-118779","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-118779","identifiers":["CVE-2026-118779"]},"retained":false,"historicalAffected":[]},{"revision":"0e48b334c6cb4ceb99ac0cb666a7e928","observedAt":"2026-11-06T01:44:34.792+00:00","statement":{"source":"euvd","id":"EUVD-2026-113337","aliases":["CVE-2026-118779","GHSA-7wch-p9px-956x"],"title":"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 decis…","description":"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.","state":0,"publishedAt":null,"modifiedAt":null,"affected":[],"metrics":[{"system":"EUVD CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"severity":null}],"references":["https://github.com/digitalbazaar/forge/security/advisories/GHSA-7wch-p9px-956x","https://github.com/digitalbazaar/forge/commit/412345db583cd28a9d23636d0d93e9f751b935f3","https://github.com/digitalbazaar/forge/releases/tag/v1.4.1"],"sourceUrl":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-113337","license":"ENISA EUVD · source terms and attribution apply","enrichment":{"sourceStatus":null,"weaknesses":[],"productCriteria":[],"sourceDates":{"datePublished":"Oct 29, 2026, 6:45:55 PM","dateUpdated":"Oct 29, 2026, 8:23:11 PM"},"relatedAdvisories":[{"id":"msrc_CVE-2026-118779","title":"Forge: Regular expression denial of service in PEM decoding (pem.decode)","vulnerabilityIds":["CVE-2026-118779"]}],"note":"EUVD source date text has no stated timezone and is retained without inventing a UTC instant. Related bulletin membership is not an alias, common cause or applicability claim. A missing vector with a zero score is treated as unrated. Complete vendor/product and underlying source evidence remains in the original JSON."},"key":"euvd:EUVD-2026-113337","identifiers":["EUVD-2026-113337","CVE-2026-118779","GHSA-7wch-p9px-956x"]},"retained":false,"historicalAffected":[]},{"revision":"9c3fdd44416e4e77a3561556a85e9d43","observedAt":"2026-10-30T23:47:40.018+00:00","statement":{"source":"nvd","id":"CVE-2026-118779","aliases":[],"title":"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 decis…","description":"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.","state":0,"publishedAt":"2026-10-29T19:17:20.56+00:00","modifiedAt":"2026-10-30T17:18:03.88+00:00","affected":[],"metrics":[{"system":"CVSS 3.1 · security-advisories@github.com · Secondary","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"severity":"HIGH"}],"references":["https://github.com/digitalbazaar/forge/commit/412345db583cd28a9d23636d0d93e9f751b935f3","https://github.com/digitalbazaar/forge/releases/tag/v1.4.1","https://github.com/digitalbazaar/forge/security/advisories/GHSA-7wch-p9px-956x"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2026-118779","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Undergoing Analysis","weaknesses":["CWE-400","CWE-1333"],"productCriteria":[],"sourceDates":{"published":"2026-10-29T19:17:20.560","lastModified":"2026-10-30T17:18:03.880"},"relatedAdvisories":[],"note":"NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON."},"key":"nvd:CVE-2026-118779","identifiers":["CVE-2026-118779"]},"retained":false,"historicalAffected":[]},{"revision":"a2af332b28f34d5891f10af54ea9f152","observedAt":"2026-10-30T23:45:44.41+00:00","statement":{"source":"osv","id":"GHSA-7wch-p9px-956x","aliases":["CVE-2026-118779"],"title":"Forge: Regular expression denial of service in PEM decoding (pem.decode)","description":"### Summary\n`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.\n\n### Details\n`pem.decode()` in `lib/pem.js` found PEM messages with this regular expression:\n\n    /\\s*-----BEGIN ([A-Z0-9- ]+)-----\\r?\\n?([\\x21-\\x7e\\s]+?(?:\\r?\\n\\r?\\n))?([:A-Za-z0-9+\\/=\\s]+?)-----END \\1-----/g\n\nThe 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 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).\n\nThe encapsulated header parsing in the same function had two smaller quadratic cases: trimming each header line with `/\\s+$/`, and an unanchored header regex `([\\x21-\\x7e]+):...` that retries at every position of a long line without a colon. These are reachable when a message does match.\n\nAll PEM entry points call `pem.decode()`, including `pki.certificateFromPem()`, `pki.privateKeyFromPem()`, `pki.publicKeyFromPem()`, `pki.certificationRequestFromPem()`, `pki.encryptedPrivateKeyFromPem()`, `pki.decryptRsaPrivateKey()` and `pkcs7.messageFromPem()`.\n\nThe 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 `-----` (`-----BEGIN A-----B-----`) was matched as `A-----B` if possible; now only the shortest label, `A`, 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.\n\n#### Patches\nFixed in node-forge 1.4.1. PEM messages and encapsulated headers are now parsed in linear time.\n\n#### Workarounds\nRejecting untrusted PEM input larger than a few kilobytes before passing it to node-forge limits the delay but doesn't remove it: on 1.4.0, about 7 KB of crafted input blocked for 0.4 s, and 29 KB for 24 s.\n\n#### Credits\nReported by Ahmed Mokhtari (@AhmedMokhtari), @mwlik and @imenyoo2, and independently by @offset, @bibu123456 (coordinated by @Kayiz-PT), and @Mucahic.\n\n### Proof of concept\n    var forge = require('node-forge');\n    var pem = ' -----BEGIN I-----G-----END B'.repeat(1000) + '\\x00'; // 29 KB\n    try {\n      forge.pki.certificateFromPem(pem);\n    } catch(e) {}\n\nOn 1.4.0 (Node.js 24) this call blocks for about 24 seconds before throwing \"Invalid PEM formatted message.\"; 14 KB takes about 3 seconds. A BEGIN line followed by 32 KB of newlines and no END line takes about 1.5 seconds, and the time grows quadratically from there. On 1.4.1 each of these inputs is rejected in a few milliseconds, and 1 MB inputs of any of these shapes take under 100 ms.\n\nThe PoC is in tests/pocs/ghsa-7wch-p9px-956x.js. Regression tests are in tests/unit/pem.js (\"GHSA-7wch-p9px-956x ReDoS checks\").\n\n### Impact\nAny application that passes untrusted PEM text to node-forge is affected: for example, services that accept uploaded certificates, keys or certificate signing requests, or that parse certificates from configuration, SAML metadata or other user-supplied documents. A remote, unauthenticated attacker can send a small crafted input that blocks the Node.js event loop for seconds to minutes per request, so the process stops serving other requests. Repeated requests keep it unavailable. There is no confidentiality or integrity impact.","state":0,"publishedAt":"2026-10-30T23:02:25+00:00","modifiedAt":"2026-10-30T23:15:07.4744157+00:00","affected":[{"ecosystem":"npm","name":"node-forge","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"1.4.1"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"HIGH"}],"references":["https://github.com/digitalbazaar/forge/security/advisories/GHSA-7wch-p9px-956x","https://nvd.nist.gov/vuln/detail/CVE-2026-118779","https://github.com/digitalbazaar/forge/commit/412345db583cd28a9d23636d0d93e9f751b935f3","https://github.com/digitalbazaar/forge","https://github.com/digitalbazaar/forge/releases/tag/v1.4.1"],"sourceUrl":"https://github.com/advisories/GHSA-7wch-p9px-956x","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-7wch-p9px-956x","identifiers":["GHSA-7wch-p9px-956x","CVE-2026-118779"]},"retained":false,"historicalAffected":[]}],"coverage":[{"source":"cisa-kev:global","scope":"Complete CISA KEV catalog; all vendors. Missing entries do not establish absence of exploitation.","generation":"2026-11-07T02:34:43.7661215+00:00","complete":true,"records":1769,"lastAttemptAt":"2026-11-07T02:34:43.7661215+00:00","lastSuccessAt":"2026-11-07T02:34:43.9387828+00:00","error":null,"lastVerifiedAt":"2026-11-07T02:34:43.9387838+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"cve-program","scope":"Official CVE Program baseline and cumulative hourly delta; all vendors, published and rejected records","generation":"cve-bb5c9d5a08063ef076042e33dd72a7d0ffa4c4487efdcf3106e29ba55ec2ad57-5aac302c22044f92cc2d766b3e31e7dc718ccd14d0209c666b12bbe38c20772f","complete":true,"records":420475,"lastAttemptAt":"2026-11-07T02:34:42.7079446+00:00","lastSuccessAt":"2026-11-07T02:34:42.70025+00:00","error":null,"lastVerifiedAt":"2026-11-07T02:34:42.7079446+00:00","snapshotPublishedAt":"2026-11-07T01:31:15+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"euvd","scope":"Rolling EUVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global EUVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-b8d16fbf74464bc88a41c5137fa81682","complete":false,"records":13623,"lastAttemptAt":"2026-11-07T02:46:32.0890109+00:00","lastSuccessAt":"2026-11-07T02:46:32.084+00:00","error":"11 identifier lookups failed; latest failures include HTTP 403. Other identifiers were checked independently.","lastVerifiedAt":"2026-11-07T02:46:32.084+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13674,"expectedIdentifiers":13685,"failedIdentifiers":11},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-11-07T02:34:43.7661215+00:00","complete":true,"records":1096,"lastAttemptAt":"2026-11-07T02:34:43.7661215+00:00","lastSuccessAt":"2026-11-07T02:34:43.9397262+00:00","error":null,"lastVerifiedAt":"2026-11-07T02:34:43.9397266+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"nvd","scope":"Rolling NVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global NVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-34343b4ea57e47c5a482c8fcf20a381e","complete":true,"records":13645,"lastAttemptAt":"2026-11-07T02:34:44.5754579+00:00","lastSuccessAt":"2026-11-07T01:26:55.938+00:00","error":null,"lastVerifiedAt":"2026-11-07T01:26:55.938+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13685,"expectedIdentifiers":13685,"failedIdentifiers":0},{"source":"osv:Go","scope":"Complete OSV Go ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"go-0eb4d6dde62dffacd040ad992d4fd5a65cd7d0dc5f5f4cfa8b41967fc6f9ca5f","complete":true,"records":9914,"lastAttemptAt":"2026-11-07T02:34:43.3341619+00:00","lastSuccessAt":"2026-11-06T20:10:36.6450506+00:00","error":null,"lastVerifiedAt":"2026-11-07T02:34:43.3341619+00:00","snapshotPublishedAt":"2026-11-06T20:02:57+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:NuGet","scope":"Complete OSV NuGet ecosystem archive, including GitHub Advisory Database records; NuGet version matching only","generation":"nuget-fde804134ecdda0ddd5ff5c26ee1fff5a6fa659311f7ef2e51c6ad54964db0e2","complete":true,"records":1971,"lastAttemptAt":"2026-11-07T02:34:42.8444254+00:00","lastSuccessAt":"2026-11-06T19:03:17.0399903+00:00","error":null,"lastVerifiedAt":"2026-11-07T02:34:42.8444254+00:00","snapshotPublishedAt":"2026-11-06T18:17:57+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:crates.io","scope":"Complete OSV crates.io ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"crates.io-335633e78a15c9cde10a6025895b5617717087fb945489ae7e15d377bacf34a9","complete":true,"records":3055,"lastAttemptAt":"2026-11-07T02:34:43.7181027+00:00","lastSuccessAt":"2026-11-06T16:03:00.7615789+00:00","error":null,"lastVerifiedAt":"2026-11-07T02:34:43.7181027+00:00","snapshotPublishedAt":"2026-11-06T16:02:48+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:npm","scope":"Complete OSV npm ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"npm-a0b728bc1c5526b5429930c00621636eba8655069c176697c3080f8377619ad7","complete":true,"records":231291,"lastAttemptAt":"2026-11-07T02:34:43.2326712+00:00","lastSuccessAt":"2026-11-07T00:28:51.1983528+00:00","error":null,"lastVerifiedAt":"2026-11-07T02:34:43.2326712+00:00","snapshotPublishedAt":"2026-11-06T23:33:08+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}