CVE-2024-48930: secp256k1 Vulnerability Allows Private Key Extraction Over ECDH

secp256k1 Updated 14 Dec 2025

Summary

21/10/2024
Yes i
High
8.7

CVE-2024-48930: secp256k1-node allows private key extraction over ECDH. Affects secp256k1 across 3 version ranges.

< 3.8.1 >= 4.0.0, < 4.0.4 >= 5.0.0, < 5.0.1

Fixed in 3.8.1, 4.0.4 or 5.0.1, depending on the release line you run. How to fix ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

secp256k1 is a widely used cryptographic library that implements the secp256k1 elliptic curve, primarily for Bitcoin and other cryptocurrencies. It provides functionalities for key generation, signing, and verification of transactions. The library is crucial for ensuring secure communications and transactions in blockchain technology. However, a vulnerability has been identified in specific versions of this library, which could allow attackers to extract private keys under certain conditions.

Vulnerability Detail

The vulnerability arises from the improper handling of compressed public keys in the elliptic-based version of the secp256k1 library. Specifically, the function 'loadCompressedPublicKey' lacks a crucial check to ensure that the public key is valid and lies on the elliptic curve. This oversight allows attackers to use public keys from low-cardinality curves to extract enough information to reconstruct the private key after conducting as few as 11 ECDH sessions. The implications of this vulnerability are severe, as it compromises the security of cryptographic operations, potentially leading to unauthorized access to sensitive information.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 3.8.1 3.8.1
    npm install secp256k1@3.8.1
  • >= 4.0.0, < 4.0.4 4.0.4
    npm install secp256k1@4.0.4
  • >= 5.0.0, < 5.0.1 5.0.1
    npm install secp256k1@5.0.1

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

As a temporary workaround, users should avoid using the elliptic version of the secp256k1 library until they can update to a patched version. Additionally, users can implement input validation to ensure that only valid public keys are processed.

Conclusion

The secp256k1 vulnerability CVE-2024-48930 poses a significant risk to applications relying on this library for cryptographic operations. It is crucial for developers to update to the latest patched versions and implement necessary workarounds to safeguard their applications against potential attacks.

See every vulnerability recorded for secp256k1 →

Share this vulnerability

FAQ

CVE-2024-48930 is a vulnerability in the secp256k1 library that allows attackers to extract private keys through improper handling of compressed public keys.

Versions of secp256k1 prior to 5.0.1, 4.0.4, and 3.8.1 are affected by this vulnerability.

You can use Vulert to monitor and alert for open-source vulnerabilities in your software. By analyzing your package-lock.json file, Vulert can identify if your application is affected by this vulnerability.

If you cannot update the package right away, avoid using the elliptic version of the secp256k1 library and implement input validation to filter out invalid public keys.

This vulnerability can lead to unauthorized access to sensitive data by allowing attackers to reconstruct private keys, thereby compromising the security of cryptographic operations.

Related vulnerabilities

Recent vulnerabilities recorded for secp256k1.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 3.8.1 3.8.1
    npm install secp256k1@3.8.1
  • >= 4.0.0, < 4.0.4 4.0.4
    npm install secp256k1@4.0.4
  • >= 5.0.0, < 5.0.1 5.0.1
    npm install secp256k1@5.0.1

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback