Medium severity · published Mar 3, 2022
CVE-2022-24725
Shescape is a shell escape package for JavaScript
5.5
CVSS
0.5%
EPSS
No
On KEV
Description
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, "\\~")`.
CVSS vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
Attack vector
Local
Complexity
Low
Privileges
Low
User interaction
None
Confidentiality
High
Integrity
None
Availability
None
Scope
Unchanged
Exploitation
Is it being used?
Exploit prediction (EPSS)0.5% · higher than 43% of CVEs
Exploited in the wildNo evidence yet
CISA KEVNot listed
Ransomware campaign useNot known
Affected products
Which versions
SH
Shescape · Shescape Project
1.4.0 before 1.5.1 · source: NVD
References
NVD
https://nvd.nist.gov/vuln/detail/CVE-2022-24725
CVE.org
https://www.cve.org/CVERecord?id=CVE-2022-24725
Exploit
https://github.com/ericcornelissen/shescape/issues/169
Patch
https://github.com/ericcornelissen/shescape/pull/170
Exploit
https://github.com/ericcornelissen/shescape/security/advisories/GHSA-446w-rrm4-r47f
More from Shescape
9.8
CVE-2022-31179
Insufficient escaping of line feeds for CMD in shescape
9.8
CVE-2022-31180
Insufficient escaping of whitespace in shescape
8.6
CVE-2023-40185
shescape is simple shell escape library for JavaScript
7.8
CVE-2021-21384
shescape is a simple shell escape package for JavaScript
7.5
CVE-2022-25918
Regular Expression Denial of Service (ReDoS)
