{"id":"GHSA-jc66-7q78-782g","revision":null,"records":[{"revision":"ab68a51cb3494365852094a2fe31b040","observedAt":"2026-11-03T17:57:17.031+00:00","statement":{"source":"cve-program","id":"CVE-2026-118782","aliases":[],"title":"Forge: PKCS#12 MAC forgery and constant-key PBE via zero iteration count","description":"Forge (also called node-forge) is a native implementation of Transport Layer Security in JavaScript. Prior to 1.4.1, node-forge accepted a PKCS#12 MAC or PKCS#12 password-based encryption iteration count of zero or less. pki.pbe.generatePkcs12Key() then returned a constant key independent of the password and salt, allowing crafted PKCS#12 input processed by forge.pkcs12.pkcs12FromAsn1() to bypass password-based integrity checks. Predictable encryption keys and IVs also affected PKCS#12 PBE using pbeWithSHAAnd3-KeyTripleDES-CBC or pbewithSHAAnd40BitRC2-CBC, including shrouded key bags, encrypted SafeContents, and PKCS#8 ENCRYPTED PRIVATE KEY input processed independently by forge.pki.decryptPrivateKeyInfo(). PBES2/PBKDF2-encrypted content is unaffected. This issue is fixed in version 1.4.1.","state":0,"publishedAt":"2026-10-29T18:51:02.388+00:00","modifiedAt":"2026-11-03T16:21:42.988+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:H/A:N","score":7.5,"severity":"HIGH"}],"references":["https://github.com/digitalbazaar/forge/security/advisories/GHSA-jc66-7q78-782g","https://github.com/digitalbazaar/forge/commit/d9584aa56824972858366d5187b3d29e46bf3656","https://github.com/digitalbazaar/forge/releases/tag/v1.4.1"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-118782","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-118782","identifiers":["CVE-2026-118782"]},"retained":false,"historicalAffected":[]},{"revision":"dd2368eefc8443619966bca24ffed757","observedAt":"2026-11-16T08:34:35.252+00:00","statement":{"source":"euvd","id":"EUVD-2026-113341","aliases":["CVE-2026-118782","GHSA-jc66-7q78-782g"],"title":"Forge (also called node-forge) is a native implementation of Transport Layer Security in JavaScript. Prior to 1.4.1, node-forge accepted a PKCS#12 MAC or PKCS#12 password-based encryption iteration count of zero or less. pki.pbe.generatePkc…","description":"Forge (also called node-forge) is a native implementation of Transport Layer Security in JavaScript. Prior to 1.4.1, node-forge accepted a PKCS#12 MAC or PKCS#12 password-based encryption iteration count of zero or less. pki.pbe.generatePkcs12Key() then returned a constant key independent of the password and salt, allowing crafted PKCS#12 input processed by forge.pkcs12.pkcs12FromAsn1() to bypass password-based integrity checks. Predictable encryption keys and IVs also affected PKCS#12 PBE using pbeWithSHAAnd3-KeyTripleDES-CBC or pbewithSHAAnd40BitRC2-CBC, including shrouded key bags, encrypted SafeContents, and PKCS#8 ENCRYPTED PRIVATE KEY input processed independently by forge.pki.decryptPrivateKeyInfo(). PBES2/PBKDF2-encrypted content is unaffected. 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:H/A:N","score":7.5,"severity":null}],"references":["https://github.com/digitalbazaar/forge/security/advisories/GHSA-jc66-7q78-782g","https://github.com/digitalbazaar/forge/commit/d9584aa56824972858366d5187b3d29e46bf3656","https://github.com/digitalbazaar/forge/releases/tag/v1.4.1"],"sourceUrl":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-113341","license":"ENISA EUVD · source terms and attribution apply","enrichment":{"sourceStatus":null,"weaknesses":[],"productCriteria":[],"sourceDates":{"datePublished":"Oct 29, 2026, 6:51:02 PM","dateUpdated":"Nov 3, 2026, 4:21:42 PM"},"relatedAdvisories":[{"id":"msrc_CVE-2026-118782","title":"Forge: PKCS#12 MAC forgery and constant-key PBE via zero iteration count","vulnerabilityIds":["CVE-2026-118782"]}],"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-113341","identifiers":["EUVD-2026-113341","CVE-2026-118782","GHSA-jc66-7q78-782g"]},"retained":false,"historicalAffected":[]},{"revision":"91c1ffbe2b224fa585fa84d9156dd885","observedAt":"2026-11-12T02:56:47.379+00:00","statement":{"source":"nvd","id":"CVE-2026-118782","aliases":[],"title":"Forge (also called node-forge) is a native implementation of Transport Layer Security in JavaScript. Prior to 1.4.1, node-forge accepted a PKCS#12 MAC or PKCS#12 password-based encryption iteration count of zero or less. pki.pbe.generatePkc…","description":"Forge (also called node-forge) is a native implementation of Transport Layer Security in JavaScript. Prior to 1.4.1, node-forge accepted a PKCS#12 MAC or PKCS#12 password-based encryption iteration count of zero or less. pki.pbe.generatePkcs12Key() then returned a constant key independent of the password and salt, allowing crafted PKCS#12 input processed by forge.pkcs12.pkcs12FromAsn1() to bypass password-based integrity checks. Predictable encryption keys and IVs also affected PKCS#12 PBE using pbeWithSHAAnd3-KeyTripleDES-CBC or pbewithSHAAnd40BitRC2-CBC, including shrouded key bags, encrypted SafeContents, and PKCS#8 ENCRYPTED PRIVATE KEY input processed independently by forge.pki.decryptPrivateKeyInfo(). PBES2/PBKDF2-encrypted content is unaffected. This issue is fixed in version 1.4.1.","state":0,"publishedAt":"2026-10-29T19:17:20.983+00:00","modifiedAt":"2026-11-10T19:31:20.77+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:H/A:N","score":7.5,"severity":"HIGH"}],"references":["https://github.com/digitalbazaar/forge/commit/d9584aa56824972858366d5187b3d29e46bf3656","https://github.com/digitalbazaar/forge/releases/tag/v1.4.1","https://github.com/digitalbazaar/forge/security/advisories/GHSA-jc66-7q78-782g"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2026-118782","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Analyzed","weaknesses":["CWE-354","CWE-1284"],"productCriteria":["cpe:2.3:a:digitalbazaar:forge:*:*:*:*:*:node.js:*:*"],"sourceDates":{"published":"2026-10-29T19:17:20.983","lastModified":"2026-11-10T19:31:20.770"},"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-118782","identifiers":["CVE-2026-118782"]},"retained":false,"historicalAffected":[]},{"revision":"f48a4e3468a94a4a8a4674e01d35dbc4","observedAt":"2026-10-30T23:45:44.41+00:00","statement":{"source":"osv","id":"GHSA-jc66-7q78-782g","aliases":["CVE-2026-118782"],"title":"Forge: PKCS#12 MAC forgery and constant-key PBE via zero iteration count","description":"### Summary\n\nforge.pkcs12.pkcs12FromAsn1() accepts a PKCS#12 MAC iteration count of zero (or less) from the input, and the PKCS#12 key derivation function then returns a constant key that does not depend on the password or salt. An attacker who does not know the password can modify a PKCS#12/PFX file and compute a MAC that verifies with any password; PKCS#12 PBE-encrypted private keys prepared the same way decrypt with any password. Fixed in node-forge 1.4.1.\n\n### Details\n\n`p12.pkcs12FromAsn1()` in `lib/pkcs12.js` reads the MAC iteration count (`MacData.iterations`) from the input and passes it to the PKCS#12 key derivation function `pki.pbe.generatePkcs12Key()` in `lib/pbe.js` (also exposed as `forge.pkcs12.generateKey()`) without checking that it is at least 1. The key derivation function (RFC 7292 Appendix B.2) runs its hash loop `iter` times. With an iteration count of 0 (or an empty or negative INTEGER), no hashing is done and the function returns the PKCS#12 diversifier ID byte repeated, for example `0x03` repeated 20 times for an HMAC-SHA1 MAC key. The result does not depend on the password or the salt, so anyone can compute a valid MAC over arbitrary PFX contents.\n\nThe same key derivation function is used by `pki.pbe.getCipherForPKCS12PBE()` for the PKCS#12 password-based encryption schemes `pbeWithSHAAnd3-KeyTripleDES-CBC` and `pbewithSHAAnd40BitRC2-CBC`, whose `pkcs-12PbeParams` iteration count is also read from the input. With an iteration count of 0 or less, the encryption key and IV are constants (`0x01` and `0x02` repeated). This is reached from shrouded key bags and encrypted SafeContents in `pkcs12FromAsn1()`, and from `forge.pki.decryptPrivateKeyInfo()` (for example for `ENCRYPTED PRIVATE KEY` PEM input).\n\nRFC 7292 defines `MacData` with `iterations INTEGER DEFAULT 1`; an iteration count only makes sense as 1 or more (RFC 8018 uses `INTEGER (1..MAX)` for the same concept). PBES2 (PBKDF2) encrypted content is not affected.\n\nThe fix rejects iteration counts less than 1 when verifying a PKCS#12 MAC in `pkcs12FromAsn1()` (\"PKCS#12 MAC iteration count must be >= 1.\") and at the entry of `pki.pbe.generatePkcs12Key()` (\"PKCS#12 key derivation iteration count must be >= 1.\"), which covers the MAC, both PKCS#12 PBE schemes and direct `forge.pkcs12.generateKey()` callers.\n\n### Patches\nFixed in node-forge 1.4.1. Iteration counts less than 1 are now rejected when verifying a PKCS#12 MAC and in the PKCS#12 key derivation function.\n\n### Workarounds\nBefore calling `forge.pkcs12.pkcs12FromAsn1()`, reject inputs whose `MacData.iterations` is present and less than 1. For encrypted private keys using the PKCS#12 PBE schemes, there is no simple workaround other than checking the `pkcs-12PbeParams` iteration count before decryption, or upgrading.\n\n### Credits\nReported by Thai, Calif.io in collaboration with Claude and Anthropic Research.\n\n### Proof of concept\n\nTake any PKCS#12/PFX file, replace its AuthenticatedSafe with attacker-chosen content (for example the attacker's certificate and an unencrypted private key), set `MacData.iterations` to 0 (DER `02 01 00`), and compute the HMAC-SHA1 over the new content with the key `0x03` repeated 20 times. On node-forge <= 1.4.0, `forge.pkcs12.pkcs12FromAsn1(asn1, password)` reports successful MAC verification for whatever password the application supplies and returns the attacker's certificate and key. An empty or negative iteration count behaves the same way. Likewise, a shrouded key bag or `ENCRYPTED PRIVATE KEY` using `pbeWithSHAAnd3-KeyTripleDES-CBC` with iteration count 0 decrypts with any password.\n\nThe constant key is visible directly:\n\n```js\nvar salt = new forge.util.ByteBuffer('anysalt');\nforge.pkcs12.generateKey('any password', salt, 3, 0, 20).toHex();\n// <= 1.4.0: '0303030303030303030303030303030303030303'\n// 1.4.1: throws \"PKCS#12 key derivation iteration count must be >= 1.\"\n```\n\nThe fix adds regression tests in `tests/unit/pkcs12.js` and the reporter's PoC in `tests/pocs/`.\n\n### Impact\n\nApplications that import PKCS#12/PFX files or PKCS#8 encrypted private keys from untrusted sources with `forge.pkcs12.pkcs12FromAsn1()` or `forge.pki.decryptPrivateKeyInfo()`, and rely on the password-based MAC or on successful decryption to establish that the file was produced by someone who knows the password. The default API and call pattern are affected; no password, oracle or user interaction is needed, only one offline HMAC.\n\nAn attacker can supply a PKCS#12 file with certificates and private keys of their choice (for example, replaced certificates or an unencrypted private key) that node-forge reports as verified under the application's password. The attacker does not learn the password or the original private key. PBES2 (PBKDF2) encrypted content is not affected.","state":0,"publishedAt":"2026-10-30T23:02:05+00:00","modifiedAt":"2026-10-30T23:15:04.5129361+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:H/A:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"HIGH"}],"references":["https://github.com/digitalbazaar/forge/security/advisories/GHSA-jc66-7q78-782g","https://nvd.nist.gov/vuln/detail/CVE-2026-118782","https://github.com/digitalbazaar/forge/commit/d9584aa56824972858366d5187b3d29e46bf3656","https://github.com/digitalbazaar/forge","https://github.com/digitalbazaar/forge/releases/tag/v1.4.1"],"sourceUrl":"https://github.com/advisories/GHSA-jc66-7q78-782g","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-jc66-7q78-782g","identifiers":["GHSA-jc66-7q78-782g","CVE-2026-118782"]},"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-16T14:44:51.0354681+00:00","complete":true,"records":1781,"lastAttemptAt":"2026-11-16T14:44:51.0354681+00:00","lastSuccessAt":"2026-11-16T14:44:51.2191988+00:00","error":null,"lastVerifiedAt":"2026-11-16T14:44:51.2191997+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-c7e42aebd80e0c2307ddc550ecef29877d1c8891eaea04fabfc75498ab1ffe9c","complete":true,"records":426004,"lastAttemptAt":"2026-11-16T14:44:50.7345962+00:00","lastSuccessAt":"2026-11-16T14:44:50.6847077+00:00","error":null,"lastVerifiedAt":"2026-11-16T14:44:50.7345962+00:00","snapshotPublishedAt":"2026-11-16T14:31:19+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-e7b8d43557f44ad0b4e0a87d8bc9833b","complete":true,"records":13821,"lastAttemptAt":"2026-11-16T14:45:17.0377344+00:00","lastSuccessAt":"2026-11-16T13:45:32.439+00:00","error":null,"lastVerifiedAt":"2026-11-16T13:45:32.439+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13874,"expectedIdentifiers":13874,"failedIdentifiers":0},{"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-16T14:44:51.0354681+00:00","complete":true,"records":1125,"lastAttemptAt":"2026-11-16T14:44:51.0354681+00:00","lastSuccessAt":"2026-11-16T14:44:51.2200779+00:00","error":null,"lastVerifiedAt":"2026-11-16T14:44:51.2200784+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-4b206dc3f3fc4572b101aa266f730110","complete":false,"records":13833,"lastAttemptAt":"2026-11-16T14:45:16.4505777+00:00","lastSuccessAt":"2026-11-16T14:45:16.447+00:00","error":"300 identifier lookups failed; latest failures include HttpError (HTTP 503). Other identifiers were checked independently.","lastVerifiedAt":"2026-11-16T14:45:16.447+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13574,"expectedIdentifiers":13874,"failedIdentifiers":300},{"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-64eea06dbd27de8464d5dbce1b78cc794cc59e2d901516ae0d3ea76e624cdae0","complete":true,"records":9955,"lastAttemptAt":"2026-11-16T14:44:50.9903861+00:00","lastSuccessAt":"2026-11-14T13:57:23.1208135+00:00","error":null,"lastVerifiedAt":"2026-11-16T14:44:50.9903861+00:00","snapshotPublishedAt":"2026-11-14T13:17: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-f4424d7d4861b1af1404bd15abcb83f295dcd003412a9340ca99dc8200aa148a","complete":true,"records":2014,"lastAttemptAt":"2026-11-16T14:44:50.781369+00:00","lastSuccessAt":"2026-11-13T19:57:08.2864435+00:00","error":null,"lastVerifiedAt":"2026-11-16T14:44:50.781369+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-16T14:44:51.0024803+00:00","lastSuccessAt":"2026-11-15T11:05:17.1034234+00:00","error":null,"lastVerifiedAt":"2026-11-16T14:44:51.0024803+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-263d9c8d63997345727b11314d9b9377eba9fd4146f04497c069a15e332b60cb","complete":true,"records":232482,"lastAttemptAt":"2026-11-16T14:44:50.8876074+00:00","lastSuccessAt":"2026-11-16T07:32:30.5701252+00:00","error":null,"lastVerifiedAt":"2026-11-16T14:44:50.8876074+00:00","snapshotPublishedAt":"2026-11-16T06:48:00+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}