Exposure of home directory through shescape on Unix with Bash
Key facts
- Attack vector
- Local
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Information disclosure, Code execution
- Confidentiality · integrity · availability
- High · None · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-200 and CWE-78.
Summary
Shescape is a shell escape package for JavaScript. An issue in versions 1.4.0 to 1.5.1 allows for exposure of the home directory on Unix systems when using Bash with the `escape` or `escapeAll` functions from the _shescape_ API with the `interpolation` option set to `true`. Other tested shells, Dash and Zsh, are not affected. Depending on how the output of _shescape_ is used, directory traversal may be possible in the application using _shescape_. The issue was patched in version 1.5.1. As a workaround, manually escape all instances of the tilde character (`~`) using `arg.replace(/~/g, "\\~")`.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| ericcornelissen | shescape | 1.4.0 to before 1.5.1 | 1.5.1 | Patch available | CNA |
| — | shescape (npm) | 1.4.0 to before 1.5.1 | 1.5.1 | Patch available | GHSA-446w-rrm4-r47f |
- shescape Vendorericcornelissen Affected 1.4.0 to before 1.5.1 Fixed in 1.5.1 Patch available CNA
- shescape (npm) Vendor— Affected 1.4.0 to before 1.5.1 Fixed in 1.5.1 Patch available GHSA-446w-rrm4-r47f
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:shescape_project:shescape:*:*:*:*:*:node.js:*:* | 1.4.0 to before 1.5.1 | Vulnerable | ericcornelissen |
- cpe:2.3:a:shescape_project:shescape:*:*:*:*:*:node.js:*:* Versions 1.4.0 to before 1.5.1 Vulnerable ·ericcornelissen
Remediation
- Fix · CNA shescape (ericcornelissen) Fixed in 1.5.1
- Fix · GHSA-446w-rrm4-r47f shescape (npm) Fixed in 1.5.1 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2022-24725
- 2026-10-03 Alias added: GHSA-446w-rrm4-r47f
References
Exploit 2
More ericcornelissen Shescape vulnerabilities
- TI-2022-13220 Insufficient escaping of whitespace in shescape CVSS 3.1CRITICAL 9.8
- TI-2022-13219 Insufficient escaping of line feeds for CMD in shescape CVSS 3.1CRITICAL 9.8
- TI-2022-09469 Regular expression denial of service (ReDoS) in shescape CVSS 3.1HIGH 7.5
- TI-2026-24632 Shescape escape() leaves bracket glob expansion active on Bash, BusyBox, and Dash CVSS 4.0MEDIUM 6.9
- TI-2022-16487 Shescape Inefficient Regular Expression Complexity vulnerability CVSS 3.1HIGH 7.5
- TI-2023-21058 Shescape on Windows escaping may be bypassed in threaded context CVSS 3.1HIGH 8.6
Sources
- CVE-2022-24725 · CVE Program
- CVE-2022-24725 · NVD
- FIRST EPSS
- GHSA-446w-rrm4-r47f · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences