CVE-2023-25653: Cisco node-jose ECC infinite loop denial of service

CVE-2023-25653 · Severity: low · CVSS 3.1 · Published 2023-02-16

node-jose is a JavaScript library that implements JSON Object Signing and Encryption (JOSE) for securing API communications and data integrity. When using its non-default fallback cryptographic backend (in environments without WebCrypto or Node.js crypto module), improper handling of modular inverse calculations in elliptic curve cryptography can cause an infinite loop, crashing the service and making it unavailable to legitimate users.

Technologies: node-jose (npm). Vendors: npm.

Quick answers

Is CVE-2023-25653 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2023-25653 being exploited in the wild.
How severe is CVE-2023-25653?
Low severity, with a CVSS score of 3.1, published 16 February 2023.
Which products and versions are affected?
node-jose (npm) SEMVER:introduced=0,fixed=2.2.0.
Is there a fix for CVE-2023-25653?
Yes. node-jose (npm): upgrade to 2.2.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2023-25653 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2023-25653?
Check whether you run node-jose (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

  • node-jose (npm): upgrade to 2.2.0 or later
    npm install node-jose@2.2.0

Technical details

The vulnerability exists in the fallback elliptic curve cryptography implementation (lib/deps/ecc/math.js) used when WebCrypto and Node.js crypto modules are unavailable. The root cause is improper handling of negative results from the jsbn library's modInverse function. When modInverse returns a negative value (mathematically correct but requiring special handling), the barrettReduce function fails to handle it correctly, causing an infinite loop. This affects EC key generation, ECDSA signing/verification, and ECDH key agreement. For random EC operations, triggering the bug requires a random bad value (probability ~2^-20); for ECDSA verification and ECDH, attackers can provide malicious points to trigger it. The vulnerability requires the fallback crypto backend to be active; environments with WebCrypto or Node.js crypto are unaffected. A fix is available in version 2.2.0.

Affected products

  • Cisco node-jose < 2.2.0

Identifiers

  • CVE-2023-25653
  • GHSA-5h4j-qrvg-9xhw

Timeline

  • 2023-02-16: disclosed

References

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