CVEfocus › CVE database › CVE-2026-28684

CVE-2026-28684python-dotenv: Symlink following in set_key allows arbitrary file overwrite via…

CVSS 6.6 MediumEPSS 0.2% (higher than 5% of CVEs)Published 2026-04-20Updated 2026-04-20Assigner: GitHub_M

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.

CWE-59CWE-61

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

1Fixed
6Fix pending
3Under 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.10python-dotenvFix pendingUBUNTU-CVE-2026-28684
Ubuntu 26.04python-dotenvUnder investigationUBUNTU-CVE-2026-28684
Ubuntu 25.10python-dotenvWill not fix
Ubuntu decided not to fix this in this release
UBUNTU-CVE-2026-28684
Ubuntu 24.04python-dotenvUnder investigationUBUNTU-CVE-2026-28684
Ubuntu 22.04python-dotenvUnder investigationUBUNTU-CVE-2026-28684
Ubuntu 20.04python-dotenvFix pendingUBUNTU-CVE-2026-28684
Ubuntu 18.04python-dotenvFix pendingUBUNTU-CVE-2026-28684
Debian 14python-dotenvFix pendingDEBIAN-CVE-2026-28684
Debian 13python-dotenvFix pendingDEBIAN-CVE-2026-28684
Debian 12python-dotenvFix pendingDEBIAN-CVE-2026-28684
PyPI librarypython-dotenvFixed1.2.2PYSEC-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.

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.