CVEfocus › CVE database › CVE-2025-24959

CVE-2025-24959Environment Variable Injection for dotenv API in zx

CVSS 1.0 LowEPSS 0.3% (higher than 11% of CVEs)Published 2025-02-03Updated 2025-02-12Assigner: GitHub_M

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.

CWE-94

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

1Fixed
1Fix pending
2Under investigation
1Will not fix

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.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 26.10node-zxFix pendingUBUNTU-CVE-2025-24959
Ubuntu 26.04node-zxUnder investigationUBUNTU-CVE-2025-24959
Ubuntu 25.10node-zxWill not fix
Ubuntu decided not to fix this in this release
UBUNTU-CVE-2025-24959
Ubuntu 24.04node-zxUnder investigationUBUNTU-CVE-2025-24959
npm libraryzxFixed8.3.2GHSA-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.

References

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.