Exposure of home directory through shescape on Unix with Bash
Impact
The issue 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.
const cp = require("child_process");
const shescape = require("shescape");
const payload = "home_directory=~";
const options = { interpolation: true };
console.log(cp.execSync(`echo ${shescape.escape(payload, options)}`));
// home_directory=/home/user
Depending on how the output of shescape is used, directory traversal may be possible in the application using shescape.
Patches
The issue was patched in v1.5.1.
Workarounds
Manually escape all instances of the tilde character (~) using arg.replace(/~/g, "\\~").
References
See GitHub issue https://github.com/ericcornelissen/shescape/issues/169.
Czego dotyczy
Kliknij technologię, aby zobaczyć wszystkie dotyczące jej podatności.
| Platforma | Paczka | Podatne wersje | Poprawka w wersji |
|---|---|---|---|
| Paczka npm | shescape | >= 1.4.0, < 1.5.1 | 1.5.1 |
Odnośniki
- Wektor CVSS
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N- Słabość (CWE)
CWE-200, CWE-78- Platforma
- npm
- Paczka
shescape- Ujawniono
- 03.03.2022
- Aktualizacja
- 11.10.2026 10:22
Źródła i licencje
OSV / GitHub Advisory Database - GHSA-446w-rrm4-r47f - CC BY 4.0
Historia podatności: shescape
Wszystkie opisane podatności tej paczki (Paczka npm), od najnowszej. Widać, czy to jednorazowa wpadka, czy paczka, której trzeba pilnować.
- Wszystkich wpisów
- 13
- Pierwsza → ostatnia
- 03.2021 07.2026
- Bez poprawki
- 0
- Wykorzystywana w atakach
- 0
Rozkład istotności
- Krytyczna 2
- Wysoka 5
- Średnia 4
- Niska 2
Ujawnienia w latach
- 2021: 1
- 2022: 4
- 2023: 2
- 2024: 0
- 2025: 1
- 2026: 5
-
Exposure of home directory through shescape on Unix with Bash ten wpis
Dowiedz się, które podatności dotyczą Twojej aplikacji
Po podłączeniu integracji DockRay i włączeniu raportowania oprogramowania DockRay porównuje zgłoszone wersje komponentów ze znanymi podatnościami i powiadamia o potwierdzonych dopasowaniach. Zakres zależy od obsługiwanej technologii i dostępnych biuletynów.