CVE-2022-24773: Digital Bazaar node-forge signature forgery in RSA PKCS#1 v1.5

CVE-2022-24773 · Severity: low · CVSS 3.1 · Published 2022-03-18

node-forge is a widely used library for implementing secure communications and cryptography in JavaScript applications. A vulnerability in its signature verification process could allow an attacker to bypass security checks by providing a specially crafted digital signature. This could lead to unauthorized actions or the acceptance of fraudulent data as authentic, potentially compromising the integrity of the application.

Technologies: node-forge (npm). Vendors: npm.

Quick answers

Is CVE-2022-24773 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2022-24773 being exploited in the wild.
How severe is CVE-2022-24773?
Low severity, with a CVSS score of 3.1, published 18 March 2022.
Which products and versions are affected?
node-forge (npm) SEMVER:introduced=0,fixed=1.3.0.
Is there a fix for CVE-2022-24773?
Yes. node-forge (npm): upgrade to 1.3.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2022-24773 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2022-24773?
Check whether you run node-forge (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • node-forge (npm): upgrade to 1.3.0 or later
    npm install node-forge@1.3.0

Technical details

The RSA PKCS#1 v1.5 signature verification implementation in node-forge prior to version 1.3.0 is lenient when checking the DigestInfo ASN.1 structure. Specifically, it fails to strictly validate the structure and does not check for trailing garbage bytes after the DigestInfo. An attacker can exploit this leniency to forge signatures, particularly when a low public exponent is used, by crafting a structure that contains a valid digest but invalid ASN.1 formatting. This is a variation of the Bleichenbacher signature forgery attack. The issue was fixed in version 1.3.0 by making the DER parsing more strict and adding a validator for the RSASSA-PKCS-v1_5 DigestInfo structure.

Affected products

  • Digital Bazaar node-forge < 1.3.0

Identifiers

  • CVE-2022-24773
  • GHSA-2r2c-g63r-vccr

Timeline

  • 2022-03-17: patched: Fixed in version 1.3.0
  • 2022-03-18: disclosed: GitHub Advisory published

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.