CWE
78 200
Advisory Published
Updated

CVE-2022-24725: Exposure of home directory through shescape on Unix with Bash

First published: Thu Mar 03 2022(Updated: )

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, "\\~")`.

Credit: security-advisories@github.com

Affected SoftwareAffected VersionHow to fix
Shescape Project Shescape Node.js>=1.4.0<1.5.1

Never miss a vulnerability like this again

Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.

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.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2025 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203