The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-28684

CVE-2026-28684: python-dotenv Path Traversal Vulnerability

CVE-2026-28684 is a path traversal flaw in python-dotenv that allows local attackers to overwrite arbitrary files via symlink exploitation. This article covers the technical details, affected versions, and mitigation.

Published: April 23, 2026

CVE-2026-28684 Overview

CVE-2026-28684 is a symlink attack vulnerability affecting python-dotenv, a popular Python library that reads key-value pairs from .env files and sets them as environment variables. Prior to version 1.2.2, the set_key() and unset_key() functions follow symbolic links when rewriting .env files, enabling a local attacker to overwrite arbitrary files via a crafted symlink when a cross-device rename fallback is triggered.

Critical Impact

Local attackers can exploit this vulnerability to overwrite arbitrary files on the system, potentially leading to integrity compromise or denial of service through destruction of critical files.

Affected Products

  • python-dotenv versions prior to 1.2.2

Discovery Timeline

  • 2026-04-20 - CVE CVE-2026-28684 published to NVD
  • 2026-04-20 - Last updated in NVD database

Technical Details for CVE-2026-28684

Vulnerability Analysis

This vulnerability is classified under CWE-59 (Improper Link Resolution Before File Access), commonly known as a symlink attack. The flaw exists in how python-dotenv handles file operations when modifying .env files through its set_key() and unset_key() functions.

When these functions modify a .env file, they may trigger a cross-device rename fallback mechanism. During this fallback process, the library fails to properly resolve or validate symbolic links before performing write operations. This insecure behavior allows an attacker who can place a symlink in the expected location of a .env file to redirect write operations to arbitrary files on the filesystem.

The attack requires local access and user interaction, as the victim must trigger one of the vulnerable functions while the malicious symlink is in place. Successful exploitation can result in complete integrity and availability compromise of the targeted files.

Root Cause

The root cause of this vulnerability lies in the improper handling of symbolic links during file rewriting operations. When python-dotenv performs a cross-device rename fallback, it follows symlinks without verifying whether the target path is a legitimate .env file or a symbolic link pointing elsewhere. This failure to resolve and validate the link target before writing allows the file content to be written to unintended locations.

Attack Vector

The attack vector is local, requiring the attacker to have some level of access to the system where python-dotenv is being used. The exploitation scenario involves:

  1. The attacker creates a malicious symbolic link at the location where a .env file is expected
  2. The symlink points to a sensitive file the attacker wishes to overwrite (e.g., configuration files, scripts, or other critical system files)
  3. When a privileged user or application calls set_key() or unset_key() on what it believes is the .env file, the operation follows the symlink
  4. The targeted file gets overwritten with the .env content, potentially destroying critical data or enabling further exploitation

This attack requires user interaction (the victim must trigger the vulnerable function) and low privileges to set up the initial symlink.

Detection Methods for CVE-2026-28684

Indicators of Compromise

  • Unexpected symlinks appearing in directories containing .env files
  • Modification of system or application files that should not be written to by python-dotenv operations
  • Unusual file permission changes or ownership modifications on sensitive configuration files
  • Log entries indicating .env file operations targeting unexpected paths

Detection Strategies

  • Monitor file system operations for symlink creation in directories where .env files are commonly stored
  • Implement file integrity monitoring on critical system and application configuration files
  • Use application-level logging to track set_key() and unset_key() function calls and their target paths
  • Deploy endpoint detection rules that alert on processes following symlinks during file write operations

Monitoring Recommendations

  • Enable audit logging for symlink creation events in application directories
  • Configure SentinelOne endpoint protection to monitor for suspicious file linking patterns
  • Implement real-time alerting for unexpected writes to sensitive system files
  • Review application logs for python-dotenv operations that may indicate exploitation attempts

How to Mitigate CVE-2026-28684

Immediate Actions Required

  • Upgrade python-dotenv to version 1.2.2 or later immediately
  • Audit existing .env file locations for unexpected symbolic links
  • Review file permissions on directories containing .env files to restrict symlink creation
  • Implement temporary access controls to limit who can create files in sensitive directories

Patch Information

The vulnerability has been addressed in python-dotenv version 1.2.2. Users should upgrade to this version or later to receive the fix. The patch is available through the GitHub Commit and the GitHub Release v1.2.2. Additional details can be found in the GitHub Security Advisory GHSA-mf9w-mj56-hr94.

Workarounds

  • Apply the patch manually from the security advisory if immediate upgrade is not possible
  • Restrict write permissions on directories containing .env files to trusted users only
  • Implement file system monitoring to detect and alert on symlink creation in sensitive directories
  • Consider using containerization or sandboxing to limit the impact of potential exploitation
bash
# Upgrade python-dotenv to patched version
pip install --upgrade python-dotenv>=1.2.2

# Verify installed version
pip show python-dotenv | grep Version

# Check for symbolic links in .env file locations
find /path/to/application -name ".env" -type l -ls

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypePath Traversal

  • Vendor/TechPython Dotenv

  • SeverityMEDIUM

  • CVSS Score6.6

  • EPSS Probability0.02%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityHigh
  • AvailabilityHigh
  • CWE References
  • CWE-59
  • Technical References
  • GitHub Commit Update

  • GitHub Release v1.2.2

  • GitHub Security Advisory GHSA-mf9w-mj56-hr94
  • Latest CVEs
  • CVE-2026-43328: Linux Kernel Use-After-Free Vulnerability

  • CVE-2026-43329: Linux Kernel Netfilter DoS Vulnerability

  • CVE-2026-43330: Linux Kernel Buffer Overflow Vulnerability

  • CVE-2026-43331: Linux Kernel DOS Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English