CVE-2022-24725
Published:March 03, 2022
Updated:June 26, 2026
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, "\\~")".
Affected Packages
shescape (NPM):
Affected version(s) >=1.4.0 <1.5.1Fix Suggestion:
Update to version 1.5.1Additional Notes
The description of this vulnerability differs from MITRE.
Related Resources (6)
Do you need more information?
Contact UsCVSS v4
Base Score:
6.9
Attack Vector
LOCAL
Attack Complexity
LOW
Attack Requirements
NONE
Privileges Required
NONE
User Interaction
NONE
Vulnerable System Confidentiality
HIGH
Vulnerable System Integrity
NONE
Vulnerable System Availability
NONE
Subsequent System Confidentiality
NONE
Subsequent System Integrity
NONE
Subsequent System Availability
NONE
CVSS v3
Base Score:
6.2
Attack Vector
LOCAL
Attack Complexity
LOW
Privileges Required
NONE
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
NONE
Availability
NONE
Weakness Type (CWE)
EPSS
Base Score:
0.49