CVE-2022-25918 Regular Expression Denial of Service (ReDoS)
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.
| Package | Affected | Fixed in |
|---|---|---|
shescape npm | From 1.5.10 | 1.6.1 |
shescape npm | From 1.5.10 | 1.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.
Other vulnerabilities in shescape
- CVE-2022-31180 Insufficient escaping of whitespace in shescape
- CVE-2022-31179 Insufficient escaping of line feeds for CMD in shescape
- CVE-2026-32094 Shescape escape() leaves bracket glob expansion active on Bash, BusyBox, and Dash
- CVE-2023-40185 Shescape on Windows escaping may be bypassed in threaded context
- CVE-2021-21384 Null characters not escaped in shescape
Sources
Also known as GHSA-cr84-xvw4-qx3c.