Advisory record · GHSA-mf9w-mj56-hr94

python-dotenv: Symlink following in set_key allows arbitrary file overwrite via cross-device rename fallback

CVSS 6.6 MediumEPSS 0.0025 · 16th percentile

Published by the GitHub Advisory Database at 21 Apr 2026, 14:38 UTC. agentprime has not analysed this yet, so whether it affects any app is not known.

PackageEcosystemAffectedFixed in
python-dotenvPyPI<1.2.21.2.2
Identifiers
GHSA-mf9w-mj56-hr94 · CVE-2026-28684 · PYSEC-2026-2270
Weakness (CWE)
CWE-59 · CWE-61
Published
21 Apr 2026
Updated
10 Sept 2026

Machine-written summary

Summary written by Claude Haiku from the source advisory. Not reviewed by a person.

The python-dotenv package versions before 1.2.2 are affected. The set_key() and unset_key() functions follow symbolic links when rewriting .env files, so a local attacker who can write to the directory holding a .env file can cause a file the application can write to be overwritten, when the temporary file lies on a different filesystem. Upgrade python-dotenv to version 1.2.2 or later.

Written 1 Nov 2026.

Not analysed yet

We haven’t published our analysis of this Advisory yet. Once a person has reviewed it, this page will say what’s vulnerable, what has to be true for your app to be affected, and how to check.

Severity and exploitation

ScoreRatingCVSSVectorSource
6.6 Medium 3.1 CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:H CNA (GitHub_M)
  • CISA KEV Not listed.
  • EPSS 0.0025, the 16th percentile, on 6 Nov 2026: FIRST’s estimate of the chance of exploitation in the next 30 days.

Timeline

  1. 31 Oct 2026, 14:11 UTC First seen by agentprime
  2. 31 Oct 2026, 14:11 UTC Confirmed by OSV

Sources

Facts on this page come from the GitHub Advisory Database (CC-BY 4.0), OSV and the other sources listed, as published. We don’t reproduce full advisory descriptions, which can contain exploit code.