CVE-2023-26115: word-wrap regular expression denial of service

CVE-2023-26115 · Severity: low · CVSS 3.1 · Published 2023-06-22

word-wrap is a popular JavaScript utility library used to format and wrap text at specified character widths. A flaw in its regular expression pattern can be exploited to cause severe CPU consumption and application hangs when processing specially crafted input, potentially leading to denial of service.

Vendors: npm.

Quick answers

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

  • word-wrap (npm): upgrade to 1.2.4 or later
    npm install word-wrap@1.2.4

Technical details

The vulnerability is a Regular Expression Denial of Service (ReDoS) flaw in the word-wrap library's result variable regex pattern. All versions prior to 1.2.4 contain an insecure regular expression that exhibits catastrophic backtracking when processing certain malformed input patterns. An attacker can supply specially crafted strings that trigger exponential regex evaluation, causing CPU exhaustion and application unavailability. The vulnerability requires no authentication and is exploitable via network-reachable input handling. A fix was released in version 1.2.4 via commit 420dce9.

Affected products

  • jonschlinkert word-wrap All versions before 1.2.4

Identifiers

  • CVE-2023-26115
  • GHSA-j8xg-fqg3-53r7

Timeline

  • 2023-06-22: disclosed: Vulnerability disclosed
  • 2023-06: patched: Fix released in version 1.2.4

References

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