CVE-2024-4030: tempfile.mkdtemp() may be readable and writeable by all users on Windows

Published May 7, 2024
·
Updated

On Windows a directory returned by tempfile.mkdtemp() would not always have permissions set to restrict reading and writing to the temporary directory by other users, instead usually inheriting the correct permissions from the default location. Alternate configurations or users without a profile directory may not have the intended permissions.

If you’re not using Windows or haven’t changed the temporary directory location then you aren’t affected by this vulnerability. On other platforms the returned directory is consistently readable and writable only by the current user.

This issue was caused by Python not supporting Unix permissions on Windows. The fix adds support for Unix “700” for the mkdir function on Windows which is used by mkdtemp() to ensure the newly created directory has the proper permissions.

Affected Software

1 affected component
Python Python=

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Configuration

    Apply the change that adds support for Unix “700” for the mkdir function on Windows so directories created by tempfile.mkdtemp()/mkdtemp() are restricted (not readable/writeable by all users).

    Windows Python tempfile.mkdtemp()/mkdtemp() behavior mkdir support for Unix “700” permissions = enabled

Event History

May 7, 2024
CVE Published
via MITRE·09:02 PM
Data Sourced
via MITRE·09:02 PM
DescriptionWeakness
Data Sourced
via NVD·09:15 PM
DescriptionSeverityWeakness
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2024-4030?

CVE-2024-4030 has not been assigned a severity score yet, but it poses a risk due to improper permissions on temporary directories.

2

How do I fix CVE-2024-4030?

To fix CVE-2024-4030, update your Python installation to the latest version that includes the security patch.

3

What systems are affected by CVE-2024-4030?

CVE-2024-4030 affects Windows systems running affected versions of Python.

4

What are the potential impacts of CVE-2024-4030?

The potential impacts of CVE-2024-4030 include unauthorized access to temporary files created by Python applications.

5

When was CVE-2024-4030 discovered?

CVE-2024-4030 was disclosed in 2024, though specific discovery dates may vary depending on reports.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203