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
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| theskumar | python-dotenv | < 1.2.2 | — |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | python-dotenv | No fix yet | — |
| Debian 13 | python-dotenv | No fix yet | — |
| Debian 12 | python-dotenv | No fix yet | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 26.10 | python-dotenv | No fix yet | — |
| Ubuntu 26.04 LTS | python-dotenv | No fix yet | — |
| Ubuntu 25.10 | python-dotenv | No fix yet | — |
| Ubuntu 24.04 LTS | python-dotenv | No fix yet | — |
| Ubuntu 22.04 LTS | python-dotenv | No fix yet | — |
Show 2 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 20.04 LTS | python-dotenv | No fix yet | — |
| Ubuntu 18.04 LTS | python-dotenv | No fix yet | — |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 3 | python-python-dotenv | 1.0.0-150400.9.6.1 | SUSE-SU-2026:2724-1 |
Show 2 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES for SAP 16.0 | python-python-dotenv | 1.1.0-160000.3.1 | SUSE-SU-2026:22118-1 |
| SLES 16.0 | python-python-dotenv | 1.1.0-160000.3.1 | SUSE-SU-2026:22118-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Leap 16.0 | python-python-dotenv | 1.1.0-160000.3.1 | openSUSE-SU-2026:20952-1 |
Wolfi
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Wolfi rolling | ggshield | 1.49.0-r1 | — |
| Wolfi rolling | kserve-storage-controller | 0.17.0-r2 | — |
| Wolfi rolling | superset-6.0 | 6.0.0-r11 | — |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| PyPI | python-dotenv | < 1.2.2 | 1.2.2 | GHSA-mf9w-mj56-hr94 |
Advisories 6
- WID-SEC-2026-3046 IBM Concert: Mehrere Schwachstellen BSI CERT-Bund (WID) · Nov 10, 2026
- WID-SEC-2026-2933 Splunk SOAR: Mehrere Schwachstellen BSI CERT-Bund (WID) · Nov 2, 2026
- WID-SEC-2026-1407 IBM App Connect Enterprise Certified Container: Mehrere Schwachstellen BSI CERT-Bund (WID) · Aug 3, 2026
- SUSE-SU-2026:2724-1 Security update for python-python-dotenv SUSE / openSUSE Security Updates · Jul 3, 2026
- SUSE-SU-2026:22118-1 Security update for python-python-dotenv SUSE / openSUSE Security Updates · Jun 17, 2026
- openSUSE-SU-2026:20952-1 Security update for python-python-dotenv SUSE / openSUSE Security Updates · Jun 16, 2026