CVE-2023-26115: word-wrap vulnerable to Regular Expression Denial of Service

word-wrap Updated 02 Oct 2025

Summary

22/06/2023
Yes i
Moderate
5.3

CVE-2023-26115: word-wrap vulnerable to Regular Expression Denial of Service. Affects word-wrap versions < 1.2.4. Fixed in 1.2.4. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

The word-wrap package is an npm package that provides a utility function for wrapping text to a specified width. It is commonly used in JavaScript applications to format text output. The package is vulnerable to Regular Expression Denial of Service (ReDoS) due to the usage of an insecure regular expression within the result variable.

Vulnerability Detail

The vulnerability in word-wrap arises from the insecure regular expression used in the result variable. This can be exploited by an attacker to cause a denial of service (DoS) attack by providing specially crafted input that triggers excessive backtracking in the regular expression engine. This can lead to the application becoming unresponsive or crashing. The severity of this vulnerability is moderate, with a CVSS score of 5.3.

How To Fix

Latest published version: 1.2.5 as of 22 Oct 2026

npm install word-wrap@1.2.5

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.2.4

This is the first release that contains the fix.

npm install word-wrap@1.2.4

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no known workaround for this vulnerability. It is recommended to update the package to the fixed version as soon as possible.

Conclusion

The word-wrap package is vulnerable to Regular Expression Denial of Service (ReDoS) due to an insecure regular expression. It is recommended to update the package to version 1.2.4 or later to fix this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for word-wrap →

Share this vulnerability

FAQ

word-wrap is an npm package that provides a utility function for wrapping text to a specified width. It is commonly used in JavaScript applications to format text output.

Regular Expression Denial of Service (ReDoS) is a type of denial of service attack that targets applications using regular expressions. It exploits the exponential time complexity of certain regular expressions to cause the application to become unresponsive or crash.

This vulnerability can be exploited by an attacker to cause a denial of service (DoS) attack by providing specially crafted input that triggers excessive backtracking in the regular expression engine. This can lead to the application becoming unresponsive or crashing.

The severity of this vulnerability is moderate, with a CVSS score of 5.3.

To fix this vulnerability, it is recommended to update the word-wrap package to version 1.2.4 or later. This version includes a fix for the insecure regular expression. Developers can update the package by running the following command in their project directory: npm install word-wrap@1.2.4

How To Fix

Latest published version: 1.2.5 as of 22 Oct 2026

npm install word-wrap@1.2.5

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.2.4

This is the first release that contains the fix.

npm install word-wrap@1.2.4

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback