CVE-2024-48930: secp256k1-node allows private key extraction over ECDH
In elliptic
-based version, loadUncompressedPublicKey
has a check that the public key is on the curve: https://github.com/cryptocoinjs/secp256k1-node/blob/6d3474b81d073cc9c8cc8cfadb580c84f8df5248/lib/elliptic.js#L37-L39
loadCompressedPublicKey
is, however, missing that check: https://github.com/cryptocoinjs/secp256k1-node/blob/6d3474b81d073cc9c8cc8cfadb580c84f8df5248/lib/elliptic.js#L17-L19
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
References
Detect and mitigate CVE-2024-48930 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →