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.
Published: 2026-04-20
Score: 6.6 Medium
EPSS: < 1% Very Low
KEV: No
Impact: Arbitrary file overwrite via symbolic link following during .env rewrite
Action: Update to v1.2.2
AI Analysis

Analysis and contextual insights are available on OpenCVE Cloud.

Remediation

No vendor fix or workaround currently provided.

Additional remediation guidance may be available on OpenCVE Cloud.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-mf9w-mj56-hr94 python-dotenv: Symlink following in set_key allows arbitrary file overwrite via cross-device rename fallback
History

Mon, 27 Apr 2026 13:45:00 +0000

Type Values Removed Values Added
First Time appeared Saurabh-kumar
Saurabh-kumar python-dotenv
CPEs cpe:2.3:a:saurabh-kumar:python-dotenv:*:*:*:*:*:python:*:*
Vendors & Products Saurabh-kumar
Saurabh-kumar python-dotenv

Wed, 22 Apr 2026 12:15:00 +0000

Type Values Removed Values Added
First Time appeared Theskumar
Theskumar python-dotenv
Vendors & Products Theskumar
Theskumar python-dotenv
References
Metrics threat_severity

None

threat_severity

Moderate


Mon, 20 Apr 2026 18:15:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Mon, 20 Apr 2026 16:45:00 +0000

Type Values Removed Values Added
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.
Title python-dotenv: Symlink following in set_key allows arbitrary file overwrite via cross-device rename fallback
Weaknesses CWE-59
CWE-61
References
Metrics cvssV3_1

{'score': 6.6, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:H'}


Subscriptions

Saurabh-kumar Python-dotenv
Theskumar Python-dotenv
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-04-20T17:43:09.477Z

Reserved: 2026-03-02T21:43:19.927Z

Link: CVE-2026-28684

cve-icon Vulnrichment

Updated: 2026-04-20T17:42:50.526Z

cve-icon NVD

Status : Analyzed

Published: 2026-04-20T17:16:33.087

Modified: 2026-04-27T13:44:13.593

Link: CVE-2026-28684

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-04-20T16:25:12Z

Links: CVE-2026-28684 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-04-22T11:47:33Z

Weaknesses