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. https://github.com/python/cpython/commit/02a9259c717738dfe6b463c44d7e17f2b6d2cb3a https://github.com/python/cpython/commit/5585334d772b253a01a6730e8202ffb1607c3d25 https://github.com/python/cpython/commit/6ceb8aeda504b079fef7a57b8d81472f15cdd9a5 https://github.com/python/cpython/commit/81c16cd94ec38d61aa478b9a452436dc3b1b524d https://github.com/python/cpython/commit/8eaeefe49d179ca4908d052745e3bb8b6f238f82 https://github.com/python/cpython/commit/d54e22a669ae6e987199bb5d2c69bb5a46b0083b https://github.com/python/cpython/issues/91133 https://lists.debian.org/debian-lts-announce/2024/03/msg00025.html https://mail.python.org/archives/list/security-announce@python.org/thread/Q5C6ATFC67K53XFV4KE45325S7NS62LD/
The fix is in these upstream releases: 3.12.1, 3.11.8, 3.10.14, 3.9.19 and 3.8.19
python2.7 is not-affected as tempfile.TemporaryDirectory added in 3.2. https://github.com/python/cpython/pull/99930 https://github.com/python/cpython/issues/91133 https://github.com/python/cpython/commit/6ceb8aeda504b079fef7a57b8d81472f15cdd9a5 (v3.12.1) https://github.com/python/cpython/commit/5585334d772b253a01a6730e8202ffb1607c3d25 (v3.11.8) https://github.com/python/cpython/commit/8eaeefe49d179ca4908d052745e3bb8b6f238f82 (v3.10.14) https://github.com/python/cpython/commit/d54e22a669ae6e987199bb5d2c69bb5a46b0083b (v3.9.19) https://mail.python.org/archives/list/security-announce@python.org/thread/Q5C6ATFC67K53XFV4KE45325S7NS62LD/
This issue has been addressed in the following products: Red Hat Enterprise Linux 8 Via RHSA-2024:3347 https://access.redhat.com/errata/RHSA-2024:3347
This issue has been addressed in the following products: Red Hat Enterprise Linux 8.8 Extended Update Support Via RHSA-2024:3391 https://access.redhat.com/errata/RHSA-2024:3391
This issue has been addressed in the following products: Red Hat Enterprise Linux 8 Via RHSA-2024:3466 https://access.redhat.com/errata/RHSA-2024:3466
This issue has been addressed in the following products: Red Hat Enterprise Linux 8 Via RHSA-2024:4058 https://access.redhat.com/errata/RHSA-2024:4058
This issue has been addressed in the following products: Red Hat Enterprise Linux 9 Via RHSA-2024:4077 https://access.redhat.com/errata/RHSA-2024:4077
This issue has been addressed in the following products: Red Hat Enterprise Linux 9 Via RHSA-2024:4078 https://access.redhat.com/errata/RHSA-2024:4078
This issue has been addressed in the following products: Red Hat Enterprise Linux 8.2 Advanced Update Support Via RHSA-2024:4166 https://access.redhat.com/errata/RHSA-2024:4166
This issue has been addressed in the following products: Red Hat Enterprise Linux 8.8 Extended Update Support Via RHSA-2024:4370 https://access.redhat.com/errata/RHSA-2024:4370
This issue has been addressed in the following products: Red Hat Enterprise Linux 8.6 Advanced Mission Critical Update Support Red Hat Enterprise Linux 8.6 Update Services for SAP Solutions Red Hat Enterprise Linux 8.6 Telecommunications Update Service Via RHSA-2024:4406 https://access.redhat.com/errata/RHSA-2024:4406
This issue has been addressed in the following products: Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update Support Red Hat Enterprise Linux 8.4 Update Services for SAP Solutions Red Hat Enterprise Linux 8.4 Telecommunications Update Service Via RHSA-2024:4456 https://access.redhat.com/errata/RHSA-2024:4456
This issue has been addressed in the following products: Service Interconnect 1.4 for RHEL 9 Via RHSA-2024:4865 https://access.redhat.com/errata/RHSA-2024:4865
This issue has been addressed in the following products: Service Interconnect 1 for RHEL 9 Via RHSA-2024:4871 https://access.redhat.com/errata/RHSA-2024:4871
This issue has been addressed in the following products: Red Hat Enterprise Linux 9.2 Extended Update Support Via RHSA-2024:4896 https://access.redhat.com/errata/RHSA-2024:4896
This issue has been addressed in the following products: Red Hat Enterprise Linux 9.2 Extended Update Support Via RHSA-2024:5535 https://access.redhat.com/errata/RHSA-2024:5535
This issue has been addressed in the following products: Red Hat Enterprise Linux 9.0 Update Services for SAP Solutions Via RHSA-2024:5689 https://access.redhat.com/errata/RHSA-2024:5689