CVE-2026-12345Race condition in tempfile.TemporaryDirectory cleanup allows deleting files outside the temporary directory
- 5.9MediumCVSS base score
- 0.34%Exploitation in 30 daysEPSS · top 72% of all CVEs
- NoKnown exploitednot in CISA's KEV catalog
- NonePublic exploitsnone known yet
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.
Timeline
ID reserved
By PSF
- 4 months later
· 4 months later
Published
- 27 days later
· 27 days later
Record updated
Changes after publication (a new score, a public exploit, EPSS crossing 1, 10 or 50 %, leaving KEV) are kept since November 2026; earlier ones are not known.
Scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| PSFCNA (assigner) | 4.0 | Medium5.9 | 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 |
| NVDNVD · Awaiting Analysis | 4.0 | Medium5.9 | 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/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 (exploitation in 30 days)
- 0.34% · top 72% of all CVEs (17 Nov 2026)
- CISA SSVC
- Exploitation: none · Automatable: no · Technical impact: partial
The list uses the assigner's score when there is one, then CISA's, then NVD's: Medium 5.9.
Affected products
Python Software Foundation · CPython
- affected < 3.12.15
- affected 3.13.0 – < 3.13.18
- affected 3.14.0 – < 3.14.9
- affected 3.15.0a1 – < 3.15.0rc3
References
References10
- https://github.com/python/cpython/pull/157580 (opens in a new tab)patch
- https://github.com/python/cpython/issues/157579 (opens in a new tab)issue-tracking
- https://github.com/python/cpython/commit/5c20517a4fc56683efe63a7751020db9573f538d (opens in a new tab)patch
- https://github.com/python/cpython/commit/458e7134a5af7f86aee9d21b51cf499b41aa4420 (opens in a new tab)patch
- https://github.com/python/cpython/commit/e1f3590f155c6d66007e958c98c9d69316551993 (opens in a new tab)patch
- https://github.com/python/cpython/commit/06ef3d43fdaf4da97af12fa694b4886092c4b970 (opens in a new tab)patch
- https://github.com/python/cpython/commit/58ed0259cae509a19138795df302fe60b544dc74 (opens in a new tab)patch
- https://github.com/python/cpython/commit/0478b52788117db4b831b3efd648f56b777628aa (opens in a new tab)patch
- https://github.com/python/cpython/commit/c39b52d00b42200aaadff679e2fe3f1006d57c58 (opens in a new tab)patch
- http://www.openwall.com/lists/oss-security/2026/09/29/40 (opens in a new tab)
Sources
The same CVE in the primary databases and aggregators, to check against.
- CVE.org record (opens in a new tab)
- CVE List JSON (GitHub) (opens in a new tab)
- NVD (opens in a new tab)
- FIRST EPSS (opens in a new tab)
- EUVD EUVD-2026-89183 (opens in a new tab)
- OSV.dev (opens in a new tab)
- GitHub Advisories (opens in a new tab)
- CIRCL Vulnerability-Lookup (opens in a new tab)
Badge for a README or a ticket
[](https://cveledger.app/cve/CVE-2026-12345)Record last updated .