Skip to main content
← All vulnerabilities
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
published
Not listed in CISA KEV
Fix
Fixed in 3.12.15, 3.13.18, 3.14.9, 3.15.0rc3
None on Exploit-DB, Metasploit or GitHub
  • 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

  1. CVE published
  2. CISA SSVC assessment

    Exploitation: none · Automatable: no · Technical impact: partial

  3. 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

References 9

GitHub · python/cpython