BIT-python-min-2023-6597: High severity Python Software Foundation CPython vulnerability
An issue was found in the CPython tempfile.TemporaryDirectory class affecting versions 3.12.1, 3.11.7, 3.10.13, 3.9.18, and 3.8.18 and prior.
The tempfile.TemporaryDirectory class would dereference symlinks during cleanup of permissions-related errors. This means users which can run privileged programs are potentially able to modify permissions of files referenced by symlinks in some circumstances.
Affected Software
Event History
Frequently Asked Questions
Who is realistically exposed to this issue?
Systems that run privileged programs using tempfile.TemporaryDirectory are potentially exposed when another user can influence symlinks encountered during temporary-directory cleanup. The issue is relevant because the other user may be able to cause permission changes to files referenced by those symlinks.
What does an attacker need in order to exploit it?
The attacker needs the ability to run privileged programs and conditions in which symlinks can be encountered while TemporaryDirectory handles permissions-related cleanup errors. No user interaction is indicated by the supplied vector.
Which CPython versions are affected?
The issue affects CPython 3.12.1, 3.11.7, 3.10.13, 3.9.18, and 3.8.18 and prior.