CVE-2023-35931 Shescape potential environment variable exposure on Windows with CMD
Low 3.1
Published
Updated
Check this codebase for CVE-2023-35931 and fix it if it is affected.
What it is: CVE-2023-35931 is a low-severity vulnerability in ericcornelissen shescape, published on 23 Jun 2023.
Exploitation: There is no known exploitation of CVE-2023-35931 in the wild and no public exploit code.
Affected packages and fixed versions:
- shescape (npm): affected all versions; fixed in 1.7.1
- shescape (npm): affected all versions; fixed in 1.7.1
Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.
Reference: https://insights.sbomify.com/CVE-2023-35931/ (Markdown: https://insights.sbomify.com/CVE-2023-35931/index.md)
- Exploited in the wild
- Not known
- Fix
- Available
What is CVE-2023-35931?
CVE-2023-35931 is a low-severity vulnerability in ericcornelissen shescape, published on 23 Jun 2023.
Official description
Shescape is a simple shell escape library for JavaScript. An attacker may be able to get read-only access to environment variables. This bug has been patched in version 1.7.1.
Weakness: CWE-526
Which versions are affected by CVE-2023-35931?
2 open source packages ship an affected version, including shescape. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
shescape npm | All versions | 1.7.1 |
shescape npm | All versions | 1.7.1 |
Products include Shescape Project Shescape.
How do I fix CVE-2023-35931?
Upgrade shescape to 1.7.1 or later.
Is CVE-2023-35931 being exploited?
There is no known exploitation of CVE-2023-35931 in the wild and no public exploit code.
Other vulnerabilities in ericcornelissen shescape
- CVE-2022-31180 Insufficient escaping of whitespace in shescape
- CVE-2022-31179 Insufficient escaping of line feeds for CMD in shescape
- CVE-2026-32094 Shescape escape() leaves bracket glob expansion active on Bash, BusyBox, and Dash
- CVE-2023-40185 Shescape on Windows escaping may be bypassed in threaded context
- CVE-2021-21384 Null characters not escaped in shescape
Sources
Also known as GHSA-3g7p-8qhx-mc8r.