CVE-2026-12345
published medium CVSS 4.0 · 5.9Race condition in tempfile.TemporaryDirectory cleanup allows deleting files outside the temporary directory
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Python Software Foundation | — | CPython0 to < 3.12.15 · 3.13.0 to < 3.13.18 · 3.14.0 to < 3.14.9 · 3.15.0a1 to < 3.15.0rc3 · Other versions: unaffected | Affected | Not stated | PSF |
| Amazon Linux | AL2 | Release evaluation | Not Affected; Pending Fix | Not stated | Amazon Linux assessment |
| Amazon Linux | AL2023 | Release evaluation | Pending Fix | Not stated | Amazon Linux assessment |
| Amazon Linux | AL2023 | Release evaluationALAS2023-2026-3406 | Fixed | Not stated | Amazon Linux assessment |
| Amazon Linux | AL2023 | Release evaluationALAS2023-2026-3407 | Fixed | Not stated | Amazon Linux assessment |
| Amazon Linux | AL2023 | Release evaluationALAS2023-2026-3408 | Fixed | Not stated | Amazon Linux assessment |
| AlmaLinux | 10 | python-unversioned-command | Advisory build | 3.12.16-2.el10_3 | ALSA-2026:98615 |
| Alpine Linux | edge | python3 | Fixed | 3.14.9-r2 | Package fix record |
Show 98 more entries
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Oracle Linux | 10 | python-unversioned-commandaarch64 | Advisory build | 0:3.12.16-2.0.1.el10_3 | ELSA-2026-98615 |
| Red Hat Enterprise Linux | RHEL-10 | python-unversioned-commandnoarch | Advisory build | 3.12.15-1.el10_2.2 | RHSA-2026:104720 |
| AlmaLinux | 10 | python3 | Advisory build | 3.12.16-2.el10_3 | ALSA-2026:98615 |
| AlmaLinux | 10 | python3-debug | Advisory build | 3.12.16-2.el10_3 | ALSA-2026:98615 |
| AlmaLinux | 10 | python3-devel | Advisory build | 3.12.16-2.el10_3 | ALSA-2026:98615 |
| AlmaLinux | 10 | python3-idle | Advisory build | 3.12.16-2.el10_3 | ALSA-2026:98615 |
| AlmaLinux | 10 | python3-libs | Advisory build | 3.12.16-2.el10_3 | ALSA-2026:98615 |
| AlmaLinux | 10 | python3-test | Advisory build | 3.12.16-2.el10_3 | ALSA-2026:98615 |
| AlmaLinux | 10 | python3-tkinter | Advisory build | 3.12.16-2.el10_3 | ALSA-2026:98615 |
| AlmaLinux | 8 | platform-python | Advisory build | 3.6.8-79.el8_10.alma.1 | ALSA-2026:85239 |
| AlmaLinux | 8 | platform-python-debug | Advisory build | 3.6.8-79.el8_10.alma.1 | ALSA-2026:85239 |
| AlmaLinux | 8 | platform-python-devel | Advisory build | 3.6.8-79.el8_10.alma.1 | ALSA-2026:85239 |
| AlmaLinux | 8 | python3-idle | Advisory build | 3.6.8-79.el8_10.alma.1 | ALSA-2026:85239 |
| AlmaLinux | 8 | python3-libs | Advisory build | 3.6.8-79.el8_10.alma.1 | ALSA-2026:85239 |
| AlmaLinux | 8 | python3-test | Advisory build | 3.6.8-79.el8_10.alma.1 | ALSA-2026:85239 |
| AlmaLinux | 8 | python3-tkinter | Advisory build | 3.6.8-79.el8_10.alma.1 | ALSA-2026:85239 |
| AlmaLinux | 9 | python-unversioned-command | Advisory build | 3.9.25-7.el9_8.6 | ALSA-2026:89742 |
| AlmaLinux | 9 | python3 | Advisory build | 3.9.25-7.el9_8.6 | ALSA-2026:89742 |
| AlmaLinux | 9 | python3-debug | Advisory build | 3.9.25-7.el9_8.6 | ALSA-2026:89742 |
| AlmaLinux | 9 | python3-devel | Advisory build | 3.9.25-7.el9_8.6 | ALSA-2026:89742 |
| AlmaLinux | 9 | python3-idle | Advisory build | 3.9.25-7.el9_8.6 | ALSA-2026:89742 |
| AlmaLinux | 9 | python3-libs | Advisory build | 3.9.25-7.el9_8.6 | ALSA-2026:89742 |
| AlmaLinux | 9 | python3-test | Advisory build | 3.9.25-7.el9_8.6 | ALSA-2026:89742 |
| AlmaLinux | 9 | python3-tkinter | Advisory build | 3.9.25-7.el9_8.6 | ALSA-2026:89742 |
| Alpine Linux | v3.21 | python3 | Fixed | 3.12.16-r0 | Package fix record |
| Alpine Linux | v3.22 | python3 | Fixed | 3.12.16-r0 | Package fix record |
| Alpine Linux | v3.23 | python3 | Fixed | 3.12.16-r0 | Package fix record |
| Alpine Linux | v3.24 | python3 | Fixed | 3.14.10-r0 | Package fix record |
| Oracle Linux | 10 | python-unversioned-commandx86_64 | Advisory build | 0:3.12.16-2.0.1.el10_3 | ELSA-2026-98615 |
| Oracle Linux | 10 | python3aarch64 | Advisory build | 0:3.12.16-2.0.1.el10_3 | ELSA-2026-98615 |
| Oracle Linux | 10 | python3x86_64 | Advisory build | 0:3.12.16-2.0.1.el10_3 | ELSA-2026-98615 |
| Oracle Linux | 10 | python3-debugaarch64 | Advisory build | 0:3.12.16-2.0.1.el10_3 | ELSA-2026-98615 |
| Oracle Linux | 10 | python3-debugx86_64 | Advisory build | 0:3.12.16-2.0.1.el10_3 | ELSA-2026-98615 |
| Oracle Linux | 10 | python3-develaarch64 | Advisory build | 0:3.12.16-2.0.1.el10_3 | ELSA-2026-98615 |
| Oracle Linux | 10 | python3-develx86_64 | Advisory build | 0:3.12.16-2.0.1.el10_3 | ELSA-2026-98615 |
| Oracle Linux | 10 | python3-idleaarch64 | Advisory build | 0:3.12.16-2.0.1.el10_3 | ELSA-2026-98615 |
| Oracle Linux | 10 | python3-idlex86_64 | Advisory build | 0:3.12.16-2.0.1.el10_3 | ELSA-2026-98615 |
| Oracle Linux | 10 | python3-libsaarch64 | Advisory build | 0:3.12.16-2.0.1.el10_3 | ELSA-2026-98615 |
| Oracle Linux | 10 | python3-libsx86_64 | Advisory build | 0:3.12.16-2.0.1.el10_3 | ELSA-2026-98615 |
| Oracle Linux | 10 | python3-testaarch64 | Advisory build | 0:3.12.16-2.0.1.el10_3 | ELSA-2026-98615 |
| Oracle Linux | 10 | python3-testx86_64 | Advisory build | 0:3.12.16-2.0.1.el10_3 | ELSA-2026-98615 |
| Oracle Linux | 10 | python3-tkinteraarch64 | Advisory build | 0:3.12.16-2.0.1.el10_3 | ELSA-2026-98615 |
| Oracle Linux | 10 | python3-tkinterx86_64 | Advisory build | 0:3.12.16-2.0.1.el10_3 | ELSA-2026-98615 |
| Oracle Linux | 8 | platform-pythonaarch64 | Advisory build | 0:3.6.8-79.0.1.el8_10 | ELSA-2026-85239 |
| Oracle Linux | 8 | platform-pythonx86_64 | Advisory build | 0:3.6.8-79.0.1.el8_10 | ELSA-2026-85239 |
| Oracle Linux | 8 | platform-python-debugaarch64 | Advisory build | 0:3.6.8-79.0.1.el8_10 | ELSA-2026-85239 |
| Oracle Linux | 8 | platform-python-debugx86_64 | Advisory build | 0:3.6.8-79.0.1.el8_10 | ELSA-2026-85239 |
| Oracle Linux | 8 | platform-python-develaarch64 | Advisory build | 0:3.6.8-79.0.1.el8_10 | ELSA-2026-85239 |
| Oracle Linux | 8 | platform-python-develx86_64 | Advisory build | 0:3.6.8-79.0.1.el8_10 | ELSA-2026-85239 |
| Oracle Linux | 8 | python3-idleaarch64 | Advisory build | 0:3.6.8-79.0.1.el8_10 | ELSA-2026-85239 |
| Oracle Linux | 8 | python3-idlex86_64 | Advisory build | 0:3.6.8-79.0.1.el8_10 | ELSA-2026-85239 |
| Oracle Linux | 8 | python3-libsaarch64 | Advisory build | 0:3.6.8-79.0.1.el8_10 | ELSA-2026-85239 |
| Oracle Linux | 8 | python3-libsx86_64 | Advisory build | 0:3.6.8-79.0.1.el8_10 | ELSA-2026-85239 |
| Oracle Linux | 8 | python3-testaarch64 | Advisory build | 0:3.6.8-79.0.1.el8_10 | ELSA-2026-85239 |
| Oracle Linux | 8 | python3-testx86_64 | Advisory build | 0:3.6.8-79.0.1.el8_10 | ELSA-2026-85239 |
| Oracle Linux | 8 | python3-tkinteraarch64 | Advisory build | 0:3.6.8-79.0.1.el8_10 | ELSA-2026-85239 |
| Oracle Linux | 8 | python3-tkinterx86_64 | Advisory build | 0:3.6.8-79.0.1.el8_10 | ELSA-2026-85239 |
| Oracle Linux | 9 | python-unversioned-commandaarch64 | Advisory build | 0:3.9.25-16.0.1.el9_9 | ELSA-2026-98511 |
| Oracle Linux | 9 | python-unversioned-commandaarch64 | Advisory build | 0:3.9.25-7.0.1.el9_8.6 | ELSA-2026-89742 |
| Oracle Linux | 9 | python-unversioned-commandx86_64 | Advisory build | 0:3.9.25-16.0.1.el9_9 | ELSA-2026-98511 |
| Oracle Linux | 9 | python-unversioned-commandx86_64 | Advisory build | 0:3.9.25-7.0.1.el9_8.6 | ELSA-2026-89742 |
| Oracle Linux | 9 | python3aarch64 | Advisory build | 0:3.9.25-16.0.1.el9_9 | ELSA-2026-98511 |
| Oracle Linux | 9 | python3aarch64 | Advisory build | 0:3.9.25-7.0.1.el9_8.6 | ELSA-2026-89742 |
| Oracle Linux | 9 | python3x86_64 | Advisory build | 0:3.9.25-16.0.1.el9_9 | ELSA-2026-98511 |
| Oracle Linux | 9 | python3x86_64 | Advisory build | 0:3.9.25-7.0.1.el9_8.6 | ELSA-2026-89742 |
| Oracle Linux | 9 | python3-debugaarch64 | Advisory build | 0:3.9.25-16.0.1.el9_9 | ELSA-2026-98511 |
| Oracle Linux | 9 | python3-debugaarch64 | Advisory build | 0:3.9.25-7.0.1.el9_8.6 | ELSA-2026-89742 |
| Oracle Linux | 9 | python3-debugx86_64 | Advisory build | 0:3.9.25-16.0.1.el9_9 | ELSA-2026-98511 |
| Oracle Linux | 9 | python3-debugx86_64 | Advisory build | 0:3.9.25-7.0.1.el9_8.6 | ELSA-2026-89742 |
| Oracle Linux | 9 | python3-develaarch64 | Advisory build | 0:3.9.25-16.0.1.el9_9 | ELSA-2026-98511 |
| Oracle Linux | 9 | python3-develaarch64 | Advisory build | 0:3.9.25-7.0.1.el9_8.6 | ELSA-2026-89742 |
| Oracle Linux | 9 | python3-develx86_64 | Advisory build | 0:3.9.25-16.0.1.el9_9 | ELSA-2026-98511 |
| Oracle Linux | 9 | python3-develx86_64 | Advisory build | 0:3.9.25-7.0.1.el9_8.6 | ELSA-2026-89742 |
| Oracle Linux | 9 | python3-idleaarch64 | Advisory build | 0:3.9.25-16.0.1.el9_9 | ELSA-2026-98511 |
| Oracle Linux | 9 | python3-idleaarch64 | Advisory build | 0:3.9.25-7.0.1.el9_8.6 | ELSA-2026-89742 |
| Oracle Linux | 9 | python3-idlex86_64 | Advisory build | 0:3.9.25-16.0.1.el9_9 | ELSA-2026-98511 |
| Oracle Linux | 9 | python3-idlex86_64 | Advisory build | 0:3.9.25-7.0.1.el9_8.6 | ELSA-2026-89742 |
| Oracle Linux | 9 | python3-libsaarch64 | Advisory build | 0:3.9.25-16.0.1.el9_9 | ELSA-2026-98511 |
| Oracle Linux | 9 | python3-libsaarch64 | Advisory build | 0:3.9.25-7.0.1.el9_8.6 | ELSA-2026-89742 |
| Oracle Linux | 9 | python3-libsx86_64 | Advisory build | 0:3.9.25-16.0.1.el9_9 | ELSA-2026-98511 |
| Oracle Linux | 9 | python3-libsx86_64 | Advisory build | 0:3.9.25-7.0.1.el9_8.6 | ELSA-2026-89742 |
| Oracle Linux | 9 | python3-testaarch64 | Advisory build | 0:3.9.25-16.0.1.el9_9 | ELSA-2026-98511 |
| Oracle Linux | 9 | python3-testaarch64 | Advisory build | 0:3.9.25-7.0.1.el9_8.6 | ELSA-2026-89742 |
| Oracle Linux | 9 | python3-testx86_64 | Advisory build | 0:3.9.25-16.0.1.el9_9 | ELSA-2026-98511 |
| Oracle Linux | 9 | python3-testx86_64 | Advisory build | 0:3.9.25-7.0.1.el9_8.6 | ELSA-2026-89742 |
| Oracle Linux | 9 | python3-tkinteraarch64 | Advisory build | 0:3.9.25-16.0.1.el9_9 | ELSA-2026-98511 |
| Oracle Linux | 9 | python3-tkinteraarch64 | Advisory build | 0:3.9.25-7.0.1.el9_8.6 | ELSA-2026-89742 |
| Oracle Linux | 9 | python3-tkinterx86_64 | Advisory build | 0:3.9.25-16.0.1.el9_9 | ELSA-2026-98511 |
| Oracle Linux | 9 | python3-tkinterx86_64 | Advisory build | 0:3.9.25-7.0.1.el9_8.6 | ELSA-2026-89742 |
| Red Hat Enterprise Linux | RHEL-10 | python-unversioned-commandnoarch | Advisory build | 3.12.16-2.el10_3 | RHSA-2026:98615 |
| Red Hat Enterprise Linux | RHEL-10 | python3aarch64 | Advisory build | 3.12.15-1.el10_2.2 | RHSA-2026:104720 |
| Red Hat Enterprise Linux | RHEL-10 | python3aarch64 | Advisory build | 3.12.16-2.el10_3 | RHSA-2026:98615 |
| Red Hat Enterprise Linux | RHEL-10 | python3ppc64le | Advisory build | 3.12.15-1.el10_2.2 | RHSA-2026:104720 |
| Red Hat Enterprise Linux | RHEL-10 | python3ppc64le | Advisory build | 3.12.16-2.el10_3 | RHSA-2026:98615 |
| Red Hat Enterprise Linux | RHEL-10 | python3s390x | Advisory build | 3.12.15-1.el10_2.2 | RHSA-2026:104720 |
| Red Hat Enterprise Linux | RHEL-10 | python3s390x | Advisory build | 3.12.16-2.el10_3 | RHSA-2026:98615 |
| Red Hat Enterprise Linux | RHEL-10 | python3x86_64 | Advisory build | 3.12.15-1.el10_2.2 | RHSA-2026:104720 |
| Red Hat Enterprise Linux | RHEL-10 | python3x86_64 | Advisory build | 3.12.16-2.el10_3 | RHSA-2026:98615 |
Package entries are limited to the first 100 builds and 100 linked advisories.
Description
The cleanup of tempfile.TemporaryDirectory is vulnerable to a race condition. An attacker who can modify the tree during cleanup can replace a directory with a symbolic link, causing files outside of the temporary directory to be deleted or have their permissions and file flags reset, with the privileges of the process performing the cleanup. Note that platforms where shutil.rmtree.avoids_symlink_attacks is false, remain affected, and file flags may still be reset outside of the tree on all platforms.
Related advisories
Vendor advisories explicitly linked to this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 4.0
- Base score
- 5.9 / 10
- Severity
- medium
- Provider
- PSF · cna
- Vector string
- CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N
- Scenarios
- en: GENERAL
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| Python Software Foundation | CPython | 0 to < 3.12.15 (affected · python)3.13.0 to < 3.13.18 (affected · python)3.14.0 to < 3.14.9 (affected · python)3.15.0a1 to < 3.15.0rc3 (affected · python)Default: unaffected | PSF · cna |
Weaknesses
1- CWE-59 CWE-59 Improper Link Resolution Before File Access ('Link Following')
References
14- http://www.openwall.com/lists/oss-security/2026/09/29/40
- https://github.com/python/cpython/commit/0478b52788117db4b831b3efd648f56b777628aa
- https://github.com/python/cpython/commit/06ef3d43fdaf4da97af12fa694b4886092c4b970
- https://github.com/python/cpython/commit/458e7134a5af7f86aee9d21b51cf499b41aa4420
- https://github.com/python/cpython/commit/58ed0259cae509a19138795df302fe60b544dc74
- https://github.com/python/cpython/commit/5c20517a4fc56683efe63a7751020db9573f538d
- https://github.com/python/cpython/commit/8fa0152f7dbd65b6341a7b00a56227127dc2ec99
- https://github.com/python/cpython/commit/aa17c688d2c160969f2c8963f4454cdd139808e7
- https://github.com/python/cpython/commit/ac0487e42060a39ce648e40f0a63e37391b2d816
- https://github.com/python/cpython/commit/c39b52d00b42200aaadff679e2fe3f1006d57c58
- https://github.com/python/cpython/commit/e1f3590f155c6d66007e958c98c9d69316551993
- https://github.com/python/cpython/commit/e82a65ade532d4204e9c507e462dbcce8815fb93
- https://github.com/python/cpython/issues/157579
- https://github.com/python/cpython/pull/157580
Provider assertions
3PSF · cna
Race condition in tempfile.TemporaryDirectory cleanup allows deleting files outside the temporary directory
CISA-ADP · adp
CISA ADP Vulnrichment
CVE · adp
CVE Program Container
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 11a1917b94412a7756686ed1d711cb5d181ea83b8c55dd5245cfae49905abb3d
- Ingested
- 01 Dec 2026, 00:45:45 UTC
- Source record
- Official CVE record