CVE-2026-28684
MEDIUM 6.6CVSS 3.1python-dotenv: Symlink following in set_key allows arbitrary file overwrite via cross-device rename fallback
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.
- Published
- 20 Apr 2026
- Last modified
- 26 Oct 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Analyzed
- Weakness
- CWE-59CWE-61
- Also known as
- GHSA-mf9w-mj56-hr94PYSEC-2026-2270
- Sources
- NVDJSONOSV GHSA-mf9w-mj56-hr94JSONOSV PYSEC-2026-2270JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | security-advisories@github.com (Secondary) | 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 |
| OSV | GitHub | 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 |
| OSV | PyPA | 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 |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | saurabh-kumar | python-dotenvcpe:2.3:a:saurabh-kumar:python-dotenv:*:*:*:*:*:python:*:* |
< 1.2.2 | 1.2.2 |
| OSV | PyPI | python-dotenv | < 1.2.2 | 1.2.2 |
References
- https://github.com/theskumar/python-dotenv/commit/790c5c02991100aa1bf41ee5330aca75edc51311 · Patch, WEB, FIX
- https://github.com/theskumar/python-dotenv/releases/tag/v1.2.2 · Release Notes, WEB, ADVISORY
- https://github.com/theskumar/python-dotenv/security/advisories/GHSA-mf9w-mj56-hr94 · Exploit, Patch, Vendor Advisory, WEB, FIX
- https://nvd.nist.gov/vuln/detail/CVE-2026-28684 · ADVISORY
- https://github.com/theskumar/python-dotenv/commit/790c5c02991100aa1bf41ee5330aca75edc51311.patch · WEB
- https://github.com/theskumar/python-dotenv · PACKAGE
History
- 25 Nov 2026 21:02 UTC · NVD: first stored (published 20 Apr 2026)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 20 Apr 2026)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 21 Apr 2026)