CVE-2022-24725: Exposure of home directory through shescape on Unix with Bash
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 Software
Remediation
Patch Available
Event History
Frequently Asked Questions
What is CVE-2022-24725?
CVE-2022-24725 is a vulnerability in the Shescape package for JavaScript that allows for the exposure of the home directory on Unix systems when using certain functions with specific options.
What is the severity of CVE-2022-24725?
The severity of CVE-2022-24725 is medium with a CVSS score of 5.5.
How can the home directory be exposed in CVE-2022-24725?
The home directory can be exposed in CVE-2022-24725 when using the 'escape' or 'escapeAll' functions from the Shescape API with the 'interpolation' option set to 'true'.
Which versions of Shescape are affected by CVE-2022-24725?
Versions 1.4.0 to 1.5.1 of Shescape are affected by CVE-2022-24725.
Is there a fix for CVE-2022-24725?
Yes, the fix for CVE-2022-24725 can be found in the Shescape package version 1.5.2 and onwards.