CVE-2022-24725

Exposure of home directory through shescape on Unix with Bash

MEDIUM
5.5
CVSS Score
Published: March 3, 2022 at 09:35 PM UTC
Updated: June 17, 2026 at 04:32 AM UTC
2 products affected across 2 vendorsShescapeProject Shescape

Using shescape by ericcornelissen?

Get instant alerts when new vulnerabilities affect shescape - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM5.5
Exploit prediction
EPSS 0.5%
SSVC
PoC

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

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

1.4.0 ≤ v < 1.5.1
Affected range stops below 1.5.1, so it looks safe — our inference, not a vendor statement
v < 1.5.1
Affected range stops below 1.5.1, so it looks safe — our inference, not a vendor statement

Remediation

No guide yet

No remediation guidance has been written for this CVE yet. What the record does show:

References (3)

x_refsource_MISCExploitIssue TrackingThird Party Advisory
https://github.com/ericcornelissen/shescape/issues/169
x_refsource_MISCPatchThird Party Advisory
https://github.com/ericcornelissen/shescape/pull/170

SSVC — Action Prioritization

SSVCPoCNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

Attack Vector
LOCAL
Complexity
LOW
Privileges
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
NONE
Availability
NONE
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-200CWE-78

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card