Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSubmit crafted argument to Windows app
-
DeliveryApp escapes input via Shescape escape/escapeAll
-
ExploitUnescaped ')' breaks out of CMD parenthesized block
-
ExecutionInjected CMD syntax parsed as new commands
-
ImpactArbitrary command execution on host
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 concrete prerequisites: (1) the target application runs on Windows; (2) it uses Shescape's escape or escapeAll API; (3) it invokes child_process with shell set to 'cmd.exe', or shell:true while CMD is the system default shell; and (4) the escaped attacker input is placed inside a parenthesized CMD construct (e.g. an if/else block using '(...)') in the original command - this is the exact condition captured by the CVSS AT:P (Attack Requirements: Present) flag. Limiting factors: applications on Unix shells, on PowerShell, or that pass arguments as an argv array (not through CMD) are not affected; and if the surrounding command never wraps the argument in parentheses, the breakout construct has nothing to escape from. No user authentication or interaction is required by the library itself (PR:N/UI:N), but whether the tainted input is remotely reachable is a property of the host application. |
| Impact | The CVSS 4.0 base score of 9.2 (Critical) reflects a network-reachable, no-privilege, no-interaction path to full C/I/A compromise, but the Attack Requirements flag (AT:P) is the key nuance: exploitation is not universal - it depends on the consuming application actually running on Windows with CMD and embedding the escaped argument inside a parenthesized CMD construct. That makes real-world exploitability conditional on how each downstream app uses the library, so this is better characterized as a serious-but-context-dependent library flaw than a blanket internet-wide RCE. The vendor advisory ships a concrete working payload ('x) else if a==a (echo y'), which meaningfully lowers the barrier to exploitation for affected deployments, yet there is no EPSS figure provided and no CISA KEV entry, so I cannot assert widespread or active exploitation. On balance, any team shipping a Windows product that passes untrusted input through Shescape's escape/escapeAll with CMD should treat patching as urgent, while teams on non-Windows shells or not using the CMD backend face materially lower real risk. Note the data conflict to verify: the raw CVSS asserts AV:N/PR:N/UI:N (unauthenticated remote), but whether input is remotely reachable is entirely a property of the host application, not the library itself. |
| Exploit ScenarioDerived | A Windows-hosted Node.js application takes a user-supplied value (e.g. a form field or API parameter), escapes it with shescape.escape, and interpolates it into a cmd.exe command that wraps the value in parentheses such as 'if defined FALSY (echo <input>)'. An attacker submits 'x) else if a==a (echo y', whose unescaped ) closes the CMD block early and injects attacker-chosen syntax, causing the shell to execute unintended commands. A working payload demonstrating this is published in the GHSA advisory, and the low attack complexity means it succeeds reliably once the parenthesized-construct precondition is met. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 12, 2026
Command injection in Shescape (npm shell-escaping library) versions below 2.1.14 and the 3.0.x line below 3.0.1 allows an attacker-controlled argument to break out of a parenthesized cmd.exe construct and inject arbitrary shell syntax on Windows. The flaw affects applications that call the escape or escapeAll APIs with shell set to cmd.exe (or shell:true when CMD is the default), because getEscapeFunction in src/internal/win/cmd.js failed to escape the ( and ) characters. A working proof-of-concept payload is published in the vendor advisory; there is no CISA KEV listing and no evidence of active exploitation at time of analysis.
RemediationAI
Vendor-released patch: upgrade to Shescape 2.1.14 (v2 line) or 3.0.1 (v3 line). Applications already on v3 need only bump to 3.0.1 with no code changes; v2 users should note that v2 reaches end-of-life on 2026-09-28 and follow the vendor migration guide to move to v3. If you cannot upgrade immediately, the vendor-documented workaround is to strip all ( and ) characters from untrusted input before passing it to Shescape (trade-off: this alters argument content and may break legitimate inputs that contain parentheses). An additional compensating control is to avoid the CMD backend where feasible - switch the child_process shell to PowerShell or run without shell:true so arguments are passed as an argv array rather than a CMD string, which removes the vulnerable code path (trade-off: may change quoting/behavior for commands that rely on CMD-specific features). Advisory and fix references: https://github.com/ericcornelissen/shescape/security/advisories/GHSA-w4hw-qcx7-56pr, https://github.com/ericcornelissen/shescape/pull/2649, https://github.com/ericcornelissen/shescape/pull/2651.
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 is a JavaScript/Node.js library whose entire purpose is to neutralize shell metacharacters in untrusted arguments before they are passed to a shell via child_process. The defect is a classic CWE-78 (OS Command Injection) escaping gap specific to the Windows CMD backend: the special-character regex in src/internal/win/cmd.js matched %, &, <, >, ^ and | but omitted the grouping parentheses ( and ). In cmd.exe, parentheses delimit command blocks (e.g. if defined X (…) else (…)), so an unescaped ) closes the block early and lets subsequent tokens be interpreted as new CMD syntax. The fix (PRs #2649/#2651, commits 43d70b5 and b4b34c3) simply adds ( and ) to the specials regex - /([%&()<>^|])/g - and the same release also hardened unrelated Unix escaping for ~, #, ^ in Dash and Zsh. The affected CPE is cpe:2.3:a:ericcornelissen:shescape.
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:H/VI:H/VA:H/SC:N/SI:N/SA:N
AC:H because exploitation requires the app to use the CMD backend and embed input in a parenthesized construct; PR:N/UI:N as the library imposes no auth; full C/I/A from arbitrary command execution.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.org
Shescape is a simple shell escape library for JavaScript. Prior to 2.1.14 and 3.0.1, getEscapeFunction in src/internal/win/cmd.js does not escape ( and ) when applications use the escape or escapeAll APIs on Windows with shell set to cmd.exe, or with shell set to true when CMD is the default. An attacker-controlled argument can break out of a parenthesized CMD construct and inject shell syntax depending on the original command, resulting in arbitrary command execution. This issue is fixed in versions 2.1.14 and 3.0.1.
Executive ViewAI
A critical command injection flaw in Shescape (a popular Windows shell-escaping library for Node.js) defeats application injection protections, enabling remote code execution in affected systems; publicly available exploit code exists in the vendor advisory. Versions 2.1.13 and earlier, and 3.0.0, fail to properly escape shell metacharacters, allowing attackers to inject arbitrary commands via crafted input. With no patch available, any Windows-based Node.js application depending on this library faces immediate risk.
No vendor-released patch identified at time of analysis. Interim mitigations: restrict network access to affected Windows applications; add application-level input validation on arguments passed to Shescape; migrate to PowerShell (with appropriate escaping) where operationally feasible; isolate affected systems using network segmentation; implement security event monitoring on cmd.exe process spawning.
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
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 Zsh special-character escaping in Shescape allows unauthenticated attackers who control input strings to bypa
Incomplete tilde-escaping in Shescape's Dash shell mode allows attacker-controlled input to bypass sanitization and trig
EUVD-2026-57531
GHSA-w4hw-qcx7-56pr
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB