CVE-2026-12345BIT-LIBPYTHON-2026-12345BIT-PYTHON-2026-12345BIT-PYTHON-MIN-2026-12345PSF-2026-42
Race condition in tempfile.TemporaryDirectory cleanup allows deleting files outside the temporary directory
- Published
- Last modified
- Where the record stands: published, rejected by its publisher, or superseded by another id.What do these mean? →
- published
- Whether CISA lists it in its Known Exploited Vulnerabilities catalog: proof that attackers are using it.What do these mean? →
- Not listed in CISA KEV
- Fix
- Fixed in 3.12.15, 3.13.18, 3.14.9, 3.15.0rc3
- Whether working attack code is public (Exploit-DB, Metasploit, Nuclei or GitHub). Public code makes attacks easier.What do these mean? →
- None on Exploit-DB, Metasploit or GitHub
CISA's decision points: whether it is exploited, whether attacks can be automated, and how much control an attacker gets. Assessed (SSVC 2.0.3).What do these mean? →
- Exploitation: none
- Automatable: no
- Technical impact: partial
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 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
- CVE published
- CISA SSVC assessment
Exploitation: none · Automatable: no · Technical impact: partial
- Record last updated
Affected versions
- Python Software Foundation CPython
fixed in 3.12.15; From 3.13.0 · fixed in 3.13.18; From 3.14.0 · fixed in 3.14.9; From 3.15.0a1 · fixed in 3.15.0rc3
- libpythonBitnami
All versions
- pythonBitnami
All versions
- python-minBitnami
All versions