Exposure of home directory through shescape on Unix with Bash
Moderate severity
GitHub Reviewed
Published
Mar 3, 2022
in
ericcornelissen/shescape
•
Updated Jun 27, 2023
Description
Published to the GitHub Advisory Database
Mar 3, 2022
Reviewed
Mar 3, 2022
Published by the National Vulnerability Database
Mar 3, 2022
Last updated
Jun 27, 2023
Impact
The issue allows for exposure of the home directory on Unix systems when using Bash with the
escape
orescapeAll
functions from the shescape API with theinterpolation
option set totrue
. 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.
Patches
The issue was patched in
v1.5.1
.Workarounds
Manually escape all instances of the tilde character (
~
) usingarg.replace(/~/g, "\\~")
.References
See GitHub issue ericcornelissen/shescape#169.
References