CVE-2026-12345
Race condition in tempfile.TemporaryDirectory cleanup allows deleting files outside the temporary directory
Description
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 Maven artifacts (1)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| com.chaquo.python » pythonpreliminary | < 3.12.15< 5c20517a4fc56683efe63a7751020db9573f538d< 458e7134a5af7f86aee9d21b51cf499b41aa4420< e1f3590f155c6d66007e958c98c9d69316551993< 06ef3d43fdaf4da97af12fa694b4886092c4b970< 58ed0259cae509a19138795df302fe60b544dc74< 0478b52788117db4b831b3efd648f56b777628aa< c39b52d00b42200aaadff679e2fe3f1006d57c58< aa17c688d2c160969f2c8963f4454cdd139808e7>= 3.13.0, < 3.13.18>= 3.14.0, < 3.14.9>= 3.15.0a1, < 3.15.0rc3 | 3.12.15, 5c20517a4fc56683efe63a7751020db9573f538d, 458e7134a5af7f86aee9d21b51cf499b41aa4420, e1f3590f155c6d66007e958c98c9d69316551993, 06ef3d43fdaf4da97af12fa694b4886092c4b970, 58ed0259cae509a19138795df302fe60b544dc74, 0478b52788117db4b831b3efd648f56b777628aa, c39b52d00b42200aaadff679e2fe3f1006d57c58, aa17c688d2c160969f2c8963f4454cdd139808e7, 3.13.18, 3.14.9, 3.15.0rc3 |
Blast radius
Computed from the dependency graph of build 20261124.0621 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
References
| Advisory | CVE record CVE-2026-12345 | github.com |
| Advisory | NVD CVE-2026-12345 | nvd.nist.gov |
| Fix | python/cpython commit 0478b52 | github.com |
| Fix | python/cpython commit 06ef3d4 | github.com |
| Fix | python/cpython commit 458e713 | github.com |
| Fix | python/cpython commit 58ed025 | github.com |
| Fix | python/cpython commit 5c20517 | github.com |
| Fix | python/cpython commit aa17c68 | github.com |
| Fix | python/cpython commit c39b52d | github.com |
| Fix | python/cpython commit e1f3590 | github.com |
| Fix | python/cpython pull request #157580 | github.com |
| Report | python/cpython issue #157579 | github.com |
| Package | python/cpython | github.com |
| Web | lists/oss-security/2026/09/29/40 | openwall.com |
