# 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.

- Web page: https://patchblox.com/security/cve/CVE-2024-4030
- Priority: High
- CVSS: 7.1
- EPSS: 0.0030
- CISA KEV: not listed
- Exploited (vendor report): no
- Publicly disclosed: no
- Published: May 7, 2024
- Weakness: CWE-276: Incorrect Default Permissions
- Vendor advisory: https://nvd.nist.gov/vuln/detail/CVE-2024-4030

## Description

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

| Platform | Product | Fixed in | Fix | Released |
|---|---|---|---|---|
| Windows apps | Python 3.12 | 3.12.4 | [Python 3.12 3.12.4](https://patchblox.com/security/data/fix/windows-app/python.python.3.12-3.12.4.md) | Jun 6, 2024 |
| Linux | python312 opensuse-leap 15.6 | 3.12.4-150600.3.3.1 | [SUSE-SU-2024:2572-1](https://patchblox.com/security/data/fix/linux/suse-su-2024-2572-1.md) | Jul 22, 2024 |
| Linux | python312 sles 15.6 | 3.12.4-150600.3.3.1 | [SUSE-SU-2024:2572-1](https://patchblox.com/security/data/fix/linux/suse-su-2024-2572-1.md) | Jul 22, 2024 |
| Linux | python312-core opensuse-leap 15.6 | 3.12.4-150600.3.3.1 | [SUSE-SU-2024:2572-1](https://patchblox.com/security/data/fix/linux/suse-su-2024-2572-1.md) | Jul 22, 2024 |
| Linux | python312-core sles 15.6 | 3.12.4-150600.3.3.1 | [SUSE-SU-2024:2572-1](https://patchblox.com/security/data/fix/linux/suse-su-2024-2572-1.md) | Jul 22, 2024 |
| Linux | python312-documentation opensuse-leap 15.6 | 3.12.4-150600.3.3.1 | [SUSE-SU-2024:2572-1](https://patchblox.com/security/data/fix/linux/suse-su-2024-2572-1.md) | Jul 22, 2024 |

## No fix yet

| Platform | Product | Status |
|---|---|---|
| Windows apps | Python 2 | no-fix |
| Windows apps | Python 3.10 | no-fix |
| Windows apps | Python 3.11 | no-fix |
| Windows apps | Python 3.5 | no-fix |
| Windows apps | Python 3.6 | no-fix |
| Windows apps | Python 3.7 | no-fix |
| Windows apps | Python 3.8 | no-fix |
| Windows apps | Python 3.9 | no-fix |

---

Data as of 2026-11-08T00:53:09Z UTC. Source: Patchblox Patch Radar (https://patchblox.com/security/patch-radar). Patchblox finds out-of-date software on Windows, macOS and Linux and updates it through release rings: https://patchblox.com/demo

Free to use with attribution: show "Data: Patchblox Patch Radar" with a link to https://patchblox.com/security/patch-radar. Terms, including what needs a written agreement: https://patchblox.com/security/patch-radar/use-the-data

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.
