Open
Labels
3.10 (EOL)end of life3.11only security fixes3.12only security fixes3.13only security fixes3.14bugs and security fixes3.16new features, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directorytype-securityA security issue
Description
When working around file system permission errors, files are removed after resolving their path again, this means that by replacing a directory of the tree with a symbolic link, an attacker can make the cleanup delete files outside of the temporary directory.
Linked PRs
- gh-157579: Fix race condition in the cleanup of
tempfile.TemporaryDirectory#157580 - [3.13] gh-157579: Fix race condition in the cleanup of
tempfile.TemporaryDirectory(GH-157580) #158429 - [3.14] gh-157579: Fix race condition in the cleanup of
tempfile.TemporaryDirectory(GH-157580) #158430 - [3.15] gh-157579: Fix race condition in the cleanup of
tempfile.TemporaryDirectory(GH-157580) #158431 - [3.12] gh-157579: Fix race condition in the cleanup of tempfile.TemporaryDirectory (GH-157580) #158489
- [3.12] GH-157579: Revert GH-158489 (prematurely merged) #158527
- [3.12] GH-157579: Revert GH-158489 (prematurely merged) #158528
- [3.12] gh-157579: Fix race condition in the cleanup of
tempfile.TemporaryDirectory(GH-157580) (GH-158430) #159074 - [3.11] gh-157579: Fix race condition in the cleanup of
tempfile.TemporaryDirectory(GH-157580) (GH-159074) #161944 - gh-157579: Fix TemporaryDirectory cleanup fallbacks with bytes paths #162116
- [3.15] gh-157579: Fix TemporaryDirectory cleanup fallbacks with bytes paths (GH-162116) #162208
- [3.14] gh-157579: Fix TemporaryDirectory cleanup fallbacks with bytes paths (GH-162116) #162209
- [3.13] gh-157579: Fix TemporaryDirectory cleanup fallbacks with bytes paths (GH-162116) #162210
- [3.12] gh-157579: Fix TemporaryDirectory cleanup fallbacks with bytes paths (GH-162116) #162876
Metadata
Metadata
Assignees
Labels
3.10 (EOL)end of life3.11only security fixes3.12only security fixes3.13only security fixes3.14bugs and security fixes3.16new features, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directorytype-securityA security issue
Projects
- StatusShow more project fieldsNo status
Activity
gh-157579: Fix race condition in the cleanup of `tempfile.TemporaryDi…
[3.12] gh-157579: Fix race condition in the cleanup of tempfile.Tempo…
[3.12] GH-157579: Revert GH-158489 (prematurely merged) (#158528)
hugovk commentedon Sep 30, 2026
TODO:
[3.15] gh-157579: Fix race condition in the cleanup of `tempfile.Temp…
3 remaining items
[3.14] gh-157579: Fix race condition in the cleanup of `tempfile.Temp…
[3.13] gh-157579: Fix race condition in the cleanup of `tempfile.Temp…
[3.12] gh-157579: Fix race condition in the cleanup of `tempfile.Temp…
[3.10] pythongh-157579: Fix race condition in the cleanup of tempfile…
Update version to 3.10.22.2 and add release notes
[3.9] pythongh-157579: Fix race condition in the cleanup of tempfile.…
Update version to 3.9.25.2 and add release notes
00495: pythongh-157579: Fix race condition in the cleanup of `tempfil…
gh-157579: Fix TemporaryDirectory cleanup fallbacks with bytes paths (G…
[3.15] gh-157579: Fix TemporaryDirectory cleanup fallbacks with bytes…
[3.14] gh-157579: Fix TemporaryDirectory cleanup fallbacks with bytes…
[3.13] gh-157579: Fix TemporaryDirectory cleanup fallbacks with bytes…