{"vuln_id":"CVE-2026-85393","aliases":["CVE-2026-33894","GHSA-ppp5-5v6c-4jwp","GHSA-2g46-22mc-6gwp","GHSA-86w9-cpqp-85rv","CVE-2022-24771","GHSA-cfm4-qjh2-4765"],"description":"node-forge through 1.4.0 fails to validate element count in nested DigestAlgorithm sequences during RSA PKCS#1 v1.5 signature verification. Attackers can embed garbage bytes inside the DigestAlgorithm sequence to forge valid signatures for arbitrary messages using low-exponent RSA keys. This is an incomplete fix for CVE-2026-33894.","published_at":"2026-03-26T22:02:35Z","modified_at":"2026-11-21T20:11:10.745797Z","first_seen_at":"2026-11-21T19:15:46.687854Z","severity":"high","severity_source":"nvd","cvss_score":8.7,"cvss_vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","cwe":["CWE-347","CWE-20"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":0.0026,"epss_percentile":0.17806,"nvd_status":"Deferred","enriched_at":null,"links":{"nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-85393"},"matched_alias":null,"items":[{"id":11550,"source":{"id":"osv","name":"OSV.dev"},"title":"GHSA-86w9-cpqp-85rv: node-forge RSA PKCS#1 v1.5 signature verification accepts extra nested DigestAlgorithm elements","summary":"node-forge RSA PKCS#1 v1.5 signature verification accepts extra nested DigestAlgorithm elements\n\nnode-forge through 1.4.0 fails to validate element count in nested DigestAlgorithm sequences during RSA PKCS#1 v1.5 signature verification. Attackers can embed garbage bytes inside the DigestAlgorithm sequence to forge valid signatures for arbitrary messages using low-exponent RSA keys. This is an incomplete fix for CVE-2026-33894.\n\nAffected: npm:node-forge\n\nNo fixed version published yet\n\nReferences:\nhttps://nvd.nist.gov/vuln/detail/CVE-2026-85393\nhttps://github.com/digitalbazaar/forge/issues/1149\nhttps://github.com/digitalbazaar/forge/pull/1152\nhttps://github.com/advisories/GHSA-ppp5-5v6c-4jwp\nhttps://github.com/digitalbazaar/forge\nhttps://github.com/digitalbazaar/forge/blob/v1.4.0/lib/asn1.js\nhttps://github.com/digitalbazaar/forge/blob/v1.4.0/lib/rsa.js\nhttps://www.vulncheck.com/advisories/node-forge-through-1.4.0-rsa-pkcs-1-1.5-signature-forgery-via-nested-digestalgorithm-padding","url":"https://osv.dev/vulnerability/GHSA-86w9-cpqp-85rv","published_at":"2026-09-03T21:31:15Z","updated_at":"2026-11-21T20:11:10.745797Z","fetched_at":"2026-11-22T08:08:55.103912Z","severity":"high","cvss_score":8.7,"epss":0.00514,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"node-forge","vuln_id":"CVE-2026-33894","vuln_ids":["CVE-2022-24771","CVE-2026-33894","CVE-2026-85393","GHSA-2G46-22MC-6GWP","GHSA-86W9-CPQP-85RV","GHSA-CFM4-QJH2-4765","GHSA-PPP5-5V6C-4JWP"],"tags":["osv","npm","no-fix-yet"],"cluster_id":10718,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/11550","html":"https://vulnwatch.ve1ve2.com/item/11550"}},{"id":3503,"source":{"id":"nvd","name":"NVD CVE API 2.0"},"title":"CVE-2026-85393: node-forge through 1.4.0 fails to validate element count in nested DigestAlgorithm sequences during RSA PKCS#1 v1.5 signature verification. Attackers can embed…","summary":"node-forge through 1.4.0 fails to validate element count in nested DigestAlgorithm sequences during RSA PKCS#1 v1.5 signature verification. Attackers can embed garbage bytes inside the DigestAlgorithm sequence to forge valid signatures for arbitrary messages using low-exponent RSA keys. This is an incomplete fix for CVE-2026-33894.\n\nReferences:\nhttps://github.com/advisories/GHSA-ppp5-5v6c-4jwp\nhttps://github.com/digitalbazaar/forge\nhttps://github.com/digitalbazaar/forge/blob/v1.4.0/lib/asn1.js\nhttps://github.com/digitalbazaar/forge/blob/v1.4.0/lib/rsa.js\nhttps://github.com/digitalbazaar/forge/commit/2bce9d477a2ff436e86ff9694ae999f1552aa2bb\nhttps://github.com/digitalbazaar/forge/issues/1149\nhttps://github.com/digitalbazaar/forge/security/advisories/GHSA-2g46-22mc-6gwp\nhttps://www.vulncheck.com/advisories/node-forge-through-1.4.0-rsa-pkcs-1-1.5-signature-forgery-via-nested-digestalgorithm-padding\nhttps://github.com/advisories/GHSA-ppp5-5v6c-4jwp","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-85393","published_at":"2026-09-03T19:17:31.103000Z","updated_at":"2026-11-20T15:17:58.060000Z","fetched_at":"2026-11-21T19:15:31.479075Z","severity":"high","cvss_score":8.7,"epss":0.00514,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":null,"vuln_id":"CVE-2026-85393","vuln_ids":["CVE-2022-24771","CVE-2026-33894","CVE-2026-85393","GHSA-2G46-22MC-6GWP","GHSA-86W9-CPQP-85RV","GHSA-CFM4-QJH2-4765","GHSA-PPP5-5V6C-4JWP"],"tags":["CWE-347"],"cluster_id":3741,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/3503","html":"https://vulnwatch.ve1ve2.com/item/3503"}},{"id":10873,"source":{"id":"osv","name":"OSV.dev"},"title":"GHSA-ppp5-5v6c-4jwp: Forge has signature forgery in RSA-PKCS due to ASN.1 extra field","summary":"Forge has signature forgery in RSA-PKCS due to ASN.1 extra field\n\n## Summary\nRSASSA PKCS#1 v1.5 signature verification accepts forged signatures for low public exponent keys (e=3). Attackers can forge signatures by stuffing “garbage” bytes within the ASN structure in order to construct a signature that passes verification, enabling [Bleichenbacher style forgery](https://mailarchive.ietf.org/arch/msg/openpgp/5rnE9ZRN1AokBVj3VqblGlP63QE/). This issue is similar to [CVE-2022-24771](https://github.com/digitalbazaar/forge/security/advisories/GHSA-cfm4-qjh2-4765), but adds bytes in an addition field within the ASN structure, rather than outside of it. \n\nAdditionally, forge does not validate that signatures include a minimum of 8 bytes of padding as [defined by the specification](https://datatracker.ietf.org/doc/html/rfc2313#section-8), providing attackers additional space to construct Bleichenbacher forgeries. \n\n## Impacted Deployments\n**Tested commit:** `8e1d527fe8ec2670499068db783172d4fb9012e5`\n**Affected versions:** tested on v1.3.3 (latest release) and recent prior versions.\n\n**Configuration assumptions:**\n- Invoke key.verify with defaults (default `scheme` uses RSASSA-PKCS1-v1_5).\n- `_parseAllDigestBytes: true` (default setting).\n\n## Root Cause\n\nIn `lib/rsa.js`, `key.verify(...)`, forge decrypts the signature block, decodes PKCS#1 v1.5 padding (`_decodePkcs1_v1_5`), parses ASN.1, and compares `capture.digest` to the provided digest.\n\nTwo issues are present with this logic:\n\n1. Strict DER byte-consumption (`_parseAllDigestBytes`) only guarantees all bytes are parsed, not that the parsed structure is the canonical minimal DigestInfo shape expected by RFC 8017 verification semantics. A forged EM with attacker-controlled additional ASN.1 content inside the parsed container can still pass forge verification while OpenSSL rejects it.\n2. `_decodePkcs1_v1_5` comments mention that PS < 8 bytes should be rejected, but does not implement this logic.\n\n## Reproduction Steps\n1. Use Node.js (tested with `v24.9.0`) and clone `digitalbazaar/forge` at commit `8e1d527fe8ec2670499068db783172d4fb9012e5`.\n4. Place and run the PoC script (`repro_min.js`) with `node repro_min.js` in the same level as the `forge` folder.\n5. The script generates a fresh RSA keypair (`4096` bits, `e=3`), creates a normal control signature, then computes a forged candidate using cube-root interval construction.\n6. The script verifies both signatures with:\n  - forge verify (`_parseAllDigestBytes: true`), and\n  - Node/OpenSSL verify (`crypto.verify` with `RSA_PKCS1_PADDING`).\n7. Confirm output includes:\n  - `control-forge-strict: true`\n  - `control-node: true`\n  - `forgery (forge library, strict): true`\n  - `forgery (node/OpenSSL): false`\n\n## Proof of Concept\n\n**Overview:**\n- Demonstrates a valid control signature and a forged signature in one run.\n- Uses strict forge parsing mode explicitly (`_parseAllDigestBytes: true`, also forge default).\n- Uses Node/OpenSSL as an differential verification baseline.\n- Observed output on tested commit:\n\n```text\ncontrol-fo\n\nAffected: npm:node-forge\n\nFixed in: 1.4.0\n\nReferences:\nhttps://github.com/digitalbazaar/forge/security/advisories/GHSA-cfm4-qjh2-4765\nhttps://github.com/digitalbazaar/forge/security/advisories/GHSA-ppp5-5v6c-4jwp\nhttps://nvd.nist.gov/vuln/detail/CVE-2026-33894\nhttps://datatracker.ietf.org/doc/html/rfc2313#section-8\nhttps://github.com/digitalbazaar/forge\nhttps://mailarchive.ietf.org/arch/msg/openpgp/5rnE9ZRN1AokBVj3VqblGlP63QE\nhttps://www.rfc-editor.org/rfc/rfc8017.html","url":"https://osv.dev/vulnerability/GHSA-ppp5-5v6c-4jwp","published_at":"2026-03-26T22:02:35Z","updated_at":"2026-11-21T20:10:57.942510Z","fetched_at":"2026-11-21T19:15:55.946236Z","severity":"high","cvss_score":8.7,"epss":0.00779,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"node-forge","vuln_id":"CVE-2026-33894","vuln_ids":["CVE-2022-24771","CVE-2026-33894","CVE-2026-85393","GHSA-2G46-22MC-6GWP","GHSA-86W9-CPQP-85RV","GHSA-CFM4-QJH2-4765","GHSA-PPP5-5V6C-4JWP"],"tags":["osv","npm","fix-available"],"cluster_id":3743,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/10873","html":"https://vulnwatch.ve1ve2.com/item/10873"}}]}