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-2024-4030

CVE-2024-4030: Python tempfile Information Disclosure

CVE-2024-4030 is an information disclosure vulnerability in Python's tempfile.mkdtemp() on Windows that may expose temporary directories to unauthorized users. This article covers technical details, affected versions, and mitigations.

Published: January 28, 2026

CVE-2024-4030 Overview

CVE-2024-4030 is an Insecure Permissions vulnerability affecting Python's tempfile.mkdtemp() function on Windows systems. The vulnerability occurs when directories created by this function do not receive restrictive permissions, instead inheriting permissions from the default location. This can allow other users on the same system to read and write to temporary directories that should be private to the creating user.

The issue specifically impacts Windows environments where users have alternate configurations or lack a profile directory. On other platforms (Linux, macOS), the returned directory is consistently readable and writable only by the current user, making non-Windows systems unaffected.

Critical Impact

Local attackers can read or modify sensitive data stored in temporary directories created by Python applications, potentially leading to information disclosure or data tampering.

Affected Products

  • Python for Windows (various versions)
  • Applications using tempfile.mkdtemp() on Windows with non-default temporary directory configurations
  • Windows systems where users do not have a profile directory

Discovery Timeline

  • May 7, 2024 - CVE-2024-4030 published to NVD
  • November 21, 2024 - Last updated in NVD database

Technical Details for CVE-2024-4030

Vulnerability Analysis

This vulnerability stems from Python's inability to properly enforce Unix-style permissions on Windows systems. When tempfile.mkdtemp() creates a temporary directory, it should ensure the directory is accessible only by the current user (equivalent to Unix permission mode 700). However, on Windows, the created directory inherits permissions from its parent directory rather than applying restrictive permissions.

The impact is significant for applications that store sensitive data in temporary directories, assuming those directories are private. In multi-user Windows environments, other authenticated users could potentially access, modify, or delete files in these supposedly private temporary directories. This could lead to information disclosure of sensitive application data or integrity violations if an attacker modifies temporary files used by the application.

Root Cause

The root cause is Python's lack of support for applying Unix-style permissions on Windows. The mkdir function underlying tempfile.mkdtemp() did not translate Unix permission mode 700 (owner read/write/execute only) into equivalent Windows Access Control Lists (ACLs). As a result, newly created temporary directories inherited their parent directory's permissions rather than being restricted to the creating user.

Attack Vector

The attack requires local access to the target Windows system. An authenticated attacker sharing the same system could enumerate temporary directories created by other users and access their contents. The attack is particularly effective in shared computing environments, terminal servers, or systems where multiple users have interactive access.

The attacker could monitor the default temporary directory location (typically %TEMP% or C:\Windows\Temp) for new directories created by target applications. Without proper permission restrictions, the attacker can read sensitive data, modify files to inject malicious content, or delete files to cause denial of service.

Detection Methods for CVE-2024-4030

Indicators of Compromise

  • Unexpected access to temporary directories by users other than the directory creator
  • File system audit logs showing cross-user access to directories within temporary paths
  • Modification timestamps on temporary files that don't correspond to the owning application's activity
  • Unusual file permissions on directories created by tempfile.mkdtemp() showing inherited rather than restrictive ACLs

Detection Strategies

  • Enable Windows Security Auditing for object access on temporary directories to log unauthorized access attempts
  • Implement file integrity monitoring on critical temporary directory paths used by sensitive applications
  • Use PowerShell or security tools to periodically scan temporary directories for overly permissive ACLs
  • Monitor for Python applications using vulnerable versions by tracking installed Python versions across the environment

Monitoring Recommendations

  • Configure SentinelOne to detect and alert on cross-user file access patterns in temporary directories
  • Establish baseline behavior for temporary directory creation and access patterns
  • Deploy endpoint detection rules that identify permission inheritance issues on newly created directories
  • Integrate Python version inventory with vulnerability management workflows to identify affected systems

How to Mitigate CVE-2024-4030

Immediate Actions Required

  • Upgrade Python to a patched version that includes the fix for Unix permission support in mkdir on Windows
  • Audit applications using tempfile.mkdtemp() to identify potential exposure
  • Configure custom temporary directory locations with restricted parent directory permissions as a defense-in-depth measure
  • Review Windows ACLs on existing temporary directories created by Python applications

Patch Information

The Python development team has released multiple patches addressing this vulnerability across different Python branches. The fix adds support for Unix "700" permissions in the mkdir function on Windows, ensuring tempfile.mkdtemp() creates directories with proper restrictive permissions.

Key patches are available through the GitHub Issue #118486 tracking this vulnerability. Additional details can be found in the Python Security Announcement. NetApp has also published guidance in their Security Advisory NTAP-20240705-0005.

Workarounds

  • Manually set restrictive ACLs on temporary directories after creation using Windows APIs or PowerShell
  • Use alternative temporary directory creation methods that explicitly set Windows security descriptors
  • Configure a dedicated temporary directory location with pre-set restrictive permissions for sensitive applications
  • Consider using platform-specific code paths that leverage Windows security APIs directly for security-critical temporary file operations
bash
# PowerShell: Check and fix permissions on temporary directories
# Audit existing Python temp directories for permission issues
Get-ChildItem -Path $env:TEMP -Directory | ForEach-Object {
    $acl = Get-Acl $_.FullName
    Write-Output "Directory: $($_.FullName)"
    $acl.Access | Format-Table IdentityReference, FileSystemRights, AccessControlType
}

# Set restrictive permissions on a specific directory
$path = "C:\Users\YourUser\AppData\Local\Temp\your_temp_dir"
$acl = Get-Acl $path
$acl.SetAccessRuleProtection($true, $false)
$rule = New-Object System.Security.AccessControl.FileSystemAccessRule(
    [System.Security.Principal.WindowsIdentity]::GetCurrent().Name,
    "FullControl",
    "ContainerInherit,ObjectInherit",
    "None",
    "Allow"
)
$acl.SetAccessRule($rule)
Set-Acl -Path $path -AclObject $acl

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

  • Vulnerability Details
  • TypeInformation Disclosure

  • Vendor/TechPython

  • SeverityHIGH

  • CVSS Score7.1

  • EPSS Probability0.03%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-276
  • Technical References
  • GitHub Commit 35c799d

  • GitHub Commit 5130731c

  • GitHub Commit 66f8bb76

  • GitHub Commit 6d0850c4

  • GitHub Commit 81939dad

  • GitHub Commit 8ed54667

  • GitHub Commit 91e3669e

  • GitHub Commit 94591dca

  • GitHub Commit c8f868dc

  • GitHub Commit d86b4941

  • GitHub Commit e1dfa978

  • GitHub Commit eb29e2f5

  • GitHub Issue #118486

  • Python Security Announcement

  • NetApp Security Advisory NTAP-20240705-0005
  • Related CVEs
  • CVE-2026-2297: CPython Information Disclosure Vulnerability

  • CVE-2025-12781: Python base64 Module Data Integrity Flaw

  • CVE-2021-28861: Python Open Redirection Vulnerability

  • CVE-2024-4032: Python ipaddress Module Info Disclosure
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now 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