CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-Q53C-4PRM-W95Q

GHSA-q53c-4prm-w95q: Unix Home Directory Path Disclosure and Command Escaping Flaws in Shescape

Amit Schendel
Amit Schendel
Senior Security Researcher

Jul 25, 2026·6 min read·23 visits

Executive Summary (TL;DR)

A path disclosure flaw in shescape allows unescaped tilde expansions in Dash shell variable assignments, leaking user home directories. Secondary fixes address Zsh and Windows CMD injection points.

An escaping bypass in the npm package shescape on Unix platforms utilizing the Dash shell can result in unauthorized home directory path disclosure. The vulnerability occurs when user input containing specific sequences is passed inside shell variable assignment contexts. Additionally, the patch addresses secondary security gaps related to Zsh extended globbing and Windows CMD command block breakouts.

Vulnerability Overview

The npm package shescape serves as an escaping utility for Node.js applications, protecting shell command execution against parameter injections and unintended argument interpretation. Applications typically utilize this package to sanitize untrusted inputs before passing them to internal execution APIs.

This vulnerability, tracked under GHSA-q53c-4prm-w95q, describes a path disclosure flaw when executing within environments that use the Dash shell (either configured explicitly or operating as the system default). The bug permits an attacker to bypass shell escaping and force the system to expand shell-interpreted paths.

Simultaneously, the maintainers addressed secondary parsing weaknesses within Zsh and Windows CMD parsing routines. In Zsh, the presence of specific globbing control characters could alter pattern-matching behavior. Under Windows CMD, raw parenthetical delimiters were not correctly neutralized, allowing command block escapes.

Root Cause Analysis

In POSIX-compliant environments, Dash handles tilde expansion (~) by replacing it with the absolute path of the user's home directory. While this expansion normally occurs only at word boundaries or following whitespace, shell-specific variable assignments broaden this evaluation scope.

Inside a shell variable assignment context (e.g., VAR=val), the shell parses the assigned value and performs tilde expansion immediately following equals signs (=) or colons (:). This allows paths inside environment variable configurations like PATH to be dynamically resolved.

Prior to the security patch, shescape evaluated Dash-specific tildes using a restricted regular expression pattern: /(^|\s)~/g. This pattern only identified and escaped a tilde character if it appeared at the absolute beginning of the input string or immediately after a whitespace character.

Because the regex failed to recognize equals signs or colons as valid expansion boundaries, payloads containing characters like :~ bypassed the escaping mechanism. When integrated into a shell assignment command, Dash processed the unescaped tilde, resulting in sensitive system path disclosure.

Code Analysis

The technical fix was implemented across multiple internal libraries corresponding to each shell environment. In src/internal/unix/dash.js, the regex used to detect home directory tildes was updated to prevent assignment-context expansion.

@@ -16,7 +16,7 @@ export function getEscapeFunction() {
   const newlines = new RegExp(/\n/g);
   const backslashes = new RegExp(/\\/g);
   const comments = new RegExp(/(^|\s)#/g);
-  const home = new RegExp(/(^|\s)~/g);
+  const home = new RegExp(/(^|[\s:=])~/g);
   const specials = new RegExp(/(["$&'()*;<>?[\]`|])/g);
   const whitespace = new RegExp(/([\t ])/g);

Expanding the pattern to /(^|[\s:=])~/g ensures that tildes located after spaces, colons, or equals signs are properly escaped. This prevents Dash from recognizing the tilde as an expansion initiator within environment parameters.

In the Zsh escaping library src/internal/unix/zsh.js, the update consolidated various glob and expansion operators directly into the unconditional specials filter.

@@ -15,17 +15,15 @@ export function getEscapeFunction() {
   const controls = new RegExp(/[\0\u0008\r\u001B\u009B]/g);
   const newlines = new RegExp(/\n/g);
   const backslashes = new RegExp(/\\/g);
-  const comments = new RegExp(/(^|\s)#/g);
-  const expansions = new RegExp(/(^|\s)([=~])/g);
-  const specials = new RegExp(/(["$&'()*;<>?[\]`{|}])/g);
+  const expansions = new RegExp(/(^|[\s:=])=/g);
+  const specials = new RegExp(/(["#$&'()*;<>?[\]^`{|}~])/g);
   const whitespace = new RegExp(/([\t ])/g);

Moving #, ^, and ~ into the specials regex means they are now unconditionally backslash-escaped. This prevents glob execution when Zsh is configured with EXTENDED_GLOB enabled. For Windows CMD, parenthetical characters ( and ) were added to the specials regex inside src/internal/win/cmd.js to prevent command breakout.

Exploitation Methodology

To trigger the path disclosure vulnerability, an attacker must target an application utilizing a vulnerable version of shescape under a Dash shell environment. The resulting output must then be integrated directly into a variable assignment inside the executed shell command.

An attacker supplies the payload :~ through an untrusted input parameter. The escaping logic in shescape ignores this input sequence, returning the payload verbatim without applying backslash-escaping.

When the application processes this output dynamically into a command such as cp.execSync('VAR=' + escapedPayload), the resulting instruction evaluated by the shell is VAR=:~. The Dash parser evaluates this string inside the assignment block and expands the tilde.

// Proof-of-concept demonstrating path disclosure
import * as cp from "node:child_process";
import { Shescape } from "shescape";
 
const options = { shell: "dash" };
const shescape = new Shescape(options);
const payload = ":~";
const escapedPayload = shescape.escape(payload); 
 
// Returns vulnerable payload unmodified because of the regex gap
const result = cp.execSync(`V=${escapedPayload}; echo $V`, options);
console.log(result.toString());
// Vulnerable output leaks absolute user path: ":/home/node-user"

This bypass allows unauthorized extraction of path details, mapping the internal directory structure of the host container or server.

Impact Assessment

The primary outcome of exploiting this flaw is system information leakage (CWE-200). Exposing the home directory path reveals structural elements of the host environment, such as user account names and localized application paths.

This information exposure acts as a precursor for more severe exploitation chains. Attackers can leverage absolute path knowledge to fine-tune local file inclusion (LFI) attempts, target specific file paths during directory traversal, or weaponize secondary logical flaws.

For Windows environments, the parenthetical breakout addressed in the CMD patch carries a high security impact. If untrusted input is interpolated within a parenthetical block, an attacker can prematurely close the block and append arbitrary execution commands.

The vulnerability is rated with a CVSS v4 score of 6.3, highlighting its network-based delivery and low complexity, limited by specific shell execution requirements. Due to its registry-only advisory status, it does not have a traditional CVE index, causing potential gaps in signature-based scanner databases.

Remediation and Defensive Measures

The recommended resolution is updating the shescape library dependency to a secure release. For projects using the v2 release branch, update to 2.1.14 or later; for v3 installations, update to 3.0.1 or later.

If upgrading is not immediately possible, applications should pass dynamic parameters to child execution processes using environment variable dictionaries rather than string concatenation in a raw shell command.

// Secure parameter passing implementation
import * as cp from "node:child_process";
 
cp.execFile("task-executable", [], {
  env: { ...process.env, USER_INPUT: untrustedInput }
});

Additionally, applications can filter incoming inputs to block strings that contain tildes (~) or colons (:) preceding structural characters. Restricting the use of shell spawning and moving to safer parameter-based execution layers reduces the overall attack surface.

Official Patches

Eric Cornelissenv3 remediation commit for escaping vulnerabilities
Eric Cornelissenv2 remediation commit backport

Fix Analysis (2)

Technical Appendix

CVSS Score
6.3/ 10

Affected Systems

npm package shescape on Unix platforms utilizing Dash shellnpm package shescape on Unix platforms utilizing Zsh with EXTENDED_GLOBnpm package shescape on Windows platforms utilizing CMD

Affected Versions Detail

Product
Affected Versions
Fixed Version
shescape
Eric Cornelissen
< 2.1.142.1.14
shescape
Eric Cornelissen
>= 3.0.0, < 3.0.13.0.1
AttributeDetail
CWE IDCWE-116, CWE-200
Attack VectorNetwork
CVSS v4 Score6.3 (Medium)
Exploit StatusProof-of-Concept
KEV StatusNot Listed
ImpactInformation Disclosure / Arbitrary Command Execution

MITRE ATT&CK Mapping

T1082System Information Discovery
Discovery
T1083File and Directory Discovery
Discovery
T1059Command and Scripting Interpreter
Execution

Known Exploits & Detection

GitHub Security AdvisoryOfficial advisory proof-of-concept showing home directory disclosure in Dash

Vulnerability Timeline

Remediation commits push to GitHub repository
2026-07-22
Security Advisory GHSA-q53c-4prm-w95q published
2026-07-24
Patched versions released to npm registry
2026-07-24

References & Sources

  • [1]GitHub Security Advisory GHSA-Q53C-4PRM-W95Q
  • [2]Shescape Repository Advisory
  • [3]v3 Remediation Commit
  • [4]v2 Remediation Commit (Backport)
  • [5]v3 Remediation Pull Request
  • [6]v2 Remediation Pull Request
  • [7]v2.1.14 Release Notes
  • [8]v3.0.1 Release Notes
  • [9]Shescape Migration Documentation

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•2 minutes ago•CVE-2026-109619
9.2

CVE-2026-109619: Remote Code Execution in PHP Core via Stale Global State Memory Corruption (PHP2Shell)

CVE-2026-109619 (PHP2Shell) is a critical Use-After-Free vulnerability in the core PHP engine caused by improper global state cleanup during out-of-memory exception handling across persistent worker requests.

Alon Barad
Alon Barad
1 views•6 min read
•5 minutes ago•CVE-2026-113721
4.5

CVE-2026-113721: Unsafe Link Resolution in virtualenv File Generation

In Python virtualenv prior to version 21.14.9, activation script generators and configuration writers use Path.exists() before writing files. Because Path.exists() resolves symbolic links, it returns False for dangling symlinks. Consequently, virtualenv skips unlinking pre-planted symbolic links or hard links, writing data directly to target locations outside the intended virtual environment directory.

Amit Schendel
Amit Schendel
1 views•5 min read
•9 days ago•CVE-2026-87697
8.8

CVE-2026-87697: Untrusted Deserialization in .NET PresentationCore Clipboard Handling

A remote code execution vulnerability exists in Microsoft .NET due to untrusted data deserialization within the PresentationCore component. The flaw stems from implicit auto-conversion flags during clipboard data retrieval operations.

Alon Barad
Alon Barad
31 views•5 min read
•9 days ago•CVE-2026-70007
8.8

CVE-2026-70007: Out-of-Bounds Write Vulnerability in .NET Framework and WPF Subsystem

An out-of-bounds write vulnerability in Microsoft .NET Framework, .NET runtime, and Visual Studio allows unauthenticated remote attackers to execute arbitrary code via crafted pixel-shader bytecode or auto-converted clipboard payloads.

Amit Schendel
Amit Schendel
19 views•6 min read
•10 days ago•CVE-2026-70186
7.5

CVE-2026-70186: ASP.NET Core Denial of Service Vulnerability via Framework Deadlock

ASP.NET Core contains a thread deadlock vulnerability (CWE-833) that allows an unauthenticated remote attacker to cause a denial of service over the network by exhausting server thread pool resources.

Amit Schendel
Amit Schendel
18 views•5 min read
•10 days ago•CVE-2026-70035
8.8

CVE-2026-70035: Insecure Deserialization Remote Code Execution in Microsoft .NET Framework and .NET Runtime

CVE-2026-70035 is a high-severity Remote Code Execution (RCE) vulnerability in Microsoft .NET Framework, .NET runtime, and Visual Studio caused by improper handling during the deserialization of untrusted data (CWE-502). An unauthenticated attacker can execute arbitrary code within the context of the affected process by delivering a crafted serialized payload.

Amit Schendel
Amit Schendel
24 views•6 min read