{"id":"CVE-2026-12345","summary":"Race condition in tempfile.TemporaryDirectory cleanup allows deleting files outside the temporary directory","details":"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.","aliases":["BIT-libpython-2026-12345","BIT-python-2026-12345","BIT-python-min-2026-12345","PSF-2026-42"],"modified":"2026-11-19T02:00:12.645231Z","published":"2026-09-29T17:46:01.811Z","related":["ALSA-2026:85239","ALSA-2026:89742","ALSA-2026:98615","SUSE-SU-2026:5251-1","openSUSE-SU-2026:12125-1"],"database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/12xxx/CVE-2026-12345.json","cna_assigner":"PSF"},"references":[{"type":"WEB","url":"http://www.openwall.com/lists/oss-security/2026/09/29/40"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/12xxx/CVE-2026-12345.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-12345"},{"type":"REPORT","url":"https://github.com/python/cpython/issues/157579"},{"type":"FIX","url":"https://github.com/python/cpython/commit/0478b52788117db4b831b3efd648f56b777628aa"},{"type":"FIX","url":"https://github.com/python/cpython/commit/06ef3d43fdaf4da97af12fa694b4886092c4b970"},{"type":"FIX","url":"https://github.com/python/cpython/commit/458e7134a5af7f86aee9d21b51cf499b41aa4420"},{"type":"FIX","url":"https://github.com/python/cpython/commit/58ed0259cae509a19138795df302fe60b544dc74"},{"type":"FIX","url":"https://github.com/python/cpython/commit/5c20517a4fc56683efe63a7751020db9573f538d"},{"type":"FIX","url":"https://github.com/python/cpython/commit/aa17c688d2c160969f2c8963f4454cdd139808e7"},{"type":"FIX","url":"https://github.com/python/cpython/commit/c39b52d00b42200aaadff679e2fe3f1006d57c58"},{"type":"FIX","url":"https://github.com/python/cpython/commit/e1f3590f155c6d66007e958c98c9d69316551993"},{"type":"FIX","url":"https://github.com/python/cpython/pull/157580"},{"type":"PACKAGE","url":"https://github.com/python/cpython"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/python/cpython","events":[{"introduced":"0"},{"fixed":"e848e4b09ca4bc67c0041c9ce7526dae471d4c36"},{"introduced":"60403a5409ff2c3f3b07dd2ca91a7a3e096839c7"},{"fixed":"0d4bd512fc429e3d4eacdd113c975e161f21644d"},{"introduced":"ebf955df7a89ed0c7968f79faec1de49f61ed7cb"},{"fixed":"ead82c07db1f111d613926ed1b6667411d768125"},{"introduced":"f31a89bb901067dd105b00cfa90523cf7ffdbbdd"},{"fixed":"8a8eb0b90d40f0e03f8252e9f73cad156e1caca8"},{"fixed":"5c20517a4fc56683efe63a7751020db9573f538d"},{"fixed":"458e7134a5af7f86aee9d21b51cf499b41aa4420"},{"fixed":"e1f3590f155c6d66007e958c98c9d69316551993"},{"fixed":"06ef3d43fdaf4da97af12fa694b4886092c4b970"},{"fixed":"58ed0259cae509a19138795df302fe60b544dc74"},{"fixed":"0478b52788117db4b831b3efd648f56b777628aa"},{"fixed":"c39b52d00b42200aaadff679e2fe3f1006d57c58"},{"fixed":"aa17c688d2c160969f2c8963f4454cdd139808e7"}],"database_specific":{"extracted_events":[{"strategy":"StandardRange","range":[{"introduced":"0"},{"fixed":"3.12.15"}],"source":"AFFECTED_FIELD"},{"source":"AFFECTED_FIELD","strategy":"StandardRange","range":[{"introduced":"3.13.0"},{"fixed":"3.13.18"}]},{"strategy":"StandardRange","range":[{"introduced":"3.14.0"},{"fixed":"3.14.9"}],"source":"AFFECTED_FIELD"},{"strategy":"StandardRange","range":[{"introduced":"3.15.0a1"},{"fixed":"3.15.0rc3"}],"source":"AFFECTED_FIELD"},{"range":[{"fixed":"5c20517a4fc56683efe63a7751020db9573f538d"}],"source":"REFERENCES_COMMIT"},{"range":[{"fixed":"458e7134a5af7f86aee9d21b51cf499b41aa4420"}],"source":"REFERENCES_COMMIT"},{"range":[{"fixed":"e1f3590f155c6d66007e958c98c9d69316551993"}],"source":"REFERENCES_COMMIT"},{"range":[{"fixed":"06ef3d43fdaf4da97af12fa694b4886092c4b970"}],"source":"REFERENCES_COMMIT"},{"source":"REFERENCES_COMMIT","range":[{"fixed":"58ed0259cae509a19138795df302fe60b544dc74"}]},{"range":[{"fixed":"0478b52788117db4b831b3efd648f56b777628aa"}],"source":"REFERENCES_COMMIT"},{"range":[{"fixed":"c39b52d00b42200aaadff679e2fe3f1006d57c58"}],"source":"REFERENCES_COMMIT"},{"source":"REFERENCES_COMMIT","range":[{"fixed":"aa17c688d2c160969f2c8963f4454cdd139808e7"}]}]}}],"versions":["v3.13.17","v3.13.16","v3.14.8","v3.15.0rc2","v3.12.14","v3.13.15","v3.14.7","v3.15.0rc1","v3.15.0b4","v3.15.0b3","v3.13.14","v3.14.6","v3.15.0b2","v3.14.5","v3.15.0b1","v3.14.5rc1","v3.13.13","v3.14.4","v3.12.13","v3.13.12","v3.14.3","v3.14.2","v3.13.11","v3.13.10","v3.14.1","v3.13.8","v3.12.12","v3.14.0","v3.13.7","v3.13.6","v3.13.5","v3.13.4","v3.12.11","v3.13.3","v3.12.10","v3.13.2","v3.12.9","v3.13.1","v3.12.8","v3.13.0","v3.12.7","v3.12.6","v3.12.5","v3.12.4","v3.12.3","v3.12.2","v3.12.1","v3.12.0","v3.12.0rc3","v3.12.0rc2","v3.12.0rc1","v3.12.0b4","v3.12.0b3","v3.12.0b2","v3.12.0b1","v3.12.0a7","v3.12.0a6","v3.12.0a5","v3.12.0a4","v3.12.0a3","v3.12.0a2","v3.12.0a1","v3.11.0b1","v3.11.0a7","v3.11.0a6","v3.11.0a5","v3.11.0a4","v3.11.0a3","v3.10.0a7","v3.10.0a1","v3.9.0a2","v3.7.0a2","v3.6.0b1","v3.6.0a3","v3.5.0b1","v3.5.0a4","v3.5.0a3","v3.5.0a2","v3.5.0a1","v3.4.0b3","v3.4.0b2","v3.4.0b1","v3.4.0a4","v3.4.0a3","v3.4.0a2","v3.4.0a1","v3.3.0rc3","v3.3.0rc2","v3.3.0rc1","v3.3.0b2","v3.3.0b1","v3.3.0a4","v3.3.0a3","v3.3.0a2","v3.2rc3","v3.2rc2","v3.2rc1","v3.2b2","v3.2b1","v3.2a4","v3.2a3","v3.2a2","v3.2a1","v3.1","v3.1rc2","v3.1rc1","v3.1b1","v3.1a2","v3.1a1","v3.0rc3","v3.0rc2","v3.0rc1","v3.0b3","v3.0b2","v3.0b1","v3.0a5","v3.0a4","v3.0a3","v3.0a2","v3.0a1","v2.4","v2.4c1","v2.4b2","v2.4b1","v2.4a3","v2.4a2","v2.4a1","v2.3c2","v2.3c1","v2.2a3","v2.1","v2.1c2","v2.1c1","v2.1b2","v2.1b1","v2.1a2","v2.1a1","v2.0","v2.0c1","v2.0b2","v2.0b1","v1.6a2","v1.6a1","v1.5.2","v1.5.2c1","v1.5.2b2","v1.5.2b1","v1.5.2a2","v1.5.2a1","v1.5.1","v1.5","v1.5b2","v1.5b1","v1.5a4","v1.5a3","v1.5a2","v1.5a1","v1.4","v1.4b3","v1.4b2","v1.4b1","v1.3","v1.3b1","v1.2","v1.2b4","v1.2b3","v1.2b2","v1.2b1","v1.1.1","v1.1","v1.0.2","v1.0.1","v0.9.9","v0.9.8"],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2026-12345.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V4","score":"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"}]}