CVE-2021-23425 Regular Expression Denial of Service (ReDoS)

Medium 5.3 Published Updated

Attackers can cause denial of service in applications using the trim-off-newlines library by submitting specially crafted strings that trigger excessive CPU usage.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2021-23425?

CVE-2021-23425 is a medium-severity denial of service vulnerability in trim-off-newlines, published on 18 Aug 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

All versions of package trim-off-newlines are vulnerable to Regular Expression Denial of Service (ReDoS) via string processing.

Which versions are affected by CVE-2021-23425?

2 open source packages ship an affected version, including trim-off-newlines. It affects 1 product.

PackageAffectedFixed in
trim-off-newlines npmAll versions1.0.3
trim-off-newlines npmAll versions1.0.3

Products include Trim-Off-Newlines Project Trim-Off-Newlines.

How do I fix CVE-2021-23425?

Upgrade trim-off-newlines to 1.0.3 or later.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2021-23425 being exploited?

There is no known exploitation of CVE-2021-23425 in the wild and no public exploit code.

Sources

Also known as GHSA-38fc-wpqx-33j7.

Is CVE-2021-23425 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free