Description
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.
Published: 2026-08-12
Score: 9.2 Critical
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The shescape library fails to escape parentheses in its Windows‑cmd‑specific escape logic, allowing an attacker‑controlled argument to break out of a parenthesized CMD construct and inject arbitrary shell syntax. This results in OS command injection, which can be used to execute commands with the privileges of the running process. The weakness is recognized under CWE‑78 (OS Command Injection) and CWE‑150 (Race Condition in Shell Command Execution).

Affected Systems

The vulnerable product is the Shescape JavaScript shell‑escape library produced by ericcornelissen. Versions older than 2.1.14 of the 2.x branch and older than 3.0.1 of the 3.x branch are affected. These releases expose the bug when the library is used on Windows environments that employ CMD as the shell or when the shell is set to true and defaults to CMD.

Risk and Exploitability

With a CVSS score of 9.2 the vulnerability is considered critical. EPSS data is not available, and the issue is not listed in the CISA KEV catalog. Attackers would need to supply crafted input to a JavaScript application that calls shescape on Windows, which is a realistic scenario in many Node.js deployments. The potential impact includes full control of the execution environment, and because the vulnerability exists in a widely used utility library, it could be exploited by automated tools or by an attacker who compromises a user’s input.

Generated by OpenCVE AI on August 12, 2026 at 23:13 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade Shescape to version 2.1.14 or later (including 3.0.1) to obtain the fix for the parentheses escape bug.
  • If upgrading is not possible, modify the application to avoid using shescape with cmd.exe on Windows or switch the shell to a different one that does not rely on parenthesized constructs. Alternatively, manually escape or validate user input to ensure parentheses are not present when calling shescape.
  • Audit all code that imports or requires shescape on Windows systems to confirm that no vulnerable versions or configurations remain in production.

Generated by OpenCVE AI on August 12, 2026 at 23:13 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-w4hw-qcx7-56pr Shescape: Shell injection via unescaped parentheses on Windows with CMD
History

Wed, 12 Aug 2026 21:30:00 +0000

Type Values Removed Values Added
First Time appeared Ericcornelissen
Ericcornelissen shescape
Vendors & Products Ericcornelissen
Ericcornelissen shescape

Wed, 12 Aug 2026 19:45:00 +0000

Type Values Removed Values Added
Description 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.
Title Shescape: Shell injection via unescaped parentheses on Windows with CMD
Weaknesses CWE-150
CWE-78
References
Metrics cvssV4_0

{'score': 9.2, 'vector': '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'}


Subscriptions

Ericcornelissen Shescape
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-08-14T22:11:29.290Z

Reserved: 2026-08-12T14:32:11.795Z

Link: CVE-2026-73414

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-08-12T20:17:56.510

Modified: 2026-08-14T22:17:11.307

Link: CVE-2026-73414

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-12T23:15:03Z

Weaknesses
  • CWE-150

    Improper Neutralization of Escape, Meta, or Control Sequences

  • CWE-78

    Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')