Junglewise Threat Intelligence

CVE-2024-42461: Elliptic ECDSA signature malleability via BER encoding

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

Technologies: Indutny Elliptic. Vendors: npm.

Executive brief

The Elliptic cryptographic library, which provides ECDSA (Elliptic Curve Digital Signature Algorithm) functionality used in Node.js applications, incorrectly accepts BER-encoded signatures instead of requiring strict DER encoding. This allows attackers to craft alternative valid signatures for the same message, undermining cryptographic signature verification in applications that rely on Elliptic for blockchain, API authentication, or other signature-dependent security controls.

Technical details

The vulnerability is a signature malleability issue (CWE-347) in the Elliptic library's ECDSA signature parsing code. The root cause is missing validation checks in the DER signature decoding logic (lib/elliptic/ec/signature.js and lib/elliptic/eddsa/signature.js). Specifically, the code accepts BER-encoded signatures with leading zeros in length sequences, and fails to enforce that the leading bit of r and s values be zero as required by DER/ASN.1 encoding. No authentication is required—any application verifying ECDSA signatures using Elliptic is affected if it trusts non-canonical encodings. An attacker can create multiple valid signatures for the same message and private key, enabling signature confusion attacks or bypassing signature-verification-based access controls. The vulnerability was patched in version 6.5.7 (released August 2024); versions 5.2.1 through 6.5.6 are vulnerable.

Affected products

  • indutny elliptic 5.2.1 through 6.5.6

Timeline

  • 2024-08-02: disclosed: CVE-2024-42461 published
  • 2024-08-14: patched: Patch merged in v6.5.7 (indutny/elliptic#317)

References

Related threats