CVE-2026-28684 python-dotenv: Symlink following in set_key allows arbitrary file overwrite via cross-device rename fallback

Medium 6.6 Published Updated

A local attacker can overwrite arbitrary files by exploiting symlink following in python-dotenv's set_key function during cross-device rename operations.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2026-28684?

CVE-2026-28684 is a medium-severity path traversal vulnerability in theskumar python-dotenv, published on 20 Apr 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

Official 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.

Weakness: CWE-61, CWE-59

Which versions are affected by CVE-2026-28684?

3 open source packages ship an affected version, including python-dotenv. It affects 1 product.

PackageAffectedFixed in
python-dotenv PyPIAll versions1.2.2
python-dotenv PyPIAll versions1.2.2
python-dotenv PyPIAll versions1.2.2
Linux distribution packages (4)
python-python-dotenv SUSE:Linux Enterprise Module for Python 3 15 SP7All versions1.0.0-150400.9.6.1
python-python-dotenv SUSE:Linux Enterprise Server 16.0All versions1.1.0-160000.3.1
python-python-dotenv SUSE:Linux Enterprise Server for SAP applications 16.0All versions1.1.0-160000.3.1
python-python-dotenv openSUSE:Leap 16.0All versions1.1.0-160000.3.1

Products include Saurabh-Kumar Python-Dotenv.

How do I fix CVE-2026-28684?

Upgrade python-dotenv to 1.2.2 or later.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2026-28684 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-28684 exists.

Sources

Also known as CLEANSTART-2026-GV24455, CLEANSTART-2026-TX03176, DEBIAN-CVE-2026-28684, ECHO-f84b-10a2-6d9d, GHSA-mf9w-mj56-hr94, MINI-27fv-mh5x-464v and 20 more.

Is CVE-2026-28684 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free