CVE-2026-12345
The cleanup of tempfile.TemporaryDirectory is vulnerable to a race condition.
Does this matter?
Lower severity and a low EPSS score (0.34%). Track it; it rarely justifies an emergency change on its own.
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 4.0
- 5.9 MEDIUMCVSS: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/M
- EPSS
- 0.34% probability · 28th percentile
- Public exploits
- None in Exploit-DB
- CISA KEV
- Not listed
- Weakness
- CWE-59
- Source
- cna@python.org
EPSS moved from 0.2% on 30 September 2026 to 0.3% on 26 October 2026.
References
- 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/c39b52d00b42200aaadff679e2fe3f1006d57c58
- https://github.com/python/cpython/commit/e1f3590f155c6d66007e958c98c9d69316551993
- https://github.com/python/cpython/issues/157579
- https://github.com/python/cpython/pull/157580
- http://www.openwall.com/lists/oss-security/2026/09/29/40
Source: NVD record, EPSS from FIRST.org, KEV from CISA, exploits from Exploit-DB. Refreshed daily. Download this record as JSON.