CVE-2025-24959
CVE-2025-24959 · Environment Variable Injection for dotenv API in zx
This page contains facts from public vulnerability sources. Check the original advisory before updating.
zx is a tool for writing better scripts. An attacker with control over environment variable values can inject unintended environment variables into `process.env`. This can lead to arbitrary command execution or unexpected behavior in applications that rely on environment variables for security-sensitive operations. Applications that process untrusted input and pass it through `dotenv.stringify` are particularly vulnerable. This issue has been patched in version 8.3.2. Users should immediately upgrade to this version to mitigate the vulnerability. If upgrading is not feasible, users can mitigate the vulnerability by sanitizing user-controlled environment variable values before passing them to `dotenv.stringify`. Specifically, avoid using `"`, `'`, and backticks in values, or enforce strict validation of environment variables before usage.
CVSS 1.0 · Low · EPSS 0.2% · Fix available
- Published
- Updated
Affected products and versions
zx
- Versions
- >= 8.3.0, < 8.3.2: Affected
No fix published
zx npm
- Versions
- 8.3.1
- Affected ranges
- SEMVER: ≥ 8.3.1, < 8.3.2
Update to 8.3.2
node-zx Ubuntu:24.04:LTS
- Versions
- 7.1.1+~cs6.7.23-2
- 7.1.1+~cs6.7.23-3
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
node-zx Ubuntu:25.10
- Versions
- 7.1.1+~cs6.7.23-3
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
node-zx Ubuntu:26.10
- Versions
- 7.1.1+~cs6.7.23-3
- 7.1.1+~cs6.7.23-4
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
node-zx Ubuntu:26.04:LTS
- Versions
- 7.1.1+~cs6.7.23-3
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published