python-dotenv: Symlink following in set_key allows arbitrary file overwrite via cross-device rename fallback (theskumar python-dotenv)
At a glance
- Source
- NVD
- EPSS
- EPSS 0.25 % · percentile 17 ()
- State
- PUBLISHED
- Published
- Updated
- Assigner
- GitHub_M
- NVD status
- Analyzed
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.
Weaknesses (CWE)
- CWE-59 — Improper Link Resolution Before File Access
- CWE-61 — UNIX Symbolic Link (Symlink) Following
References
Scores
| Version | Score | Vector | Scored by |
|---|---|---|---|
| CVSS 3.1 | MEDIUM 6.6 | CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:H | GitHub_M |
| CVSS 3.1 | MEDIUM 6.6 | CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:H | NVD · security-advisories@github.com (Secondary) |
Advisories
- GHSA-mf9w-mj56-hr94 — python-dotenv: Symlink following in set_key allows arbitrary file overwrite via cross-device rename fallback
- PYSEC-2026-2270 — 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-
European references
- ENISA EUVD · EUVD-2026-23901
- GCVE · GCVE-0-2026-28684
CERT-FR advisories
- CERTFR-2026-AVI-1056 — Multiples vulnérabilités dans les produits Splunk · cert.ssi.gouv.fr
- CERTFR-2026-AVI-0901 — Multiples vulnérabilités dans les produits IBM · cert.ssi.gouv.fr
Affected configurations (NVD CPE)
cpe:2.3:a:saurabh-kumar:python-dotenv:*:*:*:*:*:python:*:*< 1.2.2
Affected products
| Product | Versions |
|---|---|
| theskumar · python-dotenv | affected < 1.2.2 |
Sources
| Source | Licence |
|---|---|
| CVE List (CVEProject cvelistV5) | CVE Program Terms of Use |
| EPSS (FIRST.org) | FIRST — attribution requested |
| ENISA EUVD | ENISA — reproduction authorised, source acknowledged |
| CERT-FR (ANSSI) | Licence Ouverte / Etalab 2.0 |
| NVD (NIST) via fkie-cad/nvd-json-data-feeds | Public domain — this product uses data from the NVD API but is not endorsed or certified by the NVD |