{"id":"CVE-2022-24725","published":"2022-03-03T21:35:10Z","modified":"2025-04-22T18:20:38Z","title":"Exposure of home directory through shescape on Unix with Bash","vendor":"ericcornelissen","product":"shescape","tier":"tail","description":{"text":"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, \"\\\\~\")`.","provenance":"source","from":"CVE.org"},"cvss":{"score":6.2,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00499,"percentile":0.43699,"provenance":"source"},"cwes":[{"id":"CWE-200","name":"Exposure of Sensitive Information to an Unauthorized Actor"}],"references":[{"url":"https://github.com/ericcornelissen/shescape/security/advisories/GHSA-446w-rrm4-r47f","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/ericcornelissen/shescape/issues/169","tags":["x_refsource_MISC"]},{"url":"https://github.com/ericcornelissen/shescape/pull/170","tags":["x_refsource_MISC"]}],"priority":{"score":13.1,"factors":[{"name":"EPSS percentile","points":8.74},{"name":"CVSS severity","points":4.34}]},"vendorSlug":"ericcornelissen","affectedVersions":[{"vendor":"ericcornelissen","product":"shescape","versions":[">= 1.4.0, < 1.5.1"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2025-04-22T15:49:34.610989Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"shescape","vulnerableRanges":[">=1.4.0, <1.5.1"],"patched":["1.5.1"],"from":["GHSA-446w-rrm4-r47f"],"provenance":"source"}],"summary":{"text":"The shescape package for JavaScript, a shell escape library, has a flaw on Unix systems when Bash is used with its escape or escapeAll functions and the interpolation option set to true, causing the user's home directory to be exposed. An attacker with local access (no authentication or user interaction is required) could exploit this by supplying input that is interpreted through the escape path, so long as the application using shescape passes its output onward in a way that enables directory traversal.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:46:08Z"},"euvd":{"id":"EUVD-2022-1297","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2021-21384","published":"2021-03-18","fixed":"1.1.3","kev":false},{"cve":"CVE-2022-24725","published":"2022-03-03","fixed":"1.5.1","kev":false},{"cve":"CVE-2022-31179","published":"2022-08-01","fixed":"1.5.8","kev":false,"link":{"from":"CVE-2022-24725","to":"CVE-2022-31179","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"npm:shescape","fromFixed":"1.5.1","toFixed":"1.5.8","daysApart":151}]}},{"cve":"CVE-2022-31180","published":"2022-08-01","fixed":"1.5.8","kev":false,"link":{"from":"CVE-2022-24725","to":"CVE-2022-31180","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"npm:shescape","fromFixed":"1.5.1","toFixed":"1.5.8","daysApart":151}]}},{"cve":"CVE-2022-25918","published":"2022-10-27","fixed":"1.6.1","kev":false}],"package":"npm:shescape"}}