{"id":"CVE-2026-28684","state":"PUBLISHED","title":"python-dotenv: Symlink following in set_key allows arbitrary file overwrite via cross-device rename fallback","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.","publishedAt":"2026-04-20T16:25:12.302Z","updatedAt":"2026-04-20T17:43:09.477Z","severity":{"score":6.6,"label":"Medium","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:H","source":"GitHub_M"},"assigner":"GitHub_M","products":["theskumar python-dotenv"],"affected":[{"vendor":"theskumar","product":"python-dotenv","versions":[{"version":"< 1.2.2","status":"affected"}]}],"references":["https://github.com/theskumar/python-dotenv/security/advisories/GHSA-mf9w-mj56-hr94","https://github.com/theskumar/python-dotenv/commit/790c5c02991100aa1bf41ee5330aca75edc51311","https://github.com/theskumar/python-dotenv/releases/tag/v1.2.2"],"weaknesses":["CWE-59","CWE-61"],"ingestedAt":"2026-10-29T20:11:31.369Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/28xxx/CVE-2026-28684.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-28684","state":"PUBLISHED","datePublished":"2026-04-20T16:25:12.302Z","dateUpdated":"2026-04-20T17:43:09.477Z","assignerShortName":"GitHub_M","assignerOrgId":"a0819718-46f1-4df5-94e2-005712e83aaa","dateReserved":"2026-03-02T21:43:19.927Z"},"containers":{"cna":{"title":"python-dotenv: Symlink following in set_key allows arbitrary file overwrite via cross-device rename fallback","descriptions":[{"lang":"en","value":"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":[{"vendor":"theskumar","product":"python-dotenv","versions":[{"version":"< 1.2.2","status":"affected"}]}],"references":[{"url":"https://github.com/theskumar/python-dotenv/security/advisories/GHSA-mf9w-mj56-hr94","name":"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","name":"https://github.com/theskumar/python-dotenv/commit/790c5c02991100aa1bf41ee5330aca75edc51311","tags":["x_refsource_MISC"]},{"url":"https://github.com/theskumar/python-dotenv/releases/tag/v1.2.2","name":"https://github.com/theskumar/python-dotenv/releases/tag/v1.2.2","tags":["x_refsource_MISC"]}],"metrics":[{"cvssV3_1":{"attackComplexity":"LOW","attackVector":"LOCAL","availabilityImpact":"HIGH","baseScore":6.6,"baseSeverity":"MEDIUM","confidentialityImpact":"NONE","integrityImpact":"HIGH","privilegesRequired":"LOW","scope":"UNCHANGED","userInteraction":"REQUIRED","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:H","version":"3.1"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-59","lang":"en","description":"CWE-59: Improper Link Resolution Before File Access ('Link Following')","type":"CWE"}]},{"descriptions":[{"cweId":"CWE-61","lang":"en","description":"CWE-61: UNIX Symbolic Link (Symlink) Following","type":"CWE"}]}],"providerMetadata":{"shortName":"GitHub_M","orgId":"a0819718-46f1-4df5-94e2-005712e83aaa","dateUpdated":"2026-04-20T16:25:12.302Z"},"source":{"advisory":"GHSA-mf9w-mj56-hr94","discovery":"UNKNOWN"}},"adp":[{"title":"CISA ADP Vulnrichment","references":[{"url":"https://github.com/theskumar/python-dotenv/security/advisories/GHSA-mf9w-mj56-hr94","tags":["exploit"]}],"metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-04-20T17:43:03.518532Z","id":"CVE-2026-28684","options":[{"Exploitation":"poc"},{"Automatable":"no"},{"Technical Impact":"total"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-04-20T17:43:09.477Z"}}]}}}