Skip to main content

CVE-2026-12345: Vulnerability in Python Software Foundation CPython

0
Medium
VulnerabilityCVE-2026-12345cvecve-2026-12345
Published: 09/29/2026 (09/29/2026, 17:46:01 UTC)
Source: CVE Database V5
Vendor/Project: Python Software Foundation
Product: 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

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vuln. Confidentiality
None
Vuln. Integrity
High
Vuln. Availability
High
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
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

Affected software

Python Software Foundation

CPython

Affected versions
>=0 <3.16.0
GitHub Actionsmore threats →cve
CPython
pkg:github/CPython
Affected versions
>=0 <3.16.0

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

AILast updated: 09/29/2026, 18:02:18 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses