Quick answers
- Is CVE-2023-35931 exploited in the wild?
- No. Junglewise Threat Intelligence has no report of CVE-2023-35931 being exploited in the wild.
- How severe is CVE-2023-35931?
- Low severity, with a CVSS score of 3.1, published 22 June 2023.
- Which products and versions are affected?
- shescape (npm) SEMVER:introduced=0,fixed=1.7.1.
- Is there a fix for CVE-2023-35931?
- Yes. shescape (npm): upgrade to 1.7.1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
- How is CVE-2023-35931 attacked?
- It is attacked over the network, in a software library.
- Am I affected by CVE-2023-35931?
- Check whether you run shescape (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.
How to fix
- shescape (npm): upgrade to 1.7.1 or later
npm install shescape@1.7.1
Technical details
Shescape fails to properly escape the percent sign (%) when used with the Windows Command Prompt (cmd.exe). When the 'interpolation' option is set to true in functions like quote, quoteAll, escape, or escapeAll, an attacker can provide a payload containing environment variable syntax (e.g., %PATH%). Because the library does not sanitize or escape these characters correctly for the CMD shell, the underlying system expands the variable, allowing the attacker to read its contents. This is classified as CWE-526 (Exposure of Sensitive Information Through Environmental Variables). The issue is fixed in version 1.7.1 by implementing proper percent-sign escaping.
Affected products
- ericcornelissen shescape < 1.7.1
Identifiers
- CVE-2023-35931
- GHSA-3g7p-8qhx-mc8r
Timeline
- 2023-06-21: patched: Fix released in version 1.7.1
- 2023-06-22: disclosed: Security advisory published
References
- https://github.com/ericcornelissen/shescape/security/advisories/GHSA-3g7p-8qhx-mc8r
- https://github.com/ericcornelissen/shescape/pull/982
- https://github.com/ericcornelissen/shescape/commit/d0fce70f987ac0d8331f93cb45d47e79436173ac
- https://github.com/ericcornelissen/shescape
- https://github.com/ericcornelissen/shescape/releases/tag/v1.7.1