CVE-2024-42460: Elliptic ECDSA signature malleability in DER parsing

CVE-2024-42460 · Severity: low · CVSS 3.1 · Published 2024-08-02

Elliptic is a widely-used cryptographic library for ECDSA digital signature operations in Node.js applications. The library fails to validate that the leading bit of ECDSA signature components (r and s values) is zero during DER decoding, allowing malleability of signatures and potential acceptance of non-canonical encodings. This could enable attackers to create alternate valid signatures for the same message, undermining signature uniqueness guarantees.

Technologies: elliptic (npm). Vendors: npm.

Quick answers

Is CVE-2024-42460 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2024-42460 being exploited in the wild.
How severe is CVE-2024-42460?
Low severity, with a CVSS score of 3.1, published 2 August 2024.
Which products and versions are affected?
elliptic (npm) SEMVER:introduced=2.0.0,fixed=6.5.7.
Is there a fix for CVE-2024-42460?
Yes. elliptic (npm): upgrade to 6.5.7 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2024-42460 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2024-42460?
Check whether you run elliptic (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • elliptic (npm): upgrade to 6.5.7 or later
    npm install elliptic@6.5.7

Technical details

The vulnerability is a missing validation check in ECDSA DER signature decoding (CWE-130: Improper Handling of Length Parameters). The elliptic library fails to enforce that the leading bit of the r and s components must be zero during ASN.1 DER decoding, which is required by the DER standard to ensure canonical encoding. Additionally, the library's `getLength` function allows BER-encoded length sequences with leading zeros, deviating from strict DER compliance. An attacker with network access can craft non-canonical signature encodings that the library will accept as valid, creating signature malleability. No user interaction or authentication is required. The issue was introduced in version 2.0.0 and patched in version 6.5.7 (fix merged August 2024).

Affected products

  • elliptic elliptic 2.0.0 through 6.5.6

Identifiers

  • CVE-2024-42460
  • GHSA-977x-g7h5-7qgw

Timeline

  • 2024-08-02: disclosed: Advisory published on GitHub Security Advisory and NVD
  • 2024-08-14: patched: Fix merged in PR #317, released in version 6.5.7
  • 2024-10-04: other: NetApp security advisory issued

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.