SNYK-JS-VALIDATOR-1090600
Private Key Extraction vulnerability in validator (npm)

Private Key Extraction No known exploit Fixable By Resolved Security

What is SNYK-JS-VALIDATOR-1090600 About?

This vulnerability in the `elliptic` library allows for the extraction of a private key from an ECDSA signature. It occurs when a malformed input (like a string or number) is signed, which can lead to `k` reuse. Successful exploitation results in full private key compromise.

Affected Software

validator >11.1.0, <13.7.0

Technical Details

The vulnerability stems from the elliptic library's handling of input messages (msg) during the ECDSA signing process. While msg is converted to a BN (BigNumber) instance, the nonce calculation can generate equivalent arrays for different BN instances if the input is malformed (e.g., a string or number instead of a proper buffer/Uint8Array). This can lead to the reuse of the ephemeral secret k (nonce) across different signatures. When the same k is used to sign two different messages, mathematical properties of ECDSA allow for the recovery of the private key. An attacker can construct a malicious message that, when signed, will leak the private key after observing two such signatures with reused k values.

What is the Impact of SNYK-JS-VALIDATOR-1090600?

Successful exploitation may allow attackers to fully extract the private key associated with the ECDSA signature, leading to impersonation, unauthorized signing of transactions or data, and complete compromise of cryptographic assurances.

What is the Exploitability of SNYK-JS-VALIDATOR-1090600?

Exploitation complexity is high, requiring the ability to control the message input into the ECDSA signing function and observe at least two signatures using the same k value. No authentication is directly required for the library itself, but the context in which signing occurs (e.g., a web service) may have authentication. Privilege requirements are low in terms of system access, but high in terms of influencing cryptographic operations. This is a remote attack if the attacker can feed arbitrary input to a signing service. The primary condition is that the application uses elliptic to sign unverified, attacker-controlled messages that might be malformed (e.g., non-Uint8Array types from JSON input). Risk factors include applications that sign JSON network inputs without strict type enforcement on message data.

What are the Known Public Exploits?

PoC Author Link Commentary
No known exploits

What are the Available Fixes for SNYK-JS-VALIDATOR-1090600?

A Fix by Resolved Security Exists!
Fix open-source vulnerabilities without upgrading your dependencies.

About the Fix from Resolved Security

The patch modifies the regular expression in isSlug to remove a capturing group with a quantifier, eliminating excessive backtracking and thus preventing a Regular Expression Denial of Service (ReDoS) vulnerability. This change addresses SNYK-JS-VALIDATOR-1090600 by ensuring that maliciously crafted long inputs no longer cause catastrophic performance degradation in the slug validation logic.

Available Upgrade Options

  • validator
    • >11.1.0, <13.7.0 → Upgrade to 13.7.0

Struggling with dependency upgrades?

See how Resolved Security's drop-in replacements make it simple.

Book a demo

Additional Resources

What are Similar Vulnerabilities to SNYK-JS-VALIDATOR-1090600?

Similar Vulnerabilities: CVE-2024-42461 , CVE-2024-28203 , CVE-2023-38406 , CVE-2022-44640 , CVE-2020-24915