CVE-2024-48930 secp256k1-node vulnerable to private key extraction over ECDH

High 8.7 Published Updated

An attacker can extract private keys by exploiting missing curve validation in compressed public key loading during ECDH sessions.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2024-48930?

CVE-2024-48930 is a high-severity vulnerability in cryptocoinjs secp256k1-node, published on 21 Oct 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

secp256k1-node is a Node.js binding for an Optimized C library for EC operations on curve secp256k1. In `elliptic`-based version, `loadUncompressedPublicKey` has a check that the public key is on the curve. Prior to versions 5.0.1, 4.0.4, and 3.8.1, however, `loadCompressedPublicKey` is missing that check. That allows the attacker to use public keys on low-cardinality curves to extract enough information to fully restore the private key from as little as 11 ECDH sessions, and very cheaply on compute power. Other operations on public keys are also affected, including e.g. `publicKeyVerify()` incorrectly returning `true` on those invalid keys, and e.g. `publicKeyTweakMul()` also returning predictable outcomes allowing to restore the tweak. Versions 5.0.1, 4.0.4, and 3.8.1 contain a fix for the issue.

Weakness: CWE-354

Which versions are affected by CVE-2024-48930?

6 open source packages ship an affected version, including secp256k1.

PackageAffectedFixed in
secp256k1 npmAll versions3.8.1
secp256k1 npmAll versions3.8.1
secp256k1 npmFrom 4.0.04.0.4
secp256k1 npmFrom 4.0.04.0.4
secp256k1 npmFrom 5.0.05.0.1
secp256k1 npmFrom 5.0.05.0.1

How do I fix CVE-2024-48930?

Upgrade secp256k1 to a fixed version for your release line: 3.8.1, 4.0.4 or 5.0.1.

Is CVE-2024-48930 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-48930 exists.

Sources

Also known as GHSA-584q-6j8j-r5pm.

Is CVE-2024-48930 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free