CVE-2026-12345: Race condition in tempfile.TemporaryDirectory cleanup allows deleting files outside the temporary directory
Vulnerability summary
CVE-2026-12345 is a medium (CVSS 5.9) vulnerability in python software foundation cpython. EPSS estimates a 0.36% chance of exploitation in the next 30 days, higher than 31.4% of scored vulnerabilities.
Not severe (CVSS 5.9, local access); no exploitation reported by the 5 checked sources
Source freshness unavailable
How is this decided?Advisory lineage
Upstream 0 · Downstream 7 · Related 3Timeline
- 29-09-2026PublishedVulnerability first disclosed.
- 01-12-2026Last modifiedVulnerability information updated.
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.
CVSS metrics
8 scores · 8 sources · 2 versions- OSV · UbuntuEcosystem advisory · calculated5.9MediumCVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N
- OSV · DebianEcosystem advisory · calculated5.9MediumCVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
- OSV · WolfiEcosystem advisory · calculated5.9MediumCVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N
- OSV · ChainguardEcosystem advisory · calculated5.9MediumCVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N
- NVDNIST5.9MediumCVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
- OSV · AlpineEcosystem advisory · calculated5.9MediumCVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
EPSS trend
Probability
0.36%
Chance of exploitation in the next 30 days
Percentile
31%
Versus all other CVEs
30-day change
Increase +0.01 pp
From 0.34% on 04-11-2026
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
Public exploits
0 foundNo public exploits indexed.
Weaknesses
CWE · root causeAffected systems
Known conditions: local access, no authentication, no user interaction (CVSS vector). Other conditions: not stated in public data.
Redhat34 products
- python-unversioned-command< 0:3.12.15-1.el10_2.2 | < 0:3.14.8-1.hum1 | < 0:3.12.16-2.el10_3
- python3< 0:3.12.15-1.el10_2.2 | < 0:3.14.8-1.hum1 | < 0:3.12.16-2.el10_3
- python3-debug< 0:3.12.15-1.el10_2.2 | < 0:3.14.8-1.hum1 | < 0:3.12.16-2.el10_3
- python3-devel< 0:3.12.15-1.el10_2.2 | < 0:3.14.8-1.hum1 | < 0:3.12.16-2.el10_3
- python3-idle< 0:3.12.15-1.el10_2.2 | < 0:3.14.8-1.hum1 | < 0:3.12.16-2.el10_3
Ubuntu11 products
- python2.7All versions (No fix recorded)
- python3.10All versions (No fix recorded)
- python3.11All versions (No fix recorded)
- python3.12All versions (No fix recorded)
- python3.14All versions (No fix recorded)
Chainguard6 products
- python-3.10All versions (No fix recorded)
- python-3.11All versions (No fix recorded)
- python-3.12All versions (No fix recorded) | < 3.12.16-r0
- python-3.13All versions (No fix recorded) | < 3.13.18_git20261030-r0
- python-3.14All versions (No fix recorded) | < 3.14.8_git20261014-r0
Wolfi6 products
- python-3.10All versions (No fix recorded)
- python-3.11All versions (No fix recorded)
- python-3.12All versions (No fix recorded) | < 3.12.16-r0
- python-3.13All versions (No fix recorded) | < 3.13.18_git20261030-r0
- python-3.14All versions (No fix recorded) | < 3.14.8_git20261014-r0
Debian5 products
- pypy3All versions (No fix recorded)
- python3.11All versions (No fix recorded)
- python3.13All versions (No fix recorded)
- python3.14All versions (No fix recorded) | < 3.14.9-1
- python3.15All versions (No fix recorded) | < 3.15.0~rc3-1
Alpine1 product
- python3< 3.12.16-r0 | < 3.14.10-r0 | < 3.14.9-r2
Python software foundation1 product
- cpython< 3.12.15 | ≥ 3.13.0, < 3.13.18 | ≥ 3.14.0, < 3.14.9 | ≥ 3.15.0a1, < 3.15.0rc3
7 vendors · 64 products
References
36 links- images.redhat.comARTICLE
Show all 36 references
- github.com/python/cpythonPACKAGE