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

- Severity: Medium 6.2 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.50%, higher than 44% of CVEs (2026-12-01)
- Public exploit code or proof of concept: 2 links below, marked "exploit"
- Published: 2022-03-03T19:26:11.000Z
- Modified: 2026-06-17T04:32:22.800Z
- Also known as: GHSA-446w-rrm4-r47f
- Weaknesses: CWE-78, CWE-200
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: GitHub_M

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

(As written by CVE List.)

## Affected

- ericcornelissen shescape: >= 1.4.0, < 1.5.1
- shescape (npm): from 1.4.0 before 1.5.1
- shescape_project shescape: from 1.4.0 before 1.5.1

## Every score

- GitHub_M: CVSS:3.1 6.2 Medium `CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`
- GitHub: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N`
- NVD: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N`
- NVD: CVSS:2.0 1.9 Low `AV:L/AC:M/Au:N/C:P/I:N/A:N`

## References

- <https://github.com/ericcornelissen/shescape/security/advisories/GHSA-446w-rrm4-r47f> (exploit, third-party-advisory, web)
- <https://github.com/ericcornelissen/shescape/issues/169> (exploit, issue-tracking, third-party-advisory, web)
- <https://github.com/ericcornelissen/shescape/pull/170> (patch, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2022-24725> (advisory)
- <https://github.com/ericcornelissen/shescape> (package)

## Sources

- CVE List: [CVE-2022-24725](https://www.cve.org/CVERecord?id=CVE-2022-24725), CVE Terms of Use, modified 2025-04-22
- GitHub Advisory Database: [GHSA-446w-rrm4-r47f](https://github.com/advisories/GHSA-446w-rrm4-r47f), CC-BY-4.0, modified 2023-11-08
- NVD: [CVE-2022-24725](https://nvd.nist.gov/vuln/detail/CVE-2022-24725), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2022-24725 · Whole record: https://cve.day/CVE-2022-24725.json · Rebuilt by cve.day 2026-11-25T22:58:09.909Z
