Loading advisory.
Loading advisory.
Inefficient Regular Expression Complexity in shescape
This impacts users that use shescape to escape arguments:
Published 2022-10-25 22:27 UTC · Modified 2025-05-05 18:24 UTC
Severity and EPSS are shown separately. Helm does not combine them into one score. How tiers work
| Package | Ecosystem | Affected | Fixed in | Upgrade command |
|---|---|---|---|---|
| shescape | npm | >= 1.5.10, < 1.6.1 | 1.6.1 | npm install shescape@1.6.1 |
This impacts users that use shescape to escape arguments:
for the Unix shell Bash, or any not-officially-supported Unix shell;
using the escape or escapeAll functions with the interpolation option set to true.
An attacker can cause polynomial backtracking in terms of the input string length due to a Regular Expression in shescape that is vulnerable to Regular Expression Denial of Service (ReDoS). Example:
import * as shescape from "shescape";
/* 1. Prerequisites */
const options = {
interpolation: true,
// and
shell: "/bin/bash",
// or
shell: "some-not-officially-supported-shell",
// or
shell: undefined, // Only if the system's default shell is bash or an unsupported shell.
};
/* 2. Attack */
let userInput = '{,'.repeat(150_000); // polynomial backtracking
/* 3. Usage */
shescape.escape(userInput, options);
// or
shescape.escapeAll([userInput], options);This bug has been patched in v1.6.1 which you can upgrade to now. No further changes required.
Alternatively, 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.
Comment on commit 552e8ea
Open an issue at https://github.com/ericcornelissen/shescape/issues (New issue > Question > Get started)
No public exploit code known to Helm's sources (Nuclei templates, Metasploit, Exploit-DB and PoC-in-GitHub). That does not mean none exists.
EPSS went from 0.016 on 2026-11-24 to 0.016 on 2026-11-26, over 2 recorded scores.
| Date | Score | Previous | Model |
|---|---|---|---|
| 2026-11-24 | 0.016 | first score | v2026.06.15 |
| 2026-11-26 | 0.016 | 0.016 | v2026.06.15 |