{"id":"GHSA-h6cr-wjv9-3cpp","revision":null,"records":[{"revision":"8937b965a6b94c72b73df6b9e5e9ee6c","observedAt":"2026-10-30T17:45:26.685+00:00","statement":{"source":"cve-program","id":"CVE-2026-118781","aliases":[],"title":"Forge: Denial of Service via infinite loop in BigInteger.modInverse() with negative input (incomplete fix of CVE-2026-33891)","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 BigInteger.prototype.modInverse(), bnModInverse(), lib/jsbn.js, RSA public exponent e to process the relevant input or security decision. node-forge's bundled jsbn implementation entered an infinite loop when BigInteger.prototype.modInverse() received a negative value or modulus. An attacker who could control the RSA public exponent passed to key generation, or a direct modInverse() operand, could block the Node.js event loop at full CPU. Parsed DER, PEM, JWK, PKCS#12, X.509, and TLS values are unsigned and cannot trigger this issue. This issue is fixed in version 1.4.1.","state":0,"publishedAt":"2026-10-29T18:49:28.661+00:00","modifiedAt":"2026-10-30T16:09:30.153+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:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L","score":2.9,"severity":"LOW"}],"references":["https://github.com/digitalbazaar/forge/security/advisories/GHSA-h6cr-wjv9-3cpp","https://github.com/digitalbazaar/forge/commit/e96c47b7f006dec66fb7bb1934e7375498b04a72","https://github.com/digitalbazaar/forge/releases/tag/v1.4.1"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-118781","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-118781","identifiers":["CVE-2026-118781"]},"retained":false,"historicalAffected":[]},{"revision":"1232d0a28d204f839244641921ec8bcc","observedAt":"2026-11-16T06:43:24.291+00:00","statement":{"source":"euvd","id":"EUVD-2026-113339","aliases":["CVE-2026-118781","GHSA-h6cr-wjv9-3cpp"],"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 BigInteger.prototype.modInverse(), bnModInverse(), lib/jsbn.js, RSA public exponent e to p…","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 BigInteger.prototype.modInverse(), bnModInverse(), lib/jsbn.js, RSA public exponent e to process the relevant input or security decision. node-forge's bundled jsbn implementation entered an infinite loop when BigInteger.prototype.modInverse() received a negative value or modulus. An attacker who could control the RSA public exponent passed to key generation, or a direct modInverse() operand, could block the Node.js event loop at full CPU. Parsed DER, PEM, JWK, PKCS#12, X.509, and TLS values are unsigned and cannot trigger this issue. 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:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L","score":2.9,"severity":null}],"references":["https://github.com/digitalbazaar/forge/security/advisories/GHSA-h6cr-wjv9-3cpp","https://github.com/digitalbazaar/forge/commit/e96c47b7f006dec66fb7bb1934e7375498b04a72","https://github.com/digitalbazaar/forge/releases/tag/v1.4.1"],"sourceUrl":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-113339","license":"ENISA EUVD · source terms and attribution apply","enrichment":{"sourceStatus":null,"weaknesses":[],"productCriteria":[],"sourceDates":{"datePublished":"Oct 29, 2026, 6:49:28 PM","dateUpdated":"Oct 30, 2026, 4:09:30 PM"},"relatedAdvisories":[{"id":"msrc_CVE-2026-118781","title":"Forge: Denial of Service via infinite loop in BigInteger.modInverse() with negative input (incomplete fix of CVE-2026-33891)","vulnerabilityIds":["CVE-2026-118781"]}],"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-113339","identifiers":["EUVD-2026-113339","CVE-2026-118781","GHSA-h6cr-wjv9-3cpp"]},"retained":false,"historicalAffected":[]},{"revision":"5bbb9facc9754b33bdda5145fdfbfbeb","observedAt":"2026-11-12T02:56:47.379+00:00","statement":{"source":"nvd","id":"CVE-2026-118781","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 BigInteger.prototype.modInverse(), bnModInverse(), lib/jsbn.js, RSA public exponent e to p…","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 BigInteger.prototype.modInverse(), bnModInverse(), lib/jsbn.js, RSA public exponent e to process the relevant input or security decision. node-forge's bundled jsbn implementation entered an infinite loop when BigInteger.prototype.modInverse() received a negative value or modulus. An attacker who could control the RSA public exponent passed to key generation, or a direct modInverse() operand, could block the Node.js event loop at full CPU. Parsed DER, PEM, JWK, PKCS#12, X.509, and TLS values are unsigned and cannot trigger this issue. This issue is fixed in version 1.4.1.","state":0,"publishedAt":"2026-10-29T19:17:20.843+00:00","modifiedAt":"2026-11-10T19:33:07.68+00:00","affected":[],"metrics":[{"system":"CVSS 3.1 · security-advisories@github.com · Secondary","vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L","score":2.9,"severity":"LOW"},{"system":"CVSS 3.1 · nvd@nist.gov · Primary","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","score":5.3,"severity":"MEDIUM"}],"references":["https://github.com/digitalbazaar/forge/commit/e96c47b7f006dec66fb7bb1934e7375498b04a72","https://github.com/digitalbazaar/forge/releases/tag/v1.4.1","https://github.com/digitalbazaar/forge/security/advisories/GHSA-h6cr-wjv9-3cpp"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2026-118781","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Analyzed","weaknesses":["CWE-835"],"productCriteria":["cpe:2.3:a:digitalbazaar:forge:*:*:*:*:*:node.js:*:*"],"sourceDates":{"published":"2026-10-29T19:17:20.843","lastModified":"2026-11-10T19:33:07.680"},"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-118781","identifiers":["CVE-2026-118781"]},"retained":false,"historicalAffected":[]},{"revision":"60a57a35ce1347d1b0924c21ae19b33f","observedAt":"2026-10-30T23:45:44.41+00:00","statement":{"source":"osv","id":"GHSA-h6cr-wjv9-3cpp","aliases":["CVE-2026-118781"],"title":"Forge: Denial of Service via infinite loop in BigInteger.modInverse() with negative input (incomplete fix of CVE-2026-33891)","description":"### Summary\n\n`BigInteger.prototype.modInverse()` in node-forge's bundled jsbn library enters an infinite loop when the value or the modulus is negative, for example when a negative public exponent is passed to `forge.pki.rsa.generateKeyPair()`. This is an incomplete fix of CVE-2026-33891 (GHSA-5m6q-g25r-mvwx), which handled only a zero value. Fixed in node-forge 1.4.1.\n\n### Details\n\n`bnModInverse()` (`lib/jsbn.js`, exposed as `forge.jsbn.BigInteger.prototype.modInverse`) implements the binary extended Euclidean algorithm (Handbook of Applied Cryptography, Algorithm 14.61), which is defined for positive integers. With a negative operand the loop cannot terminate: `rShiftTo` is an arithmetic shift, so a negative value never moves towards zero, and the loop's exit condition (`u` reaching zero) is never met. The calling thread spins at 100% CPU indefinitely; in Node.js this blocks the event loop. Memory does not grow.\n\nnode-forge 1.4.0 fixed CVE-2026-33891 (GHSA-5m6q-g25r-mvwx) by returning zero early when `this.signum() == 0`, although its changelog describes the check as \"<= 0\". Negative values were not covered, and a negative modulus was never handled. Every negative input that did terminate already returned zero.\n\nWithin node-forge, RSA key generation is the only path to a negative operand: the caller's public exponent `e` becomes `BigInteger.fromInt(e)`, and `state.e.modInverse(state.phi)` is called with it. `gcd()` works on absolute values, so the coprimality checks pass and the loop is reached. Any exponent other than 3 or 65537 uses the pure JavaScript implementation, even when `forge.options.usePureJavaScript` is not set. RFC 8017, Section 3.1 requires the RSA public exponent to be at least 3.\n\nValues that node-forge parses (DER, PEM, JWK, PKCS#12, X.509, TLS) are always read as unsigned integers and cannot produce a negative operand.\n\nThe fix makes `modInverse()` return zero when the value or the modulus is zero or negative, as it already does when no inverse exists. Results for positive inputs are unchanged.\n\nThis issue was reported by wzc.\n\n### Patches\nFixed in node-forge 1.4.1. `modInverse()` now returns zero when the value or the modulus is zero or negative.\n\n### Workarounds\n- Pass only fixed, valid RSA public exponents (e.g. 65537) to key generation, or validate caller-supplied exponents first: an odd integer `>= 3`.\n- Do not call `BigInteger#modInverse()` with negative operands. Reduce the value modulo a positive modulus first (`x.mod(m).modInverse(m)`).\n\n### Proof of concept\n\nA negative public exponent passed to RSA key generation never returns (also with the callback form and with `createKeyPairGenerationState()` / `stepKeyPairGenerationState()`):\n\n    var forge = require('node-forge');\n    forge.pki.rsa.generateKeyPair({bits: 256, e: -1});  // hangs at 100% CPU\n\nCalling `modInverse()` directly with a negative value or modulus hangs the same way:\n\n    var BigInteger = forge.jsbn.BigInteger;\n    new BigInteger('-1').modInverse(new BigInteger('7'));  // hangs\n    new BigInteger('3').modInverse(new BigInteger('-7'));  // hangs\n\nWith the fix, these calls return zero. The regression tests are in `tests/unit/jsbn.js`.\n\n### Impact\n\nApplications are affected only if they:\n- pass an untrusted value as the RSA public exponent `e` to `forge.pki.rsa.generateKeyPair()`, `forge.pki.rsa.createKeyPairGenerationState()` or `forge.pki.rsa.stepKeyPairGenerationState()`, or\n- call `forge.jsbn.BigInteger#modInverse()` directly with negative values derived from untrusted input.\n\nAn attacker who can supply such a value makes the call hang indefinitely at 100% CPU, which blocks the Node.js event loop (denial of service). Keys and other data parsed by node-forge (DER, PEM, JWK, PKCS#12, X.509, TLS) cannot trigger this issue, and the documented usage of key generation passes a constant exponent (65537). There is no effect on confidentiality or integrity.","state":0,"publishedAt":"2026-10-30T23:02:20+00:00","modifiedAt":"2026-10-30T23:15:04.4798468+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:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"LOW"}],"references":["https://github.com/digitalbazaar/forge/security/advisories/GHSA-h6cr-wjv9-3cpp","https://nvd.nist.gov/vuln/detail/CVE-2026-118781","https://github.com/digitalbazaar/forge/commit/e96c47b7f006dec66fb7bb1934e7375498b04a72","https://github.com/digitalbazaar/forge","https://github.com/digitalbazaar/forge/releases/tag/v1.4.1"],"sourceUrl":"https://github.com/advisories/GHSA-h6cr-wjv9-3cpp","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-h6cr-wjv9-3cpp","identifiers":["GHSA-h6cr-wjv9-3cpp","CVE-2026-118781"]},"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-17T01:28:27.0965740+00:00","complete":true,"records":1781,"lastAttemptAt":"2026-11-17T01:28:27.096574+00:00","lastSuccessAt":"2026-11-17T01:28:28.4221521+00:00","error":null,"lastVerifiedAt":"2026-11-17T01:28:28.4221557+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-6be044d0e08779dadd136f949a536de4047af96f5d7bceb7e190ecffbb8f18ca-7f01380692daf036eb95cf37e0827b298dda6a8bc54c53c0c4bb012cca452bdf","complete":true,"records":426226,"lastAttemptAt":"2026-11-17T01:25:59.2896812+00:00","lastSuccessAt":"2026-11-17T00:26:10.1968513+00:00","error":"InvalidOperationException","lastVerifiedAt":"2026-11-17T00:26:10.3468588+00:00","snapshotPublishedAt":"2026-11-16T23:28:27+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-a550a5b2fe99405b917b7acbef22bf7d","complete":false,"records":13835,"lastAttemptAt":"2026-11-17T01:29:03.4400088+00:00","lastSuccessAt":"2026-11-17T01:29:03.5835784+00:00","error":null,"lastVerifiedAt":"2026-11-17T01:29:03.5835784+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"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-17T01:28:27.0965740+00:00","complete":true,"records":1125,"lastAttemptAt":"2026-11-17T01:28:27.096574+00:00","lastSuccessAt":"2026-11-17T01:28:28.4228558+00:00","error":null,"lastVerifiedAt":"2026-11-17T01:28:28.4228591+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-d3fdfe99401b40cda0be0cd930f3e827","complete":true,"records":13848,"lastAttemptAt":"2026-11-17T01:28:41.7518641+00:00","lastSuccessAt":"2026-11-17T01:28:41.747+00:00","error":null,"lastVerifiedAt":"2026-11-17T01:28:41.747+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13889,"expectedIdentifiers":13889,"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-db3ae05f3e19425298b475ceb81e33f22d67df93dfef77c2b0200c8b05fd85ae","complete":true,"records":9958,"lastAttemptAt":"2026-11-17T01:28:26.8284261+00:00","lastSuccessAt":"2026-11-16T23:31:31.5526753+00:00","error":null,"lastVerifiedAt":"2026-11-17T01:28:26.8284261+00:00","snapshotPublishedAt":"2026-11-16T22:48:36+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-f4424d7d4861b1af1404bd15abcb83f295dcd003412a9340ca99dc8200aa148a","complete":true,"records":2014,"lastAttemptAt":"2026-11-17T01:25:59.4970103+00:00","lastSuccessAt":"2026-11-13T19:57:08.2864435+00:00","error":null,"lastVerifiedAt":"2026-11-17T01:25:59.4970103+00:00","snapshotPublishedAt":"2026-11-13T19:33:10+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-6086d649bcb454cdf302d7d9275177bda73550e1b6e446b3520e9b6266d3582c","complete":true,"records":3148,"lastAttemptAt":"2026-11-17T01:28:27.0507218+00:00","lastSuccessAt":"2026-11-15T11:05:17.1034234+00:00","error":null,"lastVerifiedAt":"2026-11-17T01:28:27.0507218+00:00","snapshotPublishedAt":"2026-11-15T10:03:04+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-294141b18c1acbece1382565ae027f05f4cb1267eab7744c58489f1a77bbeb6c","complete":true,"records":232560,"lastAttemptAt":"2026-11-17T01:28:25.22873+00:00","lastSuccessAt":"2026-11-17T01:28:24.1004066+00:00","error":null,"lastVerifiedAt":"2026-11-17T01:28:25.22873+00:00","snapshotPublishedAt":"2026-11-17T00:48:18+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}