CVE-2024-42460: Elliptic ECDSA Signature Malleability in elliptic
Summary
CVE-2024-42460: Elliptic's ECDSA missing check for whether leading bit of r and s is zero. Affects elliptic versions >= 2.0.0, < 6.5.7. Fixed in 6.5.7. How to fix ↓
Also tracked for
- node-elliptic · Debian:11
The same CVE-2024-42460 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 elliptic package is a popular open-source library for Node.js that provides support for elliptic curve cryptography. It offers various cryptographic primitives, including key generation, signing, and verification. The package is widely used in applications that require secure communication and data integrity. However, a vulnerability has been discovered in version 6.5.6 of the elliptic package, which allows for ECDSA signature malleability.
Vulnerability Detail
The vulnerability in the elliptic package arises from a missing check for whether the leading bit of the 'r' and 's' values in an ECDSA signature is zero. This oversight allows for signature malleability, where an attacker can modify the signature without invalidating it. This can lead to various security issues, such as impersonation, message tampering, and unauthorized access. The vulnerability has a CVSSv3 score of 5.3, indicating a moderate severity level.
How To Fix
Latest published version: 6.6.1 as of 22 Oct 2026
npm install elliptic@6.6.1
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
6.5.7
This is the first release that contains the fix.
npm install elliptic@6.5.7
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If upgrading the package is not immediately feasible, a temporary workaround is to manually modify the affected code to include the missing check for the leading bit of 'r' and 's'. Here is an example of how the check can be added:
// Original code
const signature = ecdsa.sign(privateKey, message);
// Modified code with the check
const signature = ecdsa.sign(privateKey, message);
if (signature.r[0] & 0x80) signature.r[0] &= 0x7f;
if (signature.s[0] & 0x80) signature.s[0] &= 0x7f;
Conclusion
The elliptic package version 6.5.6 for Node.js is vulnerable to ECDSA signature malleability due to a missing check for the leading bit of 'r' and 's'. This vulnerability can lead to various security issues, including impersonation, message tampering, and unauthorized access. It is recommended to upgrade to version 6.5.7 or later to fix the vulnerability. If immediate upgrade is not possible, a temporary workaround is available by manually modifying the affected code. Developers should also consider using Vulert's playground to check if their application is affected by this vulnerability.
See every vulnerability recorded for elliptic →
FAQ
ECDSA signature malleability refers to the ability to modify an ECDSA signature without invalidating it. In the case of the elliptic package vulnerability, the missing check for the leading bit of 'r' and 's' allows for such modifications.
The vulnerability can lead to various security issues, including impersonation, message tampering, and unauthorized access. Attackers can modify signatures to bypass authentication mechanisms or alter the content of messages.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability. Vulert monitors and alerts in real-time for open-source vulnerabilities using package-lock.json without requiring access to the code or installation.
Yes, a fix is available for this vulnerability. It is recommended to upgrade the elliptic package to version 6.5.7 or later, which includes the necessary checks for the leading bit of 'r' and 's'.
Yes, a temporary workaround is to manually modify the affected code to include the missing check for the leading bit of 'r' and 's'. The provided example code demonstrates how to add the check.
References
Related vulnerabilities
Recent vulnerabilities recorded for elliptic.