Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSupply crafted tilde or glob payload as application input
-
DeliveryApplication passes input to shescape.escape() with Zsh configured
-
ExploitUnpatched regex fails to escape Zsh special characters
-
ExecutionApplication invokes child_process with unescaped argument
-
PersistZsh expands ~ or glob pattern at execution time
-
ImpactFile system paths returned in command output to attacker
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization OS command sanitization, avoid shell exec
MITRE ATT&CK
2 techniques across 1 tactic: Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires all of the following: (1) the Node.js application must use Shescape with the shell option set explicitly to 'zsh' or to boolean true while the system default shell resolves to Zsh - bash, sh, dash, and other shells are not affected; (2) the application must call escape() or escapeAll() on attacker-controlled input - the quote() and quoteAll() methods are not identified as affected; (3) the application must return or otherwise expose shell command output to the attacker for the disclosure to be useful. The EXTENDED_GLOB variant additionally requires the Zsh EXTENDED_GLOB option to be set in the process environment (e.g., via ~/.zshenv or setopt in a startup file). The MAGIC_EQUAL_SUBST variant requires that option to be enabled. Exploitation is strictly limited to reading file and directory names; no code execution, data modification, or privilege escalation path is present in this vulnerability. Systems defaulting to bash (the overwhelming majority of Linux server deployments) are not affected. |
| Impact | The CVSS 4.0 score of 6.3 with AT:P (attack requirements present) accurately reflects that exploitation is contingent on a non-default shell configuration, which materially limits real-world exposure. The AT:P modifier captures the Zsh prerequisite that most Node.js deployments - which default to bash or sh - do not satisfy, meaning the majority of shescape consumers are unaffected without any remediation action. Impact is bounded to low confidentiality (VC:L): an attacker can enumerate file and directory names but cannot execute arbitrary commands, modify data, or escalate privileges through this flaw alone. EPSS data is not provided in the input, and no independent exploitation campaigns are known; KEV absence further supports a lower urgency classification. The CWE-78 (OS Command Injection) label from NVD overstates the impact - actual consequence is path disclosure, not command injection, and the CVSS impact metrics correctly reflect this narrower scope. For organizations that do explicitly configure Zsh as the shell in shescape options - a deliberate, non-default choice - patching to 2.1.14 or 3.0.1 is straightforward and should be treated as routine maintenance rather than an emergency response. |
| Exploit ScenarioDerived | An attacker submits the string :~ as a user-controlled argument to a Node.js web application that passes it through shescape.escape() with shell configured to 'zsh'. The unpatched escape function does not escape the tilde in the colon-tilde context, and when the sanitized value is passed to child_process.execSync, Zsh expands ~ to the home directory of the process owner (e.g., /home/appuser), which is reflected in command output returned to the attacker. The GitHub advisory contains working proof-of-concept code for this and the EXTENDED_GLOB variant; an attacker with knowledge of the advisory can reproduce the disclosure immediately against vulnerable deployments. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 12, 2026
Incomplete Zsh special-character escaping in Shescape allows unauthenticated attackers who control input strings to bypass sanitization and trigger home directory expansion or glob pattern matching, leaking file and directory paths from the host system. Affected are npm/shescape versions below 2.1.14 (v2 branch) and 3.0.0-3.0.0 inclusive (v3 branch) on Unix systems where Zsh is the configured or default shell using the escape or escapeAll methods. No public exploit identified at time of analysis, though the GitHub security advisory GHSA-6v4m-fw66-8r4x includes functional proof-of-concept code; KEV listing is absent.
RemediationAI
Upgrade to Shescape v2.1.14 (v2 branch users) or v3.0.1 (v3 branch users); both are confirmed released and available at https://github.com/ericcornelissen/shescape/releases/tag/v2.1.14 and https://github.com/ericcornelissen/shescape/releases/tag/v3.0.1, with fixes landed via pull requests https://github.com/ericcornelissen/shescape/pull/2649 and https://github.com/ericcornelissen/shescape/pull/2651. If an immediate upgrade is not possible, explicitly set the shell option to a non-Zsh interpreter such as 'bash' or '/bin/sh' - this eliminates the vulnerable Zsh escape code paths entirely, though it may alter command behavior if the application relies on Zsh-specific syntax elsewhere. As an additional but insufficient standalone control, disabling the EXTENDED_GLOB and MAGIC_EQUAL_SUBST Zsh options in the process environment (e.g., via ~/.zshenv) reduces two of the three attack variants but does not remediate the base tilde expansion issue and is not a substitute for patching.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in npm
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Shescape (CPE: cpe:2.3:a:ericcornelissen:shescape:*:*:*:*:*:*:*:*) is an npm library that sanitizes shell arguments before they are passed to Node.js child_process functions, aiming to prevent OS command injection (CWE-78). The root cause is incomplete regex coverage in src/internal/unix/zsh.js: the original expansions pattern /(^|\s)([=~])/g failed to escape tilde characters appearing after colon or equals characters, allowing Zsh home directory expansion (~→/home/user). Separately, the specials regex omitted ^, ~, and
from its character class, leaving EXTENDED_GLOB operators unescaped. With EXTENDED_GLOB enabled, payloads like ^nonexistent or pa#ckage.json are interpreted as glob expressions by Zsh, enumerating working directory contents. MAGIC_EQUAL_SUBST causes Zsh to expand ~ in key=value argument forms, enabling a third bypass variant. The fix in PR #2649 adds ^, ~, and
to the specials character class and widens the tilde-detection regex to cover :~ and =~ contexts.
Know when Shescape gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N
AV:N because attacker-controlled input arrives over the network; AC:H because Zsh must be the configured shell, a deliberate non-default condition; C:L for limited file path disclosure with no integrity or availability impact.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
1DescriptionCVE.org
Shescape is a simple shell escape library for JavaScript. Prior to 2.1.14 and 3.0.1, this impacts users of Shescape on Unix systems that explicitly configure shell to Zsh, or true when the default shell is Zsh, using the escape and escapeAll. The Zsh options EXTENDED_GLOB and MAGIC_EQUAL_SUBST exacerbate the problem. In certain case, an attacker can leverage home directory expansion and extended glob syntax to obtain lists of files and directories on the system. Depending on what the command does, this may be used to leak more information. This issue is fixed in versions 2.1.14 and 3.0.1.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
OS command injection occurs when an application passes unsanitized user input directly into system shell commands.
Shescape is a simple shell escape package for JavaScript. Rated critical severity (CVSS 9.8), this vulnerability is remo
Shescape is a simple shell escape package for JavaScript. Rated critical severity (CVSS 9.8), this vulnerability is remo
shescape is simple shell escape library for JavaScript. Rated high severity (CVSS 8.6), this vulnerability is remotely e
shescape is a simple shell escape package for JavaScript. Rated high severity (CVSS 7.8), this vulnerability is low atta
The package shescape from 1.5.10 and before 1.6.1 are vulnerable to Regular Expression Denial of Service (ReDoS) via the
Shescape is a shell escape package for JavaScript. Rated high severity (CVSS 7.5), this vulnerability is remotely exploi
Shescape is a shell escape package for JavaScript. Rated medium severity (CVSS 5.5), this vulnerability is low attack co
Command injection in Shescape (npm shell-escaping library) versions below 2.1.14 and the 3.0.x line below 3.0.1 allows a
Quadratic-time CPU exhaustion in Shescape's flag-protection loop allows any attacker who can supply untrusted input to t
Shescape is a simple shell escape library for JavaScript. Rated medium severity (CVSS 4.3), this vulnerability is remote
Shescape versions prior to 2.1.10 fail to properly escape square-bracket glob patterns in Bash, BusyBox sh, and Dash, al
Incomplete tilde-escaping in Shescape's Dash shell mode allows attacker-controlled input to bypass sanitization and trig
EUVD-2026-57525
GHSA-6v4m-fw66-8r4x
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB