# CVE-2022-36064: Shescape Inefficient Regular Expression Complexity vulnerability

> Attackers can cause denial of service via inefficient regular expressions in Shescape when escaping arguments for specific shells or using interpolation.

- **Severity:** Medium 5.9 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** No
- **Published:** 6 Sep 2022
- **Updated:** 22 Apr 2025
- **Also known as:** GHSA-gp75-h7j6-5pv3

## What is CVE-2022-36064?

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

### Official description

Shescape is a shell escape package for JavaScript. An Inefficient Regular Expression Complexity vulnerability impacts users that use Shescape to escape arguments for the Unix shells `Bash` and `Dash`, or any not-officially-supported Unix shell; and/or using the `escape` or `escapeAll` functions with the `interpolation` option set to `true`. An attacker can cause polynomial backtracking or quadratic runtime in terms of the input string length due to two Regular Expressions in Shescape that are vulnerable to Regular Expression Denial of Service (ReDoS). This bug has been patched in v1.5.10. For `Dash` only, this bug has been patched since v1.5.9. As a workaround, a maximum length can be enforced on input strings to Shescape to reduce the impact of the vulnerability. It is not recommended to try and detect vulnerable input strings, as the logic for this may end up being vulnerable to ReDoS itself.

Weakness: CWE-400 (Uncontrolled Resource Consumption), CWE-1333 (Inefficient Regular Expression Complexity)

## Which versions are affected by CVE-2022-36064?

It affects 1 product.


Products: Shescape Project Shescape.

## How do I fix CVE-2022-36064?

No fix has been published for CVE-2022-36064 yet. Limit exposure of the affected software until one is available.

## Is CVE-2022-36064 being exploited?

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

## Other vulnerabilities in ericcornelissen shescape

- [CVE-2022-31180](https://insights.sbomify.com/CVE-2022-31180/): Insufficient escaping of whitespace in shescape (critical 9.8)
- [CVE-2022-31179](https://insights.sbomify.com/CVE-2022-31179/): Insufficient escaping of line feeds for CMD in shescape (high 8.1)
- [CVE-2026-32094](https://insights.sbomify.com/CVE-2026-32094/): Shescape escape() leaves bracket glob expansion active on Bash, BusyBox, and Dash (medium 6.9)
- [CVE-2023-40185](https://insights.sbomify.com/CVE-2023-40185/): Shescape on Windows escaping may be bypassed in threaded context (medium 6.5)
- [CVE-2021-21384](https://insights.sbomify.com/CVE-2021-21384/): Null characters not escaped in shescape (medium 6.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-36064 and fix it if it is affected.

What it is: CVE-2022-36064 is a medium-severity denial of service vulnerability in ericcornelissen shescape, published on 6 Sep 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-36064 exists.

Affected product: ericcornelissen shescape. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2022-36064/ (Markdown: https://insights.sbomify.com/CVE-2022-36064/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2022-36064
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2022-36064
- OSV: https://osv.dev/vulnerability/CVE-2022-36064

---
From sbomify Insights: https://insights.sbomify.com/CVE-2022-36064/
Summaries are generated and may contain mistakes; the official description above is the record.
