What’s Vulnerable › Vulnerabilities
CVE-2026-28684: python-dotenv: Symlink following in set_key allows arbitrary file overwrite via cross-device rename fallback
- Severity: medium (CVSS 6.6 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 0.3% probability of exploitation in the next 30 days
- Public exploit or detection template: yes
- Published: 2026-04-20 · updated 2026-10-26
- Weakness: CWE-59
Description
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.
Affected products
- theskumar python-dotenv: before 1.2.2 — fixed in 1.2.2
How to fix
Upgrade to a fixed version: theskumar python-dotenv 1.2.2. Check the vendor advisory for mitigations.
References
- https://github.com/theskumar/python-dotenv/commit/790c5c02991100aa1bf41ee5330aca75edc51311
- https://github.com/theskumar/python-dotenv/releases/tag/v1.2.2
- https://github.com/theskumar/python-dotenv/security/advisories/GHSA-mf9w-mj56-hr94
- https://github.com/theskumar/python-dotenv/security/advisories/GHSA-mf9w-mj56-hr94
Get alerted when CVE-2026-28684 or the next vulnerability affects your stack