CVE-2026-12345

published 29 Sep 2026 · updated 19 Nov 2026

Race condition in tempfile.TemporaryDirectory cleanup allows deleting files outside the temporary directory

5.9MediumCVSS 5.9EPSS 0%

No exploitation in the wild has been reported. EPSS puts the chance of exploitation in the next 30 days at 0%. Fixed in 3.12.15, 3.13.18, 3.14.9 and 1 more.

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.

Affected

Vendors, products and packages with version ranges

VendorProductVersionsFixed
Python Software Foundation<3.12.15, >=3.13.0 <3.13.18, >=3.14.0 <3.14.9, >=3.15.0a1 <3.15.0rc33.12.15, 3.13.18, 3.14.9, 3.15.0rc3

Timeline

Every event on this vulnerability

Embed

A live severity badge for an advisory, README or ticket

CVE-2026-12345 severity on Zeptric[![CVE-2026-12345](https://zeptric.io/badge/cve/CVE-2026-12345.svg)](https://zeptric.io/cve/CVE-2026-12345)