CVE-2025-24959Environment Variable Injection for dotenv API in zx
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.
What to do
Fixed builds are available from npm: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.10 | node-zx | Fix pending | UBUNTU-CVE-2025-24959 | |
| Ubuntu 26.04 | node-zx | Under investigation | UBUNTU-CVE-2025-24959 | |
| Ubuntu 25.10 | node-zx | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2025-24959 | |
| Ubuntu 24.04 | node-zx | Under investigation | UBUNTU-CVE-2025-24959 | |
| npm library | zx | Fixed | 8.3.2 | GHSA-qwp8-x4ff-5h87 |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- google zx: affected: >= 8.3.0, < 8.3.2
References
- https://github.com/google/zx/security/advisories/GHSA-qwp8-x4ff-5h87
- https://github.com/google/zx/pull/1094
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.