CVE-2023-25653
Denial of Service vulnerability in node-jose (npm)

Denial of Service No known exploit

What is CVE-2023-25653 About?

This vulnerability in `node-jose` allows for a Denial-of-Service (DoS) condition in ECC operations when using the non-default 'fallback' crypto backend. An infinite loop can occur in internal calculations, either randomly or triggered by malicious input during ECDSA verification or ECDH key agreement. This can lead to application unresponsiveness, with moderate exploitation difficulty.

Affected Software

node-jose <2.2.0

Technical Details

The node-jose vulnerability affects its 'fallback' cryptographic implementation, specifically related to Elliptic Curve Cryptography (ECC) operations (ECDH and ECDSA) when neither WebCrypto nor Node's crypto module is available. The issue stems from the jsbn library's modInverse function, which can occasionally return negative results (though mathematically correct in modular arithmetic). The node-jose implementation of Barrett reduction in pointFpGetX() (via barrettReduce() in lib/deps/ecc/math.js) does not correctly handle these negative inputs, leading to an infinite loop during X-coordinate computation. For randomly generated inputs, this condition is rare (~2^-20 probability), but for inputs derived from external sources (e.g., public keys in ECDSA verification or ECDH key agreement), a malicious actor can craft input to deterministically trigger the infinite loop, causing a Denial of Service.

What is the Impact of CVE-2023-25653?

Successful exploitation may allow attackers to trigger an infinite loop in cryptographic operations, leading to a denial of service for the application.

What is the Exploitability of CVE-2023-25653?

Exploitation requires moderate complexity, as it relies on the application using the non-default 'fallback' crypto backend of node-jose. While some instances of the infinite loop are random, an attacker can craft malicious input for ECDSA verification or ECDH key agreement to trigger the vulnerability deterministically. No specific authentication is required if the vulnerable ECC operations are exposed to unauthenticated input. Privilege requirements are low. The attack can be remote if the application processes external cryptographic inputs (like public keys or signatures). The likelihood of exploitation is highly dependent on the application's environment and input validation; applications processing untrusted ECC parameters with the fallback backend are at higher risk.

What are the Known Public Exploits?

PoC Author Link Commentary
No known exploits

What are the Available Fixes for CVE-2023-25653?

Available Upgrade Options

  • node-jose
    • <2.2.0 → Upgrade to 2.2.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 CVE-2023-25653?

Similar Vulnerabilities: CVE-2023-25396 , CVE-2023-25381 , CVE-2023-45133 , CVE-2023-26118 , CVE-2022-38751