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.

Project Subscriptions

Vendors Products
Cpython Subscribe
Advisories

No advisories yet.

Fixes

Solution

No solution given by the vendor.


Workaround

No workaround given by the vendor.

History

Tue, 29 Sep 2026 22:30:00 +0000

Type Values Removed Values Added
References

Tue, 29 Sep 2026 22:00:00 +0000

Type Values Removed Values Added
First Time appeared Python
Python cpython
Vendors & Products Python
Python cpython

Tue, 29 Sep 2026 19:30:00 +0000

Type Values Removed Values Added
Weaknesses CWE-59
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Tue, 29 Sep 2026 18:15:00 +0000


Tue, 29 Sep 2026 18:00:00 +0000

Type Values Removed Values Added
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.
Title Race condition in tempfile.TemporaryDirectory cleanup allows deleting files outside the temporary directory
References
Metrics cvssV4_0

{'score': 5.9, 'vector': 'CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N'}


Projects

Sign in to view the affected projects.

cve-icon MITRE

Status: PUBLISHED

Assigner: PSF

Published:

Updated: 2026-09-29T21:07:55.567Z

Reserved: 2026-06-15T19:08:01.497Z

Link: CVE-2026-12345

cve-icon Vulnrichment

Updated: 2026-09-29T21:07:55.567Z

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-09-29T18:17:14.707

Modified: 2026-09-29T22:17:08.853

Link: CVE-2026-12345

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-09-29T22:45:18Z

Weaknesses