CVE-2024-4030

tempfile.mkdtemp() may be readable and writeable by all users on Windows

CVE-2024-4030 is fixed in 4 products on 2 platforms, first by Python 3.12 3.12.4, released June 6, 2024. 8 other affected products have no fix yet. It is not reported as exploited. Patch Radar priority: High.

HighFixed on 2 platforms
CVSS
7.1
No vendor severity
Exploitation
None reported
No vendor assessment
CISA KEV
Not listed
Not in the Known Exploited Vulnerabilities catalog
EPSS
0.0030
22nd percentile

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.

Where it's fixed

ProductFixed inFixReleased
Windows apps
Python 3.12 3.12.4 Python 3.12 3.12.4 Jun 6, 2024
Linux
python312 · opensuse-leap 15.6 3.12.4-150600.3.3.1 SUSE-SU-2024:2572-1 Jul 22, 2024
python312 · sles 15.6 3.12.4-150600.3.3.1 SUSE-SU-2024:2572-1 Jul 22, 2024
python312-core · opensuse-leap 15.6 3.12.4-150600.3.3.1 SUSE-SU-2024:2572-1 Jul 22, 2024
python312-core · sles 15.6 3.12.4-150600.3.3.1 SUSE-SU-2024:2572-1 Jul 22, 2024
python312-documentation · opensuse-leap 15.6 3.12.4-150600.3.3.1 SUSE-SU-2024:2572-1 Jul 22, 2024
No fix yet
Python 2 (Windows apps) No fix yet no-fix n/a
Python 3.10 (Windows apps) No fix yet no-fix n/a
Python 3.11 (Windows apps) No fix yet no-fix n/a
Python 3.5 (Windows apps) No fix yet no-fix n/a
Python 3.6 (Windows apps) No fix yet no-fix n/a
Python 3.7 (Windows apps) No fix yet no-fix n/a
Python 3.8 (Windows apps) No fix yet no-fix n/a
Python 3.9 (Windows apps) No fix yet no-fix n/a

Patch Radar data is free to use with attribution. Terms and how to credit it.

Product names, logos and trademarks shown on Patch Radar belong to their respective owners. They are used only to identify the software each security fix applies to and to help readers find their platform. Their use does not imply any affiliation with, or endorsement by, those owners, and Patchblox is not affiliated with any of them.