CVE-2024-4030: tempfile.mkdtemp() may be readable and writeable by all users on Windows
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
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- 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
Frequently Asked Questions
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.
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.
What systems are affected by CVE-2024-4030?
CVE-2024-4030 affects Windows systems running affected versions of Python.
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.
When was CVE-2024-4030 discovered?
CVE-2024-4030 was disclosed in 2024, though specific discovery dates may vary depending on reports.