PatchSiren

PatchSiren cyber security CVE debrief

CVE-2026-12345 Python Software Foundation CVE debrief

A race condition vulnerability in tempfile.TemporaryDirectory cleanup allows an attacker to delete files outside the temporary directory or reset their permissions and file flags. This issue affects CPython versions before 3.12.15 and 3.15.0rc3. The vulnerability has a CVSS score of 5.9 and is considered medium severity. Defenders responsible for CPython deployments should assess exposure and prioritize patching or upgrading to affected versions of CPython. This includes system administrators, security teams, and developers using CPython in their applications. The vulnerability can be exploited by replacing a directory with a symbolic link during cleanup, allowing files outside of

Vendor
Python Software Foundation
Product
CPython
CVSS
MEDIUM 5.9
CISA KEV
Not listed in stored evidence
Original CVE published
2026-09-29
Original CVE updated
2026-10-10
Advisory published
2026-09-29
Advisory updated
2026-10-10

Who should care

Defenders responsible for CPython deployments should assess exposure and prioritize patching or upgrading to affected versions of CPython. This includes system administrators, security teams, and developers using CPython in their applications.

Why it matters

A race condition vulnerability in tempfile.TemporaryDirectory cleanup allows an attacker to delete files outside the temporary directory or reset their permissions and file flags. Defenders should prioritize patching or upgrading to affected versions of CPython.

  • Potential deletion of files outside the temporary directory
  • Potential reset of file permissions and flags outside the temporary directory
  • Requires verification of affected versions and patching or upgrading
  • May require monitoring for exploitation attempts

Technical summary

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. This issue affects CPython versions before 3.12.15 and 3.15.0rc3. The vulnerability has a CVSS score of 5.9 and is considered medium severity. The vulnerability can be exploited by replacing a directory with a symbolic link during cleanup, allowing files outside of the temporary directory to be deleted or modified.

Defensive priority

Defenders should prioritize patching or upgrading to affected versions of CPython, specifically versions 3.12.15 or later, and 3.15.0rc3 or later.

Recommended defensive actions

  • Assess exposure and prioritize patching for CPython versions before 3.12.15 and 3.15.0rc3
  • Verify and apply patches or upgrades to affected versions of CPython
  • Monitor for and respond to potential exploitation attempts
  • Review compensating controls for exposed systems while remediation is scheduled and verified
  • Check relevant monitoring, detection, and logs for exposed assets that need extra review
  • Track exceptions, retest remediated assets, and close the item only after evidence is documented
  • Confirm whether affected product deployments exist in managed environments and assign an owner for follow-up

Evidence notes

The CVE record and source item provide details on the vulnerability, including its description, affected versions, and references to patches and issue tracking. The vulnerability affects CPython versions before 3.12.15 and 3.15.0rc3. The CVE Program record and NVD detail page provide official information on the vulnerability. The source item provides additional details on the vulnerability. The patch and issue tracking references provide additional information on the fix and the issue.

Sources and references

Verified primary and authoritative sources

  • CVE-2026-12345 CVE Program record

    Publisher, destination, and source semantics verified

    URL: https://www.cve.org/CVERecord?id=CVE-2026-12345

    CVE Program - Official CVE Program record with source-provided CVE metadata.

  • CVE-2026-12345 NVD vulnerability detail

    Publisher, destination, and source semantics verified

    URL: https://nvd.nist.gov/vuln/detail/CVE-2026-12345

    NIST National Vulnerability Database - Official NIST NVD detail page and source-specific vulnerability assessment.

Supplemental references

  • Race condition in tempfile.TemporaryDirectory cleanup allows deleting files outside the temporar

    Unverified legacy reference

    URL: https://raw.githubusercontent.com/CVEProject/cvelistV5/main/cves/2026/12xxx/CVE-2026-12345.json

    cve_program_cvelist_v5

  • Source reference

    Unverified legacy reference

    URL: https://github.com/python/cpython/pull/157580

    Supplemental source - patch

  • Source reference

    Unverified legacy reference

    URL: https://github.com/python/cpython/issues/157579

    Supplemental source - issue-tracking

  • Source reference

    Unverified legacy reference

    URL: https://github.com/python/cpython/commit/5c20517a4fc56683efe63a7751020db9573f538d

    Supplemental source - patch

  • Source reference

    Unverified legacy reference

    URL: https://github.com/python/cpython/commit/458e7134a5af7f86aee9d21b51cf499b41aa4420

    Supplemental source - patch

  • Source reference

    Unverified legacy reference

    URL: https://github.com/python/cpython/commit/e1f3590f155c6d66007e958c98c9d69316551993

    Supplemental source - patch

  • Source reference

    Unverified legacy reference

    URL: https://github.com/python/cpython/commit/06ef3d43fdaf4da97af12fa694b4886092c4b970

    Supplemental source - patch

  • Source reference

    Unverified legacy reference

    URL: https://github.com/python/cpython/commit/58ed0259cae509a19138795df302fe60b544dc74

    Supplemental source - patch

Methodology and review provenance

AI-assisted synthesis based on stored public vulnerability evidence. System validation, approval state, and publication status do not by themselves establish human review of this revision. PatchSiren helps prioritize defensive review and does not prove exposure or remediation on any system.