CVE-2022-24771: Improper Verification of Cryptographic Signature in node-forge
Summary
CVE-2022-24771: Improper Verification of Cryptographic Signature in node-forge. Affects node-forge versions < 1.3.0. Fixed in 1.3.0. How to fix ↓
Also tracked for
- node-node-forge · Debian:11
The same CVE-2022-24771 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The node-forge package is an implementation of cryptographic algorithms and utilities for JavaScript. It provides a set of APIs for working with RSA keys, certificates, and other cryptographic operations. This vulnerability affects versions prior to 1.3.0 of the node-forge package. The vulnerability lies in the RSA PKCS#1 v1.5 signature verification code, which is lenient in checking the digest algorithm structure. This leniency allows an attacker to craft a structure that steals padding bytes and utilizes an unchecked portion of the PKCS#1 encoded message to forge a signature, particularly when a low public exponent is being used.
Vulnerability Detail
The vulnerability in node-forge allows an attacker to forge a signature by exploiting the lenient verification of the digest algorithm structure. By crafting a specific structure, the attacker can steal padding bytes and manipulate the PKCS#1 encoded message to create a forged signature. This vulnerability can be particularly impactful when a low public exponent is used. The consequences of successful exploitation include the ability to bypass signature verification, leading to potential unauthorized access, data tampering, or impersonation attacks.
How To Fix
Latest published version: 1.4.0 as of 22 Oct 2026
npm install node-forge@1.4.0
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
1.3.0
This is the first release that contains the fix.
npm install node-forge@1.3.0
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
There are no known workarounds for this vulnerability. It is essential to upgrade to the patched version of the node-forge package to mitigate the risk.
Conclusion
The vulnerability in node-forge allows an attacker to forge signatures by exploiting lenient verification of the digest algorithm structure. To mitigate this risk, it is crucial to upgrade to version 1.3.0 or later of the node-forge package. This version includes the necessary patches to address the vulnerability. If you have any further questions or need assistance with vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for node-forge →
FAQ
The vulnerability allows an attacker to forge a signature, potentially leading to unauthorized access, data tampering, or impersonation attacks.
Versions prior to 1.3.0 of the node-forge package are affected.
To fix this vulnerability, upgrade to version 1.3.0 or later of the node-forge package.
No, there are no known workarounds for this vulnerability.
For more information, you can refer to the advisory in the forge GitHub repository or contact the forge team directly.
References
Related vulnerabilities
Recent vulnerabilities recorded for node-forge.