CVE-2024-48948
JavaScript vulnerability analysis and mitigation

Overview

The Elliptic package 6.5.7 for Node.js contains a vulnerability in its ECDSA implementation where it does not correctly verify valid signatures if the hash contains at least four leading 0 bytes and when the order of the elliptic curve's base point is smaller than the hash. This vulnerability, tracked as CVE-2024-48948, was discovered in October 2024 and leads to valid signatures being incorrectly rejected (NVD).

Technical details

The vulnerability stems from an anomaly in the _truncateToN function where the implementation incorrectly handles message digests with leading zero bytes. The issue occurs because the library converts messages to BN instances, which can report incorrect byteLength() values when the message has 8 or more leading zero bits. According to FIPS 186-5 section 6.4.2, the hash of the message must be adjusted based on the order n of the base point of the elliptic curve, but this adjustment is not properly implemented (GitHub PR).

Impact

The vulnerability causes legitimate transactions or communications to be incorrectly flagged as invalid. Research has shown that approximately 1 in 256 signatures with vulnerable curves are incorrect, and in some cases, such as with ECDSA over secp521r1 with SHA-512, it's possible to recover the private key from one faulty signature and the corresponding correct signature (GitHub Issue).

Mitigation and workarounds

The vulnerability has been fixed in version 6.6.0 of the Elliptic package. However, updating from the broken version to a correct implementation requires a key revocation, as users risk generating both correct and broken signatures during the transition. The fix involves properly handling message bit lengths and providing an optional msgBitLength parameter to both sign and verify functions (GitHub PR).

Community reactions

The vulnerability has gained attention from major organizations, with NetApp conducting investigations across their product line to identify potential impacts. The security community has actively discussed the implications, particularly focusing on the potential impact on systems using ethers 5, which depends on the affected elliptic package (NetApp Advisory).

Additional resources


SourceThis report was generated using AI

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management