Skip to content
Threat Brief

← All advisories

CVE-2026-12345

Medium 5.9No known exploitationFix available

Race condition in tempfile.TemporaryDirectory cleanup allows deleting files outside the temporary directory

Record last updated

CVSS score

5.9

Medium on a 0 to 10 scale

EPSS, chance of exploitation in 30 days

0.3%

Higher than 29% of scored CVEs. A prediction, not evidence.

CISA remediation deadline

None

Not in the KEV catalog

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.

Weakness: CWE-59

Patching and mitigation

Patch status
Fix available (source: Microsoft MSRC)
Fix documented (source date)
Mitigation
None documented
Vendor guidance
msrc.microsoft.com (opens in a new tab)

Affected products

VendorProductAffected versionsFixed inPer
Microsoftazl3 python3 3.12.14-2 on Azure Linux 3.0Not documented3.12.16-1Microsoft MSRC
Python Software FoundationCPythonfrom 3.13.0 before 3.13.183.13.18CVE Program
Python Software FoundationCPythonfrom 3.14.0 before 3.14.93.14.9CVE Program
Python Software FoundationCPythonfrom 3.15.0a1 before 3.15.0rc33.15.0rc3CVE Program
Python Software FoundationCPythonall versions before 3.12.153.12.15CVE Program

Timeline

  1. Disclosure

    CVE record published by PSF

    Source: CVE Program (opens in a new tab)

  2. Advisory

    Microsoft advisory published

    Source: Microsoft MSRC (opens in a new tab)

  3. Advisory change

    Microsoft advisory revised (2.0): Information published.

    Source: Microsoft MSRC (opens in a new tab)

  4. Advisory change

    Microsoft advisory revised (3.0): Information published.

    Source: Microsoft MSRC (opens in a new tab)

  5. Advisory change

    Microsoft advisory revised (4.0): Information published.

    Source: Microsoft MSRC (opens in a new tab)

  6. Advisory change

    Microsoft advisory revised (5.0): Information published.

    Source: Microsoft MSRC (opens in a new tab)

  7. Advisory change

    Microsoft advisory revised (6.0): Information published.

    Source: Microsoft MSRC (opens in a new tab)

  8. Patch

    Fix documented by Microsoft MSRC

    Source: Microsoft MSRC (opens in a new tab)

Vendor guidance and references