Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. python-dotenv
  4. ›
  5. CVE-2026-28684

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

April 21, 2026

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.

References

  • github.com/advisories/GHSA-mf9w-mj56-hr94
  • github.com/theskumar/python-dotenv
  • github.com/theskumar/python-dotenv/commit/790c5c02991100aa1bf41ee5330aca75edc51311
  • github.com/theskumar/python-dotenv/commit/790c5c02991100aa1bf41ee5330aca75edc51311.patch
  • github.com/theskumar/python-dotenv/releases/tag/v1.2.2
  • github.com/theskumar/python-dotenv/security/advisories/GHSA-mf9w-mj56-hr94
  • nvd.nist.gov/vuln/detail/CVE-2026-28684

Code Behaviors & Features

Detect and mitigate CVE-2026-28684 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 1.2.2

Fixed versions

  • 1.2.2

Solution

Upgrade to version 1.2.2 or above.

Impact 6.6 MEDIUM

CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-59: Improper Link Resolution Before File Access ('Link Following')
  • CWE-61: UNIX Symbolic Link (Symlink) Following

Source file

pypi/python-dotenv/CVE-2026-28684.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Fri, 24 Apr 2026 12:20:42 +0000.