Critical Private Key Extraction Vulnerability in Elliptic Package
Summary
GHSA-vjh7-7g9h-fjfh: Elliptic's private key extraction in ECDSA upon signing a malformed input (e.g. a string). Affects elliptic versions < 6.6.1. Fixed in 6.6.1. 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
Elliptic is a widely used JavaScript library that implements elliptic curve cryptography, providing functionalities for secure digital signatures and key generation. It is commonly utilized in applications requiring cryptographic operations, such as blockchain technologies and secure communications. However, a critical vulnerability has been identified that allows for the extraction of private keys when signing malformed inputs, posing significant security risks to applications relying on this library.
Vulnerability Detail
The vulnerability arises from the way the Elliptic library handles input types during the signing process. Specifically, when signing a malformed input (like a string or a number), the library can generate equivalent nonce values for different messages. This leads to the reuse of the nonce (k), which can be exploited to extract the private key from a pair of signatures. The attack can be executed by an adversary who controls the input message, allowing them to craft a malicious message that, when signed, reveals the private key. The issue is exacerbated by the library's acceptance of hex strings as valid input, which can lead to unintended consequences in message validation.
How To Fix
Latest published version: 6.6.1 as of 22 Oct 2026
npm install elliptic@6.6.1
The newest release already contains this fix.
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, avoid signing any unverified or attacker-controlled messages until you can update to the patched version. Ensure that all inputs to the signing function are validated and sanitized to prevent the signing of malformed data.
Conclusion
The identified vulnerability in the Elliptic package poses a significant risk by allowing private key extraction through the signing of malformed inputs. It is imperative for developers using this library to update to version 6.6.1 or later to mitigate this risk. Additionally, employing best practices in input validation can help prevent exploitation until the update is applied.
See every vulnerability recorded for elliptic →
FAQ
The vulnerability allows for the extraction of private keys when signing malformed inputs, due to nonce reuse during the signing process.
You can check if your application is affected by using Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Visit Vulert Scanner to use the Vulert playground without signup.
If you cannot update the package right away, avoid signing any unverified messages and ensure that all inputs are validated to mitigate the risk.
The primary consequence is the full extraction of private keys, which can lead to unauthorized access and compromise of sensitive data.
Yes, the vulnerability exists in all versions prior to 6.6.1. It is crucial to update to the latest version to ensure security.
References
Related vulnerabilities
Recent vulnerabilities recorded for elliptic.