CVE-2022-24772: Node forge Improper Verification Of Cryptographic Signature Vulnerability

HIGH
Advisory Identifier: GHSA-x4jg-mjrx-434g
CVSS 7.5
CWE-347
Published
Advisory Summary

CVE-2022-24772 is a HIGH (CVSS 7.5) improper verification of cryptographic signature vulnerability (CWE-347: Improper Verification of Cryptographic Signature) affecting Node forge libraries in the npm ecosystem. The issue involves improper verification of cryptographic signature in node-forge. Remediation is available by upgrading affected packages to version 1.3.0.

CVE-2022-24772 at a Glance

CVE Identifier CVE-2022-24772
GHSA Identifier GHSA-x4jg-mjrx-434g
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-347: Improper Verification of Cryptographic Signature
Affected Product Node forge
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2022-24772

To remediate this vulnerability, upgrade all affected Node forge dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

node-forge fixed: 1.3.0
npm install node-forge@1.3.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls node-forge

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2022-24772, inspect your project dependencies using npm:

npm ls node-forge

Analyze the terminal output to locate any version of Node forge in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.3.0), your application is affected.

Note: The npm ls node-forge command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-347: Improper Verification of Cryptographic Signature, where the product does not verify, or incorrectly verifies, the cryptographic signature for data. In Node forge, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact RSA PKCS#1 v1.5 signature verification code does not check for tailing garbage bytes after decoding a `DigestInfo` ASN.1 structure. This can allow padding bytes to be removed and garbage data added to forge a signature when a low public exponent is being used. ### Patches The issue has been addressed in `node-forge` `1.3.0`. ### References For more information, please see ["Bleichenbacher's RSA signature forgery based on implementation error"](https://mailarchive.ietf.org/arch/msg/openpgp/5rnE9ZRN1AokBVj3VqblGlP63QE/) by Hal Finney. ### For more information If you have any questions or comments about this advisory: * Open an issue in [forge](https://github.com/digitalbazaar/forge) * Email us at [example email address](mailto:security@digitalbazaar.com)

CVE-2022-24772 Affected Node forge Versions

1 component(s)
Fixed Versions:
1.3.0
Product / Package Ecosystem Affected Versions Fixed Version
node-forge
npm
< 1.3.0
1.3.0

References

Frequently Asked Questions

What is CVE-2022-24772?
CVE-2022-24772 is a security vulnerability in Node forge involving Improper Verification of Cryptographic Signature in node-forge under CWE-347: Improper Verification of Cryptographic Signature.
Which Node forge versions are affected?
Affected versions include releases prior to 1.3.0 across affected packages: node-forge.
What version fixes CVE-2022-24772?
Upgrading to 1.3.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is node-forge affected?
Yes, node-forge is affected in releases prior to 1.3.0. Upgrade your dependency to 1.3.0 or later.
What is the CVSS score of CVE-2022-24772?
CVE-2022-24772 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2022-24772?
CVE-2022-24772 is classified under CWE-347: Improper Verification of Cryptographic Signature (The product does not verify, or incorrectly verifies, the cryptographic signature for data.).
How can I check npm dependencies for CVE-2022-24772?
Run the dependency tree command: 'npm ls node-forge'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-x4jg-mjrx-434g",
  "modified" : "2022-03-30T20:07:56Z",
  "published" : "2022-03-18T23:10:28Z",
  "aliases" : [ "CVE-2022-24772" ],
  "summary" : "Improper Verification of Cryptographic Signature in node-forge",
  "details" : "### Impact\n\nRSA PKCS#1 v1.5 signature verification code does not check for tailing garbage bytes after decoding a `DigestInfo` ASN.1 structure. This can allow padding bytes to be removed and garbage data added to forge a signature when a low public exponent is being used.\n\n### Patches\n\nThe issue has been addressed in `node-forge` `1.3.0`.\n\n### References\n\nFor more information, please see\n[\"Bleichenbacher's RSA signature forgery based on implementation error\"](https://mailarchive.ietf.org/arch/msg/openpgp/5rnE9ZRN1AokBVj3VqblGlP63QE/)\nby Hal Finney.\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n* Open an issue in [forge](https://github.com/digitalbazaar/forge)\n* Email us at [example email address](mailto:security@digitalbazaar.com)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "node-forge"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.3.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/digitalbazaar/forge/security/advisories/GHSA-x4jg-mjrx-434g"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-24772"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/digitalbazaar/forge/commit/3f0b49a0573ef1bb7af7f5673c0cfebf00424df1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/digitalbazaar/forge/commit/bb822c02df0b61211836472e29b9790cc541cdb2"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/digitalbazaar/forge"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-347" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-03-18T23:10:28Z",
    "nvd_published_at" : "2022-03-18T14:15:00Z"
  }
}