All vulnerabilities

Servers and applications

CVE-2026-12345

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

Severity
Medium 5.9
Published
29 Sept 2026
Last changed
19 Nov 2026
Added to UpHeron
19 Nov 2026
Fixed in
3.12.15, 3.13.18, 3.14.9, 3.15.0rc3
Exploit chance
0.3% in the next 30 daysHigher than 28% of CVEs. EPSS by FIRST, 19 Nov 2026
Weakness
Link following (CWE-59)
Attack
Needs local access · Only under certain conditions · No login needed · No user action needed
Attacker can
Change data · Take it down
CVSS vector
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
Sources
CVE Program

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.

From the CVE Program.

Affected software

SoftwareAffected versions
PythonServers and applications · cna:python software foundation|cpython
  • Every version before 3.12.15
  • From 3.13.0 before 3.13.18
  • From 3.14.0 before 3.14.9
  • From 3.15.0a1 before 3.15.0rc3

About Python

general-purpose programming language

From Wikidata, CC0 1.0.
Share of websites with a known server-side language
1.2%W3Techs, Nov 2026
Developers who used it in the past year
57.9%Stack Overflow Developer Survey 2025, 2025
Docker Hub pulls
9,640,071,763Docker Hub, 15 Nov 2026
GitHub stars
78,222GitHub, 15 Nov 2026
Forks
36,604GitHub, 15 Nov 2026
Developer
Python Software FoundationWikidata
License
Python Software Foundation LicenseWikidata
Written in
Python, CWikidata
First released
20 Feb 1991Wikidata
First published on GitHub
10 Feb 2017GitHub

Release lines

ReleaseLatestSecurity fixes
3.153.15.2Until 31 Oct 2031
3.143.14.10Until 31 Oct 2030
3.133.13.18Until 31 Oct 2029
3.123.12.16Until 31 Oct 2028
3.113.11.18Until 31 Oct 2027
3.103.10.22Ended 1 Oct 2026

From endoflife.date.

References

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