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.
01
describes (1)
Related CVEs.
| ID | severity | exploitable | ||
|---|---|---|---|---|
| CVE-2026-12345US | — | Exploit | ||
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, causi… | ||||
02
references
External citations — patches, advisories, analysis.
- https://github.com/python/cpython/commit/06ef3d43fdaf4da97af12fa694b4886092c4b970FIX
- https://github.com/python/cpython/commit/458e7134a5af7f86aee9d21b51cf499b41aa4420FIX
- https://github.com/python/cpython/commit/58ed0259cae509a19138795df302fe60b544dc74FIX
- https://github.com/python/cpython/commit/5c20517a4fc56683efe63a7751020db9573f538dFIX
- https://github.com/python/cpython/commit/e1f3590f155c6d66007e958c98c9d69316551993FIX
- https://github.com/python/cpython/issues/157579REPORT
- https://github.com/python/cpython/pull/157580WEB
scry
Advisories like this name the exposed products attackers go after on your perimeter. See what is exposed on your perimeter with a free passive scan.
Free scan