{"id":"CVE-2026-12345","title":"The cleanup of tempfile.TemporaryDirectory is vulnerable to a race condition","summary":"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…","severity":"medium","cvss":5.9,"cvssVector":"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","cwe":["CWE-59"],"vendor":"Python Software Foundation","product":"CPython","affected":["CPython < 3.15.0"],"published":"2026-09-29","updated":"2026-09-30","sourceUpdated":"2026-09-30T21:17:09.420","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2026-12345","references":[{"url":"https://github.com/python/cpython/commit/458e7134a5af7f86aee9d21b51cf499b41aa4420","label":"cna@python.org"},{"url":"https://github.com/python/cpython/commit/5c20517a4fc56683efe63a7751020db9573f538d","label":"cna@python.org"},{"url":"https://github.com/python/cpython/commit/e1f3590f155c6d66007e958c98c9d69316551993","label":"cna@python.org"},{"url":"https://github.com/python/cpython/issues/157579","label":"cna@python.org"},{"url":"https://github.com/python/cpython/pull/157580","label":"cna@python.org"},{"url":"http://www.openwall.com/lists/oss-security/2026/09/29/40","label":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-12345.json"},{"url":"https://access.redhat.com/security/cve/CVE-2026-12345"},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2543492"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-12345"},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-12345"}],"tags":["nvd","cve.org","csaf","vex","red-hat"],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2026-09-29T18:38:00.590353Z"},"cvssSource":"cna","epss":0.0018,"epssPercentile":0.06801,"scores":{"cna":5.9,"vendor":6.3},"ingestedAt":"2026-09-29T18:42:35.820Z","slug":"CVE-2026-12345","body":"## Overview\n\nThe 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.\n\n## Remediation\n\nRefer to the linked advisories for vendor-supplied fixes and affected version ranges.\n\n## Vendor advisories\n\n- **Red Hat VEX** · Moderate · affected: Red Hat Enterprise Linux 10, Red Hat Enterprise Linux 6, Red Hat Enterprise Linux 7, Red Hat Enterprise Linux 8, Red Hat Enterprise Linux 9, Red Hat Enterprise Linux AI (RHEL AI) 3, … · no fix planned: Red Hat Enterprise Linux 6, Red Hat Enterprise Linux 10, Red Hat Enterprise Linux 7, Red Hat Enterprise Linux 8, … · updated 2026-09-29 · [vex](https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-12345.json)","depth":"sunlit","depthScore":32,"depthScoreParts":{"impact":32.5,"likelihood":0,"exploitation":0,"ransomware":0},"changes":[]}