Skip to main content

Shescape EUVDEUVD-2026-57525

| CVE-2026-73412 MEDIUM
OS Command Injection (CWE-78)
2026-08-12 GitHub_M GHSA-6v4m-fw66-8r4x
6.3
CVSS 4.0 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Supply crafted tilde or glob payload as application input
  2. Delivery
    Application passes input to shescape.escape() with Zsh configured
  3. Exploit
    Unpatched regex fails to escape Zsh special characters
  4. Execution
    Application invokes child_process with unescaped argument
  5. Persist
    Zsh expands ~ or glob pattern at execution time
  6. Impact
    File 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.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

shescape < 2.1.14
shescape 3.0.0, < 3.0.1

Affected Packages

npm shescape fix: 2.1.14, 3.0.1

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

Vendor (GitHub_M) PRIMARY 6.3 MEDIUM
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
vuln.today AI 3.7 LOW

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.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N
4.0 AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
Low
Vulnerable system: Integrity
None
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

1
Patch available
Aug 12, 2026 - 21:17 EUVD

DescriptionCVE.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

EPSS Score
0.3%
Top 72% exploitable
Prevalence
Low
niche npm shell-escaping utility, not bundled in major runtimes or frameworks
Threat Intel
1
1 source
Data Quality
6 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA GitHub VulDB

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.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

32
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +32
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

OS command injection occurs when an application passes unsanitized user input directly into system shell commands.

CVE-2022-31180 CRITICAL POC
9.8 Aug 01

Shescape is a simple shell escape package for JavaScript. Rated critical severity (CVSS 9.8), this vulnerability is remo

CVE-2022-31179 CRITICAL POC
9.8 Aug 01

Shescape is a simple shell escape package for JavaScript. Rated critical severity (CVSS 9.8), this vulnerability is remo

CVE-2023-40185 HIGH POC
8.6 Aug 23

shescape is simple shell escape library for JavaScript. Rated high severity (CVSS 8.6), this vulnerability is remotely e

CVE-2021-21384 HIGH POC
7.8 Mar 19

shescape is a simple shell escape package for JavaScript. Rated high severity (CVSS 7.8), this vulnerability is low atta

CVE-2022-25918 HIGH POC
7.5 Oct 27

The package shescape from 1.5.10 and before 1.6.1 are vulnerable to Regular Expression Denial of Service (ReDoS) via the

CVE-2022-36064 HIGH POC
7.5 Sep 06

Shescape is a shell escape package for JavaScript. Rated high severity (CVSS 7.5), this vulnerability is remotely exploi

CVE-2022-24725 MEDIUM POC
5.5 Mar 03

Shescape is a shell escape package for JavaScript. Rated medium severity (CVSS 5.5), this vulnerability is low attack co

CVE-2026-73414 CRITICAL
9.2 Aug 12

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

CVE-2026-73413 HIGH
8.7 Aug 12

Quadratic-time CPU exhaustion in Shescape's flag-protection loop allows any attacker who can supply untrusted input to t

CVE-2023-35931 MEDIUM POC
4.3 Jun 23

Shescape is a simple shell escape library for JavaScript. Rated medium severity (CVSS 4.3), this vulnerability is remote

CVE-2026-32094 MEDIUM
6.5 Mar 11

Shescape versions prior to 2.1.10 fail to properly escape square-bracket glob patterns in Bash, BusyBox sh, and Dash, al

CVE-2026-73411 MEDIUM
6.3 Aug 12

Incomplete tilde-escaping in Shescape's Dash shell mode allows attacker-controlled input to bypass sanitization and trig

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy