Back to CVE records
Medium 5.9Published Sep 29, 2026

CVE-2026-12345Race condition in tempfile.TemporaryDirectory cleanup allows deleting files outside the temporary directory

Updated under an hour ago ()

Does this affect you?

It affects Python Software Foundation CPython. Add what you run to find out whether that includes you.

No exploitation reported and no EPSS estimate yet.

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.

CVSS
5.9 MEDIUM (v4.0, CNA)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
Weakness (CWE)
CWE-59
Known exploited
Not in CISA's KEV catalog
EPSS (exploitation in the next 30 days)
Not loaded for this CVE
Assigned by
PSF
NVD analysis
Awaiting Analysis
Record last updated
Oct 10, 2026
First seen by InfoSec Signals
Oct 9, 2026

Affected products

Affected products
Python Software Foundation CPython
python_software_foundation:cpython (from the name)
before 3.12.15; from 3.15.0a1 before 3.15.0rc3
CNA record

References

  • patch
  • issue-tracking
  • patch
  • patch
  • patch
  • patch
  • patch

The CVE record is authoritative. Products marked “from the name” were identified from the CNA's free-text names, not a CPE, and are matched less certainly. This product uses the NVD API but is not endorsed or certified by the NVD.

Your cookie choices
We use essential cookies to run this site, and, only with your consent, an advertising cookie from Google to measure whether our ads lead to sign-ups and subscriptions. See our for details.