{"id":"CVE-2026-28684","published":"2026-04-20T16:25:12Z","modified":"2026-04-20T17:43:09Z","title":"python-dotenv: Symlink following in set_key allows arbitrary file overwrite via cross-device rename fallback","vendor":"theskumar","product":"python-dotenv","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":6.6,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00262,"percentile":0.18388,"provenance":"source"},"cwes":[{"id":"CWE-59","name":"Improper Link Resolution Before File Access"},{"id":"CWE-61","name":"UNIX Symbolic Link (Symlink) Following"}],"references":[{"url":"https://github.com/theskumar/python-dotenv/security/advisories/GHSA-mf9w-mj56-hr94","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/theskumar/python-dotenv/commit/790c5c02991100aa1bf41ee5330aca75edc51311","tags":["x_refsource_MISC"]},{"url":"https://github.com/theskumar/python-dotenv/releases/tag/v1.2.2","tags":["x_refsource_MISC"]}],"priority":{"score":8.3,"factors":[{"name":"EPSS percentile","points":3.68},{"name":"CVSS severity","points":4.62}]},"vendorSlug":"theskumar","affectedVersions":[{"vendor":"theskumar","product":"python-dotenv","versions":["< 1.2.2"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"total","timestamp":"2026-04-20T17:43:03.518532Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"python-dotenv","vulnerableRanges":["<1.2.2"],"patched":["1.2.2"],"from":["GHSA-mf9w-mj56-hr94","PYSEC-2026-2270"],"provenance":"source"}],"summary":{"text":"A flaw in python-dotenv's set_key() and unset_key() functions causes them to follow symbolic links when rewriting .env files, which is the component that reads key-value pairs from .env files and can set them as environment variables. An attacker with local access and low privileges can overwrite arbitrary files by planting a crafted symlink, but only when the cross-device rename fallback is triggered and a user must interact with the affected operation.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:11:48Z"},"euvd":{"id":"EUVD-2026-23901","exploited":false,"provenance":"source"}}