CVE-2022-24772: Node forge Improper Verification Of Cryptographic Signature Vulnerability
HIGHCVE-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
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).
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.
npm install node-forge@1.3.0
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
CVE-2022-24772 Affected Node forge Versions
1 component(s)| 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?
Which Node forge versions are affected?
What version fixes CVE-2022-24772?
Is node-forge affected?
What is the CVSS score of CVE-2022-24772?
What CWE is associated with CVE-2022-24772?
How can I check npm dependencies for CVE-2022-24772?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}