CVE-2022-25918 Regular Expression Denial of Service (ReDoS)

Medium 5.3 Published Updated

Attackers can cause denial of service in applications using the shescape library by triggering inefficient regular expressions during argument escaping.

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

What is CVE-2022-25918?

CVE-2022-25918 is a medium-severity denial of service vulnerability in shescape, published on 27 Oct 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

The package shescape from 1.5.10 and before 1.6.1 are vulnerable to Regular Expression Denial of Service (ReDoS) via the escape function in index.js, due to the usage of insecure regex in the escapeArgBash function.

Weakness: CWE-1333

Which versions are affected by CVE-2022-25918?

2 open source packages ship an affected version, including shescape. It affects 1 product.

PackageAffectedFixed in
shescape npmFrom 1.5.101.6.1
shescape npmFrom 1.5.101.6.1

Products include Shescape Project Shescape.

How do I fix CVE-2022-25918?

Upgrade shescape to 1.6.1 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-2022-25918 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-25918 exists.

Sources

Also known as GHSA-cr84-xvw4-qx3c.

Is CVE-2022-25918 in your software?

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

Check your SBOMs for free