BIT-python-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
Which environments are realistically exposed?
Systems where users can run privileged programs that use CPython's TemporaryDirectory cleanup are potentially exposed. The issue is locally exploitable rather than remotely exploitable.
What does an attacker need to exploit this?
The supplied vector indicates local access, high attack complexity, no prior privileges, and no user interaction. Exploitation involves circumstances in which cleanup encounters permissions-related errors and follows a symlink.
How can I determine whether my CPython version is affected?
The affected releases listed are CPython 3.12.1, 3.11.7, 3.10.13, 3.9.18, and 3.8.18, as well as prior versions. Check the CPython version used by privileged programs, not only the system-wide default interpreter.