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.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| Python Software Foundation | CPython | < 3.8.20, 3.9.0 – < 3.9.20, 3.10.0 – < 3.10.15, 3.11.0 – < 3.11.10, 3.12.0 – < 3.12.4, 3.13.0a1 – < 3.13.0b1 | 3.8.20 |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 3 | python312 +1 | 3.12.4-150600.3.3.1 | SUSE-SU-2024:2572-1 |
Show 2 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLE Micro 6.1 | python311 +1 | 3.11.12-slfo.1.1_1.1 | SUSE-SU-2025:20374-1 |
| SLE Micro 6.0 | python311 +1 | 3.11.11-1.1 | SUSE-SU-2025:20154-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | python310 | 3.10.15-1.1 | openSUSE-SU-2024:14345-1 |
| openSUSE Tumbleweed | python311 | 3.11.9-7.1 | openSUSE-SU-2024:14346-1 |
| openSUSE Tumbleweed | python312 | 3.12.5-1.1 | openSUSE-SU-2024:14295-1 |
| openSUSE Tumbleweed | python313 | 3.13.0~b3-1.1 | openSUSE-SU-2024:14109-1 |
| openSUSE Tumbleweed | python314 | 3.14.0~a1-1.1 | openSUSE-SU-2024:14434-1 |
| openSUSE Tumbleweed | python315 | 3.15.0~a1-1.1 | openSUSE-SU-2025:15713-1 |
| openSUSE Tumbleweed | python38 | 3.8.20-1.1 | openSUSE-SU-2024:14340-1 |
| openSUSE Tumbleweed | python39 | 3.9.20-1.1 | openSUSE-SU-2024:14331-1 |
| openSUSE Leap 15.6 | python312 +2 | 3.12.4-150600.3.3.1 | SUSE-SU-2024:2572-1 |
Advisories 15
- openSUSE-SU-2025:15713-1 python315-3.15.0~a1-1.1 on GA media SUSE / openSUSE Security Updates · Mar 23, 2026
- SUSE-SU-2025:20154-1 Security update for python311 SUSE / openSUSE Security Updates · Mar 23, 2026
- SUSE-SU-2025:20374-1 Security update for python311 SUSE / openSUSE Security Updates · Mar 23, 2026
- openSUSE-SU-2024:14434-1 python314-3.14.0~a1-1.1 on GA media SUSE / openSUSE Security Updates · Feb 4, 2026
- openSUSE-SU-2024:14340-1 python38-3.8.20-1.1 on GA media SUSE / openSUSE Security Updates · Feb 4, 2026
- openSUSE-SU-2024:14109-1 python313-3.13.0~b3-1.1 on GA media SUSE / openSUSE Security Updates · Feb 4, 2026
- openSUSE-SU-2024:14331-1 python39-3.9.20-1.1 on GA media SUSE / openSUSE Security Updates · Feb 4, 2026
- openSUSE-SU-2024:14345-1 python310-3.10.15-1.1 on GA media SUSE / openSUSE Security Updates · Feb 4, 2026
- WID-SEC-2025-2448 NetApp ActiveIQ Unified Manager: Schwachstelle ermöglicht Manipulation von Dateien und Offenlegung von Informationen BSI CERT-Bund (WID) · Oct 29, 2025
- openSUSE-SU-2024:14346-1 python311-3.11.9-7.1 on GA media SUSE / openSUSE Security Updates · May 7, 2025
- openSUSE-SU-2024:14295-1 python312-3.12.5-1.1 on GA media SUSE / openSUSE Security Updates · May 7, 2025
- SUSE-SU-2024:2572-1 Security update for python312 SUSE / openSUSE Security Updates · May 2, 2025
- NCSC-2025-0023 Kwetsbaarheden verholpen in Oracle PeopleSoft NCSC-NL (Netherlands) · Jan 22, 2025
- NCSC-2025-0021 Kwetsbaarheden verholpen in Oracle Communications NCSC-NL (Netherlands) · Jan 22, 2025
- NCSC-2025-0020 Kwetsbaarheden verholpen in Oracle Database producten NCSC-NL (Netherlands) · Jan 22, 2025
References
- https://mail.python.org/archives/list/security-announce@python.org/thread/PRGS5OR3N3PNPT4BMV2VAGN5GMUI5636/ vendor-advisory
- https://github.com/python/cpython/issues/118486 issue-tracking
- https://github.com/python/cpython/commit/81939dad77001556c527485d31a2d0f4a759033e patch
- https://github.com/python/cpython/commit/8ed546679524140d8282175411fd141fe7df070d patch
- https://github.com/python/cpython/commit/35c799d79177b962ddace2fa068101465570a29a patch
- https://github.com/python/cpython/commit/5130731c9e779b97d00a24f54cdce73ce9975dfd patch
- https://github.com/python/cpython/commit/66f8bb76a15e64a1bb7688b177ed29e26230fdee patch
- https://github.com/python/cpython/commit/6d0850c4c8188035643586ab4d8ec2468abd699e patch
- https://github.com/python/cpython/commit/91e3669e01245185569d09e9e6e11641282971ee patch
- https://github.com/python/cpython/commit/94591dca510c796c7d40e9b4167ea56f2fdf28ca patch
- https://github.com/python/cpython/commit/c8f868dc52f98011d0f9b459b6487920bfb0ac4d patch
- https://github.com/python/cpython/commit/d86b49411753bf2c83291e3a14ae43fefded2f84 patch
- https://github.com/python/cpython/commit/e1dfa978b1ad210d551385ad8073ec6154f53763 patch
- https://github.com/python/cpython/commit/eb29e2f5905da93333d1ce78bc98b151e763ff46 patch
- https://security.netapp.com/advisory/ntap-20240705-0005/