Skip to main content
← All vulnerabilities
CVE-2022-24725GHSA-446W-RRM4-R47F

Exposure of home directory through shescape on Unix with Bash

Published
Last modified
published
Not listed in CISA KEV
Fix
Fixed in 1.5.1
None on Exploit-DB, Metasploit or GitHub
  • Exploitation: poc
  • Automatable: no
  • Technical impact: partial

Summary

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

Timeline

  1. CVE published
  2. CISA SSVC assessment

    Exploitation: poc · Automatable: no · Technical impact: partial

  3. Record last updated

Affected versions

  • ericcornelissen shescape

    From 1.4.0 · fixed in 1.5.1

  • shescapenpm

    From 1.4.0 · fixed in 1.5.1

References 3

GitHub · ericcornelissen/shescape