PSF-2024-1: 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 are exposed when a privileged program uses tempfile.TemporaryDirectory and an untrusted user can influence the temporary-directory cleanup scenario. The described impact requires a user who can run privileged programs.
What does an attacker need to exploit it?
An attacker needs to cause cleanup to encounter permissions-related errors and have a symlink that references a target file. During cleanup, the vulnerable behavior can dereference that symlink and modify permissions on the referenced file in some circumstances.
What is the potential impact?
The issue can allow modification of permissions on files referenced by symlinks. The supplied severity vector rates confidentiality and integrity impact as high, with no availability impact.