Local file overwrite via cross-device symlink following
Published Apr 20, 2026 · Updated Apr 20, 2026
Symlink following in python-dotenv before 1.2.2 allows local users to overwrite files writable by a calling process. The rewrite context manager passes a symbolic-link path to shutil.move; after a cross-device rename failure, copy2 follows the link and writes replacement content to its target. Exploitation requires directory write access, different filesystems for the temporary file and target, and a process that invokes set_key or unset_key; the target is then corrupted without a race.
Summary
What happened
Symlink following in python-dotenv before 1.2.2 allows local users to overwrite files writable by a calling process. The rewrite context manager passes a symbolic-link path to shutil.move; after a cross-device rename failure, copy2 follows the link and writes replacement content to its target. Exploitation requires directory write access, different filesystems for the temporary file and target, and a process that invokes set_key or unset_key; the target is then corrupted without a race.
The record
- CVE
- CVE-2026-28684
- Published
- Apr 20, 2026
- Updated
- Apr 20, 2026
- Vendor
- Saurabh Kumar
- Product
- python-dotenv
- Classifications
- CWE-61, CWE-59, T1068
- Attack vector
- local
- Privileges
- authenticated
Timeline
How it unfolded
- Apr 20, 2026CVE publishedPublication date reported by the CVE source.
- Apr 20, 2026Record updatedLatest update available in the CVE record.
Exploitability
Present is not the same as exploitable
Compare your product and version with the public record. A matching version still requires validation against your environment.
Is a vulnerable build present?
Compare these published version ranges with your installed build and any vendor patches.
- Affected versionversion=< 1.2.2
What conditions does exploitation require?
What is affected?
Published CVSS scores
CVSS describes severity. EPSS estimates exploitation probability.
Attacks
What attackers are doing with it
Daily unique IPs observed by Shadowserver honeypots for known exploited vulnerabilities (KEVs). Missing observations do not establish an absence of attacks.
Weakness, pattern, technique
Public exploit references
- GitHub advisory cross-device symlink proof of conceptproof of concept · demonstrated
Labels summarize the accepted research assessment. They do not indicate a test against your environment.
Technologies
Your stack
See the directory against your own environment.
Your stack
Check the software in your environment
Book a demo to see how Hinoki identifies affected software and validates exploitability in your environment.
Book a demo