Critical Vulnerability in node-forge: Lenient RSA PKCS#1 Signature Verification
Summary
CVE-2022-24771: Forge (also called node-forge) is a native implementation of Transport Layer Security in JavaScript. Affects node-node-forge across 2 version ranges.
< 0.10.0~dfsg-3+deb11u1
< 3f0b49a0573ef1bb7af7f5673c0cfebf00424df1
Fixed in 0.10.0~dfsg-3+deb11u1. How to fix ↓
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
node-forge is a native implementation of Transport Layer Security (TLS) in JavaScript, widely used for secure communications. It provides various cryptographic functionalities, including RSA key generation, encryption, and signature verification. The package is integral to applications requiring secure data transmission, making its integrity crucial. However, prior to version 1.3.0, node-forge exhibited a vulnerability in its RSA PKCS#1 v1.5 signature verification process, which could be exploited under certain conditions.
Vulnerability Detail
The vulnerability arises from lenient checks in the RSA PKCS#1 v1.5 signature verification code, specifically in the digest algorithm structure. An attacker could craft a malicious structure that steals padding bytes and utilizes unchecked portions of the PKCS#1 encoded message to forge a signature, particularly when a low public exponent is used. This could lead to unauthorized access or data manipulation, posing significant security risks to applications relying on node-forge for cryptographic operations.
How To Fix
Minimum fixed version
0.10.0~dfsg-3+deb11u1
This is the first release that contains the fix.
sudo apt-get install --only-upgrade node-node-forge
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
Currently, there are no known workarounds for this vulnerability. The best course of action is to upgrade to the fixed version as mentioned.
Conclusion
The vulnerability in node-forge's RSA PKCS#1 v1.5 signature verification poses significant security risks. Users are strongly advised to upgrade to version 1.3.0 or later to mitigate these risks. Regular monitoring for vulnerabilities using tools like Vulert can help maintain the security of your applications.
See every vulnerability recorded for node-node-forge →
FAQ
The CVSS score of this vulnerability is 7.5, indicating a high severity level.
Versions prior to 1.3.0 of node-forge are affected by this vulnerability.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
Exploitation of this vulnerability could allow attackers to forge signatures, leading to unauthorized access or manipulation of sensitive data.
Currently, there are no effective workarounds available. Upgrading to the fixed version is the recommended approach.
Related vulnerabilities
Recent vulnerabilities recorded for node-node-forge.