# CVE-2025-30222: Shescape has potential environment variable exposure on Windows with CMD

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** LOW 2.1
- **CVSS:** 2.1 (v4.0, CNA) `CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:U`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Attack requirements: Present; Privileges required: None; User interaction: None; Confidentiality impact: High; Integrity impact: None; Availability impact: None; Confidentiality impact on other systems: None; Integrity impact on other systems: None; Availability impact on other systems: None; Exploit maturity: Unreported
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.30% (percentile 15, 2026-11-26)
- **CWE:** CWE-200
- **Aliases:** GHSA-66pp-5p9w-q87j
- **Published:** 2025-03-25T23:00:08.995Z
- **Modified:** 2026-09-10T03:50:22.897Z

## Who should check

- Projects that depend on npm package shescape (\>= 1.7.2, \< 2.1.2)
- Anyone running ericcornelissen shescape \>= 1.7.2, \< 2.1.2

## Description

Shescape is a simple shell escape library for JavaScript. Versions 1.7.2 through 2.1.1 are vulnerable to potential environment variable exposure on Windows with CMD. This impact users of Shescape on Windows that explicitly configure \`shell: 'cmd.exe'\` or \`shell: true\` using any of \`quote\`/\`quoteAll\`/\`escape\`/\`escapeAll\`. An attacker may be able to get read-only access to environment variables. This bug has been patched in v2.1.2. For those who are already using v2 of Shescape, no further changes are required. Those who are are using v1 of Shescape should follow the migration guide to upgrade to v2. There is no plan to release a patch compatible with v1 of Shescape. As a workaround, users can remove all instances of \`%\` from user input before using Shescape.

## Affected and fixed versions

- npm `shescape`: affected \>= 1.7.2, \< 2.1.2; fixed 2.1.2 (osv)
- ericcornelissen shescape: \>= 1.7.2, \< 2.1.2 (cvelist)

## Mitigation

- Upgrade shescape to 2.1.2 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-30222. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-30222.md
Affected: shescape >= 1.7.2, < 2.1.2
Fixed in: 2.1.2

Steps:
1. Search this machine and project for shescape (npm), ericcornelissen shescape: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-30222 being exploited?

There is no confirmed exploitation: CVE-2025-30222 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.30% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2025-30222?

Low: CVSS 2.1 (v4.0, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2025-30222?

shescape \>= 1.7.2, \< 2.1.2.

### Is there a fix for CVE-2025-30222?

Yes. Fixed in 2.1.2. Upgrade shescape to 2.1.2 or later.

### How do I check if I'm affected by CVE-2025-30222?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/ericcornelissen/shescape/security/advisories/GHSA-66pp-5p9w-q87j>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2025-30222>
- patch: <https://github.com/ericcornelissen/shescape/pull/1916>
- patch: <https://github.com/ericcornelissen/shescape/commit/0a81f1eb077bab8caae283a2490cd7be9af179c6>
- other: <https://github.com/ericcornelissen/shescape/releases/tag/v2.1.2>
- other: <https://github.com/ericcornelissen/shescape>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-30222>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-66pp-5p9w-q87j> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2025-30222> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-30222>
