CVE-2024-42460

5.3 MEDIUM

📋 TL;DR

This vulnerability in the Elliptic package for Node.js allows attackers to create multiple valid signatures for the same message due to missing validation of leading zeros in ECDSA signature components. This affects any application using Elliptic 6.5.6 for cryptographic operations, potentially compromising signature verification systems.

💻 Affected Systems

Products:
  • elliptic npm package
Versions: Version 6.5.6 specifically
Operating Systems: All operating systems running Node.js
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects applications using ECDSA signature verification from the elliptic package. Applications using other cryptographic libraries or different signature algorithms are not affected.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Signature forgery leading to authentication bypass, transaction manipulation in blockchain applications, or compromise of systems relying on ECDSA signatures for security decisions.

🟠

Likely Case

Signature malleability attacks where attackers can create alternative valid signatures, potentially bypassing signature uniqueness requirements in applications like cryptocurrency transactions or document signing systems.

🟢

If Mitigated

Limited impact if applications implement additional signature validation or use signature schemes that are resilient to malleability.

🌐 Internet-Facing: MEDIUM - Applications exposing signature verification endpoints could be targeted, but exploitation requires specific conditions and understanding of the application's signature handling.
🏢 Internal Only: LOW - Internal systems using ECDSA signatures could be affected, but exploitation would require internal access and specific knowledge of signature implementation.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires understanding of ECDSA signature format and the ability to modify signature data before verification. Attackers need to know how the target application processes signatures.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 6.5.7 and later

Vendor Advisory: https://github.com/indutny/elliptic/pull/317

Restart Required: Yes

Instructions:

1. Update elliptic package: npm update elliptic
2. Verify version is 6.5.7 or higher: npm list elliptic
3. Restart Node.js applications using the elliptic package
4. Test signature verification functionality

🔧 Temporary Workarounds

Implement custom signature validation

all

Add validation to check that r and s components don't have leading zeros before using elliptic's verify function

// JavaScript code to validate signatures before verification
function validateSignature(signature) {
  // Check that r and s don't start with 0x00
  // Implement based on your signature format
}

🧯 If You Can't Patch

  • Implement additional signature validation in application code to reject signatures with leading zeros in r and s components
  • Monitor for unusual signature patterns or multiple valid signatures for the same message

🔍 How to Verify

Check if Vulnerable:

Check package.json or run: npm list elliptic | grep elliptic

Check Version:

npm list elliptic | grep elliptic

Verify Fix Applied:

Verify elliptic version is 6.5.7 or higher: npm list elliptic

📡 Detection & Monitoring

Log Indicators:

  • Multiple successful signature verifications for same message with different signatures
  • Signature validation errors related to format issues

Network Indicators:

  • Unusual patterns in signature-based API calls
  • Repeated signature submissions with minor variations

SIEM Query:

Search for application logs containing signature verification failures or multiple successful verifications of the same data

🔗 References

📤 Share & Export