CVE-2026-12345Race condition in tempfile.TemporaryDirectory cleanup allows deleting files outside the…
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.
What to do
Fixed builds are available from AlmaLinux, Alpine, Debian, Red Hat, Rocky Linux: see the table below for the fixed version per release.
Debian, Red Hat, Ubuntu have not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.10 | python3.14 | Fix pending | UBUNTU-CVE-2026-12345 | |
| Ubuntu 26.04 | python3.14 | Fix pending | UBUNTU-CVE-2026-12345 | |
| Ubuntu 24.04 | python3.12 | Under investigation | UBUNTU-CVE-2026-12345 | |
| Ubuntu 22.04 | python2.7 | Fix pending | UBUNTU-CVE-2026-12345 | |
| Ubuntu 22.04 | python3.10 | Under investigation | UBUNTU-CVE-2026-12345 | |
| Ubuntu 22.04 | python3.11 | Fix pending | UBUNTU-CVE-2026-12345 | |
| Ubuntu 20.04 | python2.7 | Fix pending | UBUNTU-CVE-2026-12345 | |
| Ubuntu 20.04 | python3.8 | Fix pending | UBUNTU-CVE-2026-12345 | |
| Ubuntu 20.04 | python3.9 | Fix pending | UBUNTU-CVE-2026-12345 | |
| Ubuntu 18.04 | python2.7 | Fix pending | UBUNTU-CVE-2026-12345 | |
| Ubuntu 18.04 | python3.6 | Fix pending | UBUNTU-CVE-2026-12345 | |
| Ubuntu 18.04 | python3.7 | Fix pending | UBUNTU-CVE-2026-12345 | |
| Ubuntu 18.04 | python3.8 | Fix pending | UBUNTU-CVE-2026-12345 | |
| Ubuntu 16.04 | python2.7 | Fix pending | UBUNTU-CVE-2026-12345 | |
| Ubuntu 16.04 | python3.5 | Fix pending | UBUNTU-CVE-2026-12345 | |
| Ubuntu 14.04 | python2.7 | Fix pending | UBUNTU-CVE-2026-12345 | |
| Ubuntu 14.04 | python3.4 | Fix pending | UBUNTU-CVE-2026-12345 | |
| Ubuntu 14.04 | python3.5 | Fix pending | UBUNTU-CVE-2026-12345 | |
| Debian 14 | pypy3 | Fix pending | DEBIAN-CVE-2026-12345 | |
| Debian 14 | python3.14 | Fixed | 3.14.9-1 | DEBIAN-CVE-2026-12345 |
| Debian 14 | python3.15 | Fixed | 3.15.0~rc3-1 | DEBIAN-CVE-2026-12345 |
| Debian 13 | pypy3 | Fix pending | DEBIAN-CVE-2026-12345 | |
| Debian 13 | python3.13 | Fix pending | DEBIAN-CVE-2026-12345 | |
| Debian 12 | pypy3 | Fix pending | DEBIAN-CVE-2026-12345 | |
| Debian 12 | python3.11 | Fix pending | DEBIAN-CVE-2026-12345 | |
| Red Hat Enterprise Linux 10 | python-unversioned-command | Fixed | 0:3.12.16-2.el10_3 | RHSA-2026:98615 |
| Red Hat Enterprise Linux 10 | python3 | Fixed | 0:3.12.16-2.el10_3 | RHSA-2026:98615 |
| Red Hat Enterprise Linux 10 | python3-debug | Fixed | 0:3.12.16-2.el10_3 | RHSA-2026:98615 |
| Red Hat Enterprise Linux 10 | python3-devel | Fixed | 0:3.12.16-2.el10_3 | RHSA-2026:98615 |
| Red Hat Enterprise Linux 10 | python3-idle | Fixed | 0:3.12.16-2.el10_3 | RHSA-2026:98615 |
| Red Hat Enterprise Linux 10 | python3-libs | Fixed | 0:3.12.16-2.el10_3 | RHSA-2026:98615 |
| Red Hat Enterprise Linux 10 | python3-test | Fixed | 0:3.12.16-2.el10_3 | RHSA-2026:98615 |
| Red Hat Enterprise Linux 10 | python3-tkinter | Fixed | 0:3.12.16-2.el10_3 | RHSA-2026:98615 |
| Red Hat Enterprise Linux 10 | python3.12 | Fixed | 0:3.12.16-2.el10_3 | RHSA-2026:98615 |
| Red Hat Enterprise Linux 10 | python3.14 | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | python3.14-debug | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | python3.14-devel | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | python3.14-freethreading | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | python3.14-freethreading-debug | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | python3.14-freethreading-devel | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | python3.14-freethreading-idle | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | python3.14-freethreading-libs | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | python3.14-freethreading-test | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | python3.14-freethreading-tkinter | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | python3.14-idle | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | python3.14-libs | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | python3.14-test | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | python3.14-tkinter | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | python-unversioned-command | Fixed | 0:3.9.25-14.el9_9 | RHSA-2026:89742 |
| Red Hat Enterprise Linux 9 | python3 | Fixed | 0:3.9.25-7.el9_8.6 | RHSA-2026:98511 |
| Red Hat Enterprise Linux 9 | python3-debug | Fixed | 0:3.9.25-14.el9_9 | RHSA-2026:89742 |
| Red Hat Enterprise Linux 9 | python3-devel | Fixed | 0:3.9.25-14.el9_9 | RHSA-2026:89742 |
| Red Hat Enterprise Linux 9 | python3-idle | Fixed | 0:3.9.25-7.el9_8.6 | RHSA-2026:98511 |
| Red Hat Enterprise Linux 9 | python3-libs | Fixed | 0:3.9.25-14.el9_9 | RHSA-2026:89742 |
| Red Hat Enterprise Linux 9 | python3-test | Fixed | 0:3.9.25-7.el9_8.6 | RHSA-2026:98511 |
| Red Hat Enterprise Linux 9 | python3-tkinter | Fixed | 0:3.9.25-7.el9_8.6 | RHSA-2026:98511 |
| Red Hat Enterprise Linux 9 | python3.12 | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | python3.12-debug | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | python3.12-devel | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | python3.12-idle | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | python3.12-libs | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | python3.12-test | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | python3.12-tkinter | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | python3.14 | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | python3.14-debug | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | python3.14-devel | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | python3.14-freethreading | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | python3.14-freethreading-debug | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | python3.14-freethreading-devel | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | python3.14-freethreading-idle | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | python3.14-freethreading-libs | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | python3.14-freethreading-test | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | python3.14-freethreading-tkinter | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | python3.14-idle | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | python3.14-libs | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | python3.14-test | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | python3.14-tkinter | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | python3.9 | Fixed | 0:3.9.25-7.el9_8.6 | RHSA-2026:98511 |
| Red Hat Enterprise Linux 8 | platform-python | Fixed | 0:3.6.8-79.el8_10 | RHSA-2026:85239 |
| Red Hat Enterprise Linux 8 | platform-python-debug | Fixed | 0:3.6.8-79.el8_10 | RHSA-2026:85239 |
| Red Hat Enterprise Linux 8 | platform-python-devel | Fixed | 0:3.6.8-79.el8_10 | RHSA-2026:85239 |
| Red Hat Enterprise Linux 8 | python-PyMySQL | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python-distro | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python-docs | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python-docutils | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python-nose | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python-nose-docs | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python-pygments | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python-pymongo | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python-pymongo-doc | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python-sqlalchemy | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python-sqlalchemy-doc | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python-virtualenv | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python-virtualenv-doc | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python-wheel | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python3 | Fixed | 0:3.6.8-79.el8_10 | RHSA-2026:85239 |
| Red Hat Enterprise Linux 8 | python3-PyMySQL | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python3-bson | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python3-distro | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python3-docs | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python3-docutils | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python3-idle | Fixed | 0:3.6.8-79.el8_10 | RHSA-2026:85239 |
| Red Hat Enterprise Linux 8 | python3-libs | Fixed | 0:3.6.8-79.el8_10 | RHSA-2026:85239 |
| Red Hat Enterprise Linux 8 | python3-nose | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python3-pygments | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python3-pymongo | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python3-pymongo-gridfs | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python3-scipy | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python3-sqlalchemy | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python3-test | Fixed | 0:3.6.8-79.el8_10 | RHSA-2026:85239 |
| Red Hat Enterprise Linux 8 | python3-tkinter | Fixed | 0:3.6.8-79.el8_10 | RHSA-2026:85239 |
| Red Hat Enterprise Linux 8 | python3-virtualenv | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python3-wheel | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python3-wheel-wheel | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python3.12 | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python3.12-debug | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python3.12-devel | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python3.12-idle | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python3.12-libs | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python3.12-rpm-macros | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python3.12-test | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python3.12-tkinter | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python36 | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python36-debug | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python36-devel | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python36-rpm-macros | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | scipy | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 7 | python | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 7 | python-debug | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 7 | python-devel | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 7 | python-libs | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 7 | python-test | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 7 | python-tools | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 7 | python3 | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 7 | python3-debug | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 7 | python3-devel | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 7 | python3-idle | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 7 | python3-libs | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 7 | python3-test | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 7 | python3-tkinter | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 7 | tkinter | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 6 | python | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 6 | python-devel | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 6 | python-libs | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 6 | python-test | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 6 | python-tools | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 6 | tkinter | Fix pending Fix deferred | ||
| AlmaLinux 10 | python-unversioned-command | Fixed | 3.12.16-2.el10_3 | ALSA-2026:98615 |
| AlmaLinux 10 | python3 | Fixed | 3.12.16-2.el10_3 | ALSA-2026:98615 |
| AlmaLinux 10 | python3-debug | Fixed | 3.12.16-2.el10_3 | ALSA-2026:98615 |
| AlmaLinux 10 | python3-devel | Fixed | 3.12.16-2.el10_3 | ALSA-2026:98615 |
| AlmaLinux 10 | python3-idle | Fixed | 3.12.16-2.el10_3 | ALSA-2026:98615 |
| AlmaLinux 10 | python3-libs | Fixed | 3.12.16-2.el10_3 | ALSA-2026:98615 |
| AlmaLinux 10 | python3-test | Fixed | 3.12.16-2.el10_3 | ALSA-2026:98615 |
| AlmaLinux 10 | python3-tkinter | Fixed | 3.12.16-2.el10_3 | ALSA-2026:98615 |
| AlmaLinux 9 | python-unversioned-command | Fixed | 3.9.25-7.el9_8.6 | ALSA-2026:89742 |
| AlmaLinux 9 | python3 | Fixed | 3.9.25-7.el9_8.6 | ALSA-2026:89742 |
| AlmaLinux 9 | python3-debug | Fixed | 3.9.25-7.el9_8.6 | ALSA-2026:89742 |
| AlmaLinux 9 | python3-devel | Fixed | 3.9.25-7.el9_8.6 | ALSA-2026:89742 |
| AlmaLinux 9 | python3-idle | Fixed | 3.9.25-7.el9_8.6 | ALSA-2026:89742 |
| AlmaLinux 9 | python3-libs | Fixed | 3.9.25-7.el9_8.6 | ALSA-2026:89742 |
| AlmaLinux 9 | python3-test | Fixed | 3.9.25-7.el9_8.6 | ALSA-2026:89742 |
| AlmaLinux 9 | python3-tkinter | Fixed | 3.9.25-7.el9_8.6 | ALSA-2026:89742 |
| AlmaLinux 8 | platform-python | Fixed | 3.6.8-79.el8_10.alma.1 | ALSA-2026:85239 |
| AlmaLinux 8 | platform-python-debug | Fixed | 3.6.8-79.el8_10.alma.1 | ALSA-2026:85239 |
| AlmaLinux 8 | platform-python-devel | Fixed | 3.6.8-79.el8_10.alma.1 | ALSA-2026:85239 |
| AlmaLinux 8 | python3-idle | Fixed | 3.6.8-79.el8_10.alma.1 | ALSA-2026:85239 |
| AlmaLinux 8 | python3-libs | Fixed | 3.6.8-79.el8_10.alma.1 | ALSA-2026:85239 |
| AlmaLinux 8 | python3-test | Fixed | 3.6.8-79.el8_10.alma.1 | ALSA-2026:85239 |
| AlmaLinux 8 | python3-tkinter | Fixed | 3.6.8-79.el8_10.alma.1 | ALSA-2026:85239 |
| Rocky Linux 10 | python-unversioned-command | Fixed | 0:3.12.16-2.el10_3 | RLSA-2026:98615 |
| Rocky Linux 10 | python3 | Fixed | 0:3.12.16-2.el10_3 | RLSA-2026:98615 |
| Rocky Linux 10 | python3-debug | Fixed | 0:3.12.16-2.el10_3 | RLSA-2026:98615 |
| Rocky Linux 10 | python3-devel | Fixed | 0:3.12.16-2.el10_3 | RLSA-2026:98615 |
| Rocky Linux 10 | python3-idle | Fixed | 0:3.12.16-2.el10_3 | RLSA-2026:98615 |
| Rocky Linux 10 | python3-libs | Fixed | 0:3.12.16-2.el10_3 | RLSA-2026:98615 |
| Rocky Linux 10 | python3-test | Fixed | 0:3.12.16-2.el10_3 | RLSA-2026:98615 |
| Rocky Linux 10 | python3-tkinter | Fixed | 0:3.12.16-2.el10_3 | RLSA-2026:98615 |
| Rocky Linux 9 | python3.9 | Fixed | 0:3.9.25-7.el9_8.6 | RLSA-2026:89742 |
| Rocky Linux 8 | python3 | Fixed | 0:3.6.8-79.el8_10.rocky.0 | RLSA-2026:85239 |
| Alpine Linux 3.24 | python3 | Fixed | 3.14.10-r0 | ALPINE-CVE-2026-12345 |
| Alpine Linux 3.23 | python3 | Fixed | 3.12.16-r0 | ALPINE-CVE-2026-12345 |
| Alpine Linux 3.22 | python3 | Fixed | 3.12.16-r0 | ALPINE-CVE-2026-12345 |
| Alpine Linux 3.21 | python3 | Fixed | 3.12.16-r0 | ALPINE-CVE-2026-12345 |
What the vendor says
As published in the CVE record by PSF, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- Python Software Foundation CPython: affected: before 3.12.15, 3.13.0 to before 3.13.18, 3.14.0 to before 3.14.9, 3.15.0a1 to before 3.15.0rc3; fixed in
3.12.15,3.13.18,3.14.9,3.15.0rc3
Vendor advisories:
- https://github.com/python/cpython/pull/157580 (patch)
- https://github.com/python/cpython/commit/5c20517a4fc56683efe63a7751020db9573f538d (patch)
- https://github.com/python/cpython/commit/458e7134a5af7f86aee9d21b51cf499b41aa4420 (patch)
- https://github.com/python/cpython/commit/e1f3590f155c6d66007e958c98c9d69316551993 (patch)
- https://github.com/python/cpython/commit/06ef3d43fdaf4da97af12fa694b4886092c4b970 (patch)
- https://github.com/python/cpython/commit/58ed0259cae509a19138795df302fe60b544dc74 (patch)
References
- https://github.com/python/cpython/pull/157580
- https://github.com/python/cpython/issues/157579
- https://github.com/python/cpython/commit/5c20517a4fc56683efe63a7751020db9573f538d
- https://github.com/python/cpython/commit/458e7134a5af7f86aee9d21b51cf499b41aa4420
- https://github.com/python/cpython/commit/e1f3590f155c6d66007e958c98c9d69316551993
- https://github.com/python/cpython/commit/06ef3d43fdaf4da97af12fa694b4886092c4b970
- https://github.com/python/cpython/commit/58ed0259cae509a19138795df302fe60b544dc74
- https://github.com/python/cpython/commit/0478b52788117db4b831b3efd648f56b777628aa
- https://github.com/python/cpython/commit/c39b52d00b42200aaadff679e2fe3f1006d57c58
- https://github.com/python/cpython/commit/aa17c688d2c160969f2c8963f4454cdd139808e7
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.