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.
INFO
Published Date :
Sept. 29, 2026, 6:17 p.m.
Last Modified :
Oct. 10, 2026, 1:16 a.m.
Remotely Exploit :
No
Source :
[email protected]
Affected Products
The following products are affected by CVE-2026-12345
vulnerability.
Even if cvefeed.io is aware of the exact versions of the
products
that
are
affected, the information is not represented in the table below.
CVSS Scores
| Score | Version | Severity | Vector | Exploitability Score | Impact Score | Source |
|---|---|---|---|---|---|---|
| CVSS | 134c704f-9b21-4f2e-91b3-4a467353bcc0 | |||||
| CVSS 4.0 | MEDIUM | 28c92f92-d60d-412d-b760-e73465c3df22 | ||||
| CVSS 4.0 | MEDIUM | [email protected] |
Solution
- Update Python to a version that includes the fix.
- Ensure temporary directory operations are secured.
References to Advisories, Solutions, and Tools
Here, you will find a curated list of external links that provide in-depth
information, practical solutions, and valuable tools related to
CVE-2026-12345.
CWE - Common Weakness Enumeration
While CVE identifies
specific instances of vulnerabilities, CWE categorizes the common flaws or
weaknesses that can lead to vulnerabilities. CVE-2026-12345 is
associated with the following CWEs:
Common Attack Pattern Enumeration and Classification (CAPEC)
Common Attack Pattern Enumeration and Classification
(CAPEC)
stores attack patterns, which are descriptions of the common attributes and
approaches employed by adversaries to exploit the CVE-2026-12345
weaknesses.
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
Results are limited to the first 15 repositories due to potential performance issues.
The following list is the news that have been mention
CVE-2026-12345 vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2026-12345 vulnerability over time.
Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.
-
CVE Modified by [email protected]
Oct. 10, 2026
Action Type Old Value New Value Added Reference https://github.com/python/cpython/commit/58ed0259cae509a19138795df302fe60b544dc74 -
CVE Modified by [email protected]
Oct. 03, 2026
Action Type Old Value New Value Added Affected Affected value modified. <a href="https://github.com/CVEProject/cvelistV5/blob/main/cves/2026/12xxx/CVE-2026-12345.json">CVE-2026-12345</a> Added Reference https://github.com/python/cpython/commit/06ef3d43fdaf4da97af12fa694b4886092c4b970 -
CVE Modified by [email protected]
Sep. 30, 2026
Action Type Old Value New Value Added Affected Affected value modified. <a href="https://github.com/CVEProject/cvelistV5/blob/main/cves/2026/12xxx/CVE-2026-12345.json">CVE-2026-12345</a> -
CVE Modified by [email protected]
Sep. 30, 2026
Action Type Old Value New Value Added Reference https://github.com/python/cpython/commit/458e7134a5af7f86aee9d21b51cf499b41aa4420 Added Reference https://github.com/python/cpython/commit/e1f3590f155c6d66007e958c98c9d69316551993 -
CVE Modified by af854a3a-2127-422b-91ae-364da2661108
Sep. 29, 2026
Action Type Old Value New Value Added Reference http://www.openwall.com/lists/oss-security/2026/09/29/40 -
CVE Modified by 134c704f-9b21-4f2e-91b3-4a467353bcc0
Sep. 29, 2026
Action Type Old Value New Value Added CWE CWE-59 Added SSVC {'id': 'CVE-2026-12345', 'role': 'CISA Coordinator', 'options': [{'exploitation': 'none'}, {'automatable': 'no'}, {'technicalImpact': 'partial'}], 'version': '2.0.3', 'timestamp': '2026-09-29T18:38:00.590353Z'} -
New CVE Received by [email protected]
Sep. 29, 2026
Action Type Old Value New Value 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. Added CVSS V4.0 AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X Added Affected New affected value received. <a href="https://github.com/CVEProject/cvelistV5/blob/main/cves/2026/12xxx/CVE-2026-12345.json">CVE-2026-12345</a> Added Reference https://github.com/python/cpython/commit/5c20517a4fc56683efe63a7751020db9573f538d Added Reference https://github.com/python/cpython/issues/157579 Added Reference https://github.com/python/cpython/pull/157580