CVE-2022-24725
MEDIUM 5.5CVSS 3.1Exposure 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, "\\~").
- Published
- 3 Mar 2022
- Last modified
- 17 Jun 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Modified
- Weakness
- CWE-200CWE-78
- Also known as
- GHSA-446w-rrm4-r47f
- Sources
- NVDJSONOSV GHSA-446w-rrm4-r47fJSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | MEDIUM 6.2 | CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | MEDIUM 5.5 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N |
| OSV | GitHub | CVSS 3.1 | MEDIUM 5.5 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N |
| NVD | nvd@nist.gov (Primary) | CVSS 2.0 | LOW 1.9 | AV:L/AC:M/Au:N/C:P/I:N/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | shescape_project | shescapecpe:2.3:a:shescape_project:shescape:*:*:*:*:*:node.js:*:* |
>= 1.4.0, < 1.5.1 | 1.5.1 |
| OSV | npm | shescape | >= 1.4.0, < 1.5.1 | 1.5.1 |
References
- 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://github.com/ericcornelissen/shescape/security/advisories/GHSA-446w-rrm4-r47f · Exploit, Third Party Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2022-24725 · ADVISORY
- https://github.com/ericcornelissen/shescape · PACKAGE
History
- 25 Nov 2026 20:34 UTC · NVD: first stored (published 3 Mar 2022)
- 25 Nov 2026 20:10 UTC · OSV: first stored (published 3 Mar 2022)