CVE-2026-28684python-dotenv: Symlink following in set_key allows arbitrary file overwrite via…
python-dotenv reads key-value pairs from a .env file and can set them as environment variables. Prior to version 1.2.2, `set_key()` and `unset_key()` in python-dotenv follow symbolic links when rewriting `.env` files, allowing a local attacker to overwrite arbitrary files via a crafted symlink when a cross-device rename fallback is triggered. Users should upgrade to v.1.2.2 or, as a workaround, apply the patch manually.
What to do
Fixed builds are available from PyPI: see the table below for the fixed version per release.
Debian, Ubuntu have 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 | python-dotenv | Fix pending | UBUNTU-CVE-2026-28684 | |
| Ubuntu 26.04 | python-dotenv | Under investigation | UBUNTU-CVE-2026-28684 | |
| Ubuntu 25.10 | python-dotenv | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2026-28684 | |
| Ubuntu 24.04 | python-dotenv | Under investigation | UBUNTU-CVE-2026-28684 | |
| Ubuntu 22.04 | python-dotenv | Under investigation | UBUNTU-CVE-2026-28684 | |
| Ubuntu 20.04 | python-dotenv | Fix pending | UBUNTU-CVE-2026-28684 | |
| Ubuntu 18.04 | python-dotenv | Fix pending | UBUNTU-CVE-2026-28684 | |
| Debian 14 | python-dotenv | Fix pending | DEBIAN-CVE-2026-28684 | |
| Debian 13 | python-dotenv | Fix pending | DEBIAN-CVE-2026-28684 | |
| Debian 12 | python-dotenv | Fix pending | DEBIAN-CVE-2026-28684 | |
| PyPI library | python-dotenv | Fixed | 1.2.2 | PYSEC-2026-2270 |
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.
- theskumar python-dotenv: affected: < 1.2.2
References
- https://github.com/theskumar/python-dotenv/security/advisories/GHSA-mf9w-mj56-hr94
- https://github.com/theskumar/python-dotenv/commit/790c5c02991100aa1bf41ee5330aca75edc51311
- https://github.com/theskumar/python-dotenv/releases/tag/v1.2.2
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.