CVE-2023-35931: Shescape potential environment variable exposure on Windows with CMD
3.1
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.48919%
CWE
Published
6/22/2023
Updated
11/7/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:N/A:N
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| shescape | npm | < 1.7.1 | 1.7.1 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from inadequate escaping of '%' characters in Windows CMD handling. The commit diff shows both functions in src/win/cmd.js were modified to add '%' escaping:
- escapeArgForInterpolation's regex was expanded to include '%' in the character set
- escapeArgForQuoted explicitly added a '%' replacement. These functions are directly responsible for argument sanitization when using quote/escape methods with CMD, and their pre-patch behavior allowed environment variable expansion through unescaped '%' characters.