CVE-2026-12345: Vulnerability in Python Software Foundation CPython
CVE-2026-12345 is a medium severity vulnerability in CPython affecting versions before 3.16.0. It involves a race condition during the cleanup of tempfile.TemporaryDirectory, where an attacker able to modify the directory tree can replace a directory with a symbolic link. This can lead to deletion or permission changes of files outside the temporary directory with the privileges of the cleanup process. Platforms where shutil.rmtree.avoids_symlink_attacks is false remain vulnerable, and file flags may be reset outside the tree on all platforms.
AI Analysis
Technical Summary
The vulnerability in CPython's tempfile.TemporaryDirectory cleanup process arises from a race condition that allows an attacker who can modify the directory tree during cleanup to replace a directory with a symbolic link. This manipulation can cause files outside the intended temporary directory to be deleted or have their permissions and file flags reset, executed with the privileges of the process performing the cleanup. The issue persists on platforms where shutil.rmtree.avoids_symlink_attacks is false, and file flags may still be reset outside the temporary directory on all platforms. The CVSS 4.0 score is 5.9, indicating a medium severity with local attack vector, low attack complexity, and partial privileges required.
Potential Impact
An attacker with the ability to modify the directory tree during the cleanup of tempfile.TemporaryDirectory can cause unintended deletion or permission changes to files outside the temporary directory. This can lead to data loss or unauthorized modification of files with the privileges of the cleanup process. The vulnerability affects all platforms where shutil.rmtree.avoids_symlink_attacks is false, and file flags may be reset outside the temporary directory on all platforms, increasing the risk of unauthorized file attribute changes.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, avoid running untrusted code that can manipulate temporary directories during cleanup. Monitor Python Software Foundation advisories for updates and patches addressing this race condition vulnerability.
CVE-2026-12345: Vulnerability in Python Software Foundation CPython
Description
CVE-2026-12345 is a medium severity vulnerability in CPython affecting versions before 3.16.0. It involves a race condition during the cleanup of tempfile.TemporaryDirectory, where an attacker able to modify the directory tree can replace a directory with a symbolic link. This can lead to deletion or permission changes of files outside the temporary directory with the privileges of the cleanup process. Platforms where shutil.rmtree.avoids_symlink_attacks is false remain vulnerable, and file flags may be reset outside the tree on all platforms.
CVSS v4.0
Score 5.9medium
Affected software
Python Software Foundation
CPython
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in CPython's tempfile.TemporaryDirectory cleanup process arises from a race condition that allows an attacker who can modify the directory tree during cleanup to replace a directory with a symbolic link. This manipulation can cause files outside the intended temporary directory to be deleted or have their permissions and file flags reset, executed with the privileges of the process performing the cleanup. The issue persists on platforms where shutil.rmtree.avoids_symlink_attacks is false, and file flags may still be reset outside the temporary directory on all platforms. The CVSS 4.0 score is 5.9, indicating a medium severity with local attack vector, low attack complexity, and partial privileges required.
Potential Impact
An attacker with the ability to modify the directory tree during the cleanup of tempfile.TemporaryDirectory can cause unintended deletion or permission changes to files outside the temporary directory. This can lead to data loss or unauthorized modification of files with the privileges of the cleanup process. The vulnerability affects all platforms where shutil.rmtree.avoids_symlink_attacks is false, and file flags may be reset outside the temporary directory on all platforms, increasing the risk of unauthorized file attribute changes.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, avoid running untrusted code that can manipulate temporary directories during cleanup. Monitor Python Software Foundation advisories for updates and patches addressing this race condition vulnerability.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- PSF
- Date Reserved
- 2026-06-15T19:08:01.497Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6abbfccb107c4a03cbb282ec
Added to database: 09/29/2026, 18:00:43 UTC
Last enriched: 09/29/2026, 18:02:18 UTC
Last updated: 09/29/2026, 18:04:10 UTC
Views: 4
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.