Vulnerability · Published Mar 19, 2024 · Assigned by PSF
CVE-2023-6597
High 7.8
In plain English
A high-severity security flaw in CPython from Python Software Foundation. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.3% (higher than 24% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
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 packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| AlmaLinux:8 | platform-python | 3.6.8-62.el8_10.alma.1 | ALSA-2024:3347 |
| AlmaLinux:8 | platform-python-debug | 3.6.8-62.el8_10.alma.1 | ALSA-2024:3347 |
| AlmaLinux:8 | platform-python-devel | 3.6.8-62.el8_10.alma.1 | ALSA-2024:3347 |
| AlmaLinux:9 | python-unversioned-command | 3.9.18-3.el9_4.1 | ALSA-2024:4078 |
| AlmaLinux:9 | python3 | 3.9.18-3.el9_4.1 | ALSA-2024:4078 |
| AlmaLinux:9 | python3-debug | 3.9.18-3.el9_4.1 | ALSA-2024:4078 |
| AlmaLinux:9 | python3-devel | 3.9.18-3.el9_4.1 | ALSA-2024:4078 |
| AlmaLinux:8 | python3-idle | 3.6.8-62.el8_10.alma.1 | ALSA-2024:3347 |
| AlmaLinux:9 | python3-idle | 3.9.18-3.el9_4.1 | ALSA-2024:4078 |
| AlmaLinux:8 | python3-libs | 3.6.8-62.el8_10.alma.1 | ALSA-2024:3347 |
| AlmaLinux:9 | python3-libs | 3.9.18-3.el9_4.1 | ALSA-2024:4078 |
| AlmaLinux:8 | python3-test | 3.6.8-62.el8_10.alma.1 | ALSA-2024:3347 |
| AlmaLinux:9 | python3-test | 3.9.18-3.el9_4.1 | ALSA-2024:4078 |
| AlmaLinux:8 | python3-tkinter | 3.6.8-62.el8_10.alma.1 | ALSA-2024:3347 |
| AlmaLinux:9 | python3-tkinter | 3.9.18-3.el9_4.1 | ALSA-2024:4078 |
| AlmaLinux:8 | python3.11 | 3.11.9-1.el8_10 | ALSA-2024:4058 |
| AlmaLinux:9 | python3.11 | 3.11.7-1.el9_4.1 | ALSA-2024:4077 |
| AlmaLinux:8 | python3.11-debug | 3.11.9-1.el8_10 | ALSA-2024:4058 |
| AlmaLinux:9 | python3.11-debug | 3.11.7-1.el9_4.1 | ALSA-2024:4077 |
| AlmaLinux:8 | python3.11-devel | 3.11.9-1.el8_10 | ALSA-2024:4058 |
| AlmaLinux:9 | python3.11-devel | 3.11.7-1.el9_4.1 | ALSA-2024:4077 |
| AlmaLinux:8 | python3.11-idle | 3.11.9-1.el8_10 | ALSA-2024:4058 |
| AlmaLinux:9 | python3.11-idle | 3.11.7-1.el9_4.1 | ALSA-2024:4077 |
| AlmaLinux:8 | python3.11-libs | 3.11.9-1.el8_10 | ALSA-2024:4058 |
| AlmaLinux:9 | python3.11-libs | 3.11.7-1.el9_4.1 | ALSA-2024:4077 |
| AlmaLinux:8 | python3.11-rpm-macros | 3.11.9-1.el8_10 | ALSA-2024:4058 |
| AlmaLinux:8 | python3.11-test | 3.11.9-1.el8_10 | ALSA-2024:4058 |
| AlmaLinux:9 | python3.11-test | 3.11.7-1.el9_4.1 | ALSA-2024:4077 |
| AlmaLinux:8 | python3.11-tkinter | 3.11.9-1.el8_10 | ALSA-2024:4058 |
| AlmaLinux:9 | python3.11-tkinter | 3.11.7-1.el9_4.1 | ALSA-2024:4077 |
| AlmaLinux:8 | python39 | 3.9.19-1.module_el8.10.0+3849+a48d89aa | ALSA-2024:3466 |
| AlmaLinux:8 | python39-Cython | 0.29.21-5.module_el8.6.0+2780+a40f65e1 | ALSA-2024:3466 |
| AlmaLinux:8 | python39-Cython | 0.29.21-5.module_el8.6.0+3248+c431e88c | ALSA-2024:3466 |
| AlmaLinux:8 | python39-PyMySQL | 0.10.1-2.module_el8.6.0+2780+a40f65e1 | ALSA-2024:3466 |
| AlmaLinux:8 | python39-attrs | 20.3.0-2.module_el8.6.0+2780+a40f65e1 | ALSA-2024:3466 |
| AlmaLinux:8 | python39-cffi | 1.14.3-2.module_el8.6.0+2780+a40f65e1 | ALSA-2024:3466 |
| AlmaLinux:8 | python39-cffi | 1.14.3-2.module_el8.6.0+3248+c431e88c | ALSA-2024:3466 |
| AlmaLinux:8 | python39-chardet | 3.0.4-19.module_el8.6.0+2780+a40f65e1 | ALSA-2024:3466 |
| AlmaLinux:8 | python39-cryptography | 3.3.1-3.module_el8.10.0+3765+2f9a457d | ALSA-2024:3466 |
| AlmaLinux:8 | python39-debug | 3.9.19-1.module_el8.10.0+3849+a48d89aa | ALSA-2024:3466 |
| AlmaLinux:8 | python39-devel | 3.9.19-1.module_el8.10.0+3849+a48d89aa | ALSA-2024:3466 |
| AlmaLinux:8 | python39-idle | 3.9.19-1.module_el8.10.0+3849+a48d89aa | ALSA-2024:3466 |
| AlmaLinux:8 | python39-idna | 2.10-4.module_el8.10.0+3849+a48d89aa | ALSA-2024:3466 |
| AlmaLinux:8 | python39-iniconfig | 1.1.1-2.module_el8.6.0+2780+a40f65e1 | ALSA-2024:3466 |
| AlmaLinux:8 | python39-libs | 3.9.19-1.module_el8.10.0+3849+a48d89aa | ALSA-2024:3466 |
| AlmaLinux:8 | python39-lxml | 4.6.5-1.module_el8.6.0+3248+c431e88c | ALSA-2024:3466 |
| AlmaLinux:8 | python39-lxml | 4.6.5-1.module_el8.6.0+2780+a40f65e1 | ALSA-2024:3466 |
| AlmaLinux:8 | python39-mod_wsgi | 4.7.1-7.module_el8.9.0+3634+fb2a896c | ALSA-2024:3466 |
| AlmaLinux:8 | python39-more-itertools | 8.5.0-2.module_el8.6.0+2780+a40f65e1 | ALSA-2024:3466 |
| AlmaLinux:8 | python39-numpy | 1.19.4-3.module_el8.6.0+3248+c431e88c | ALSA-2024:3466 |
| AlmaLinux:8 | python39-numpy | 1.19.4-3.module_el8.6.0+2780+a40f65e1 | ALSA-2024:3466 |
| AlmaLinux:8 | python39-numpy-doc | 1.19.4-3.module_el8.6.0+2780+a40f65e1 | ALSA-2024:3466 |
| AlmaLinux:8 | python39-numpy-f2py | 1.19.4-3.module_el8.6.0+2780+a40f65e1 | ALSA-2024:3466 |
| AlmaLinux:8 | python39-numpy-f2py | 1.19.4-3.module_el8.6.0+3248+c431e88c | ALSA-2024:3466 |
| AlmaLinux:8 | python39-packaging | 20.4-4.module_el8.6.0+2780+a40f65e1 | ALSA-2024:3466 |
| AlmaLinux:8 | python39-pip | 20.2.4-9.module_el8.10.0+3765+2f9a457d | ALSA-2024:3466 |
| AlmaLinux:8 | python39-pip-wheel | 20.2.4-9.module_el8.10.0+3765+2f9a457d | ALSA-2024:3466 |
| AlmaLinux:8 | python39-pluggy | 0.13.1-3.module_el8.6.0+2780+a40f65e1 | ALSA-2024:3466 |
| AlmaLinux:8 | python39-ply | 3.11-10.module_el8.6.0+2780+a40f65e1 | ALSA-2024:3466 |
| AlmaLinux:8 | python39-psutil | 5.8.0-4.module_el8.6.0+2780+a40f65e1 | ALSA-2024:3466 |
| AlmaLinux:8 | python39-psutil | 5.8.0-4.module_el8.6.0+3248+c431e88c | ALSA-2024:3466 |
| AlmaLinux:8 | python39-psycopg2 | 2.8.6-3.module_el8.10.0+3765+2f9a457d | ALSA-2024:3466 |
| AlmaLinux:8 | python39-psycopg2-doc | 2.8.6-3.module_el8.10.0+3765+2f9a457d | ALSA-2024:3466 |
| AlmaLinux:8 | python39-psycopg2-tests | 2.8.6-3.module_el8.10.0+3765+2f9a457d | ALSA-2024:3466 |
| AlmaLinux:8 | python39-py | 1.10.0-1.module_el8.6.0+2780+a40f65e1 | ALSA-2024:3466 |
| AlmaLinux:8 | python39-pybind11 | 2.7.1-1.module_el8.6.0+2780+a40f65e1 | ALSA-2024:3466 |
| AlmaLinux:8 | python39-pybind11 | 2.7.1-1.module_el8.6.0+3248+c431e88c | ALSA-2024:3466 |
| AlmaLinux:8 | python39-pybind11-devel | 2.7.1-1.module_el8.6.0+3248+c431e88c | ALSA-2024:3466 |
| AlmaLinux:8 | python39-pybind11-devel | 2.7.1-1.module_el8.6.0+2780+a40f65e1 | ALSA-2024:3466 |
| AlmaLinux:8 | python39-pycparser | 2.20-3.module_el8.6.0+2780+a40f65e1 | ALSA-2024:3466 |
| AlmaLinux:8 | python39-pyparsing | 2.4.7-5.module_el8.6.0+2780+a40f65e1 | ALSA-2024:3466 |
| AlmaLinux:8 | python39-pysocks | 1.7.1-4.module_el8.6.0+2780+a40f65e1 | ALSA-2024:3466 |
| AlmaLinux:8 | python39-pytest | 6.0.2-2.module_el8.6.0+2780+a40f65e1 | ALSA-2024:3466 |
| AlmaLinux:8 | python39-pyyaml | 5.4.1-1.module_el8.6.0+2780+a40f65e1 | ALSA-2024:3466 |
| AlmaLinux:8 | python39-pyyaml | 5.4.1-1.module_el8.6.0+3248+c431e88c | ALSA-2024:3466 |
| AlmaLinux:8 | python39-requests | 2.25.0-3.module_el8.9.0+3634+fb2a896c | ALSA-2024:3466 |
| AlmaLinux:8 | python39-rpm-macros | 3.9.19-1.module_el8.10.0+3849+a48d89aa | ALSA-2024:3466 |
| AlmaLinux:8 | python39-scipy | 1.5.4-5.module_el8.9.0+3634+fb2a896c | ALSA-2024:3466 |
| AlmaLinux:8 | python39-setuptools | 50.3.2-5.module_el8.10.0+3765+2f9a457d | ALSA-2024:3466 |
| AlmaLinux:8 | python39-setuptools-wheel | 50.3.2-5.module_el8.10.0+3765+2f9a457d | ALSA-2024:3466 |
| AlmaLinux:8 | python39-six | 1.15.0-3.module_el8.6.0+2780+a40f65e1 | ALSA-2024:3466 |
| AlmaLinux:8 | python39-test | 3.9.19-1.module_el8.10.0+3849+a48d89aa | ALSA-2024:3466 |
| AlmaLinux:8 | python39-tkinter | 3.9.19-1.module_el8.10.0+3849+a48d89aa | ALSA-2024:3466 |
| AlmaLinux:8 | python39-toml | 0.10.1-5.module_el8.6.0+2780+a40f65e1 | ALSA-2024:3466 |
| AlmaLinux:8 | python39-urllib3 | 1.25.10-5.module_el8.10.0+3765+2f9a457d | ALSA-2024:3466 |
| AlmaLinux:8 | python39-wcwidth | 0.2.5-3.module_el8.6.0+2780+a40f65e1 | ALSA-2024:3466 |
| AlmaLinux:8 | python39-wheel | 1:0.35.1-4.module_el8.6.0+2780+a40f65e1 | ALSA-2024:3466 |
| AlmaLinux:8 | python39-wheel-wheel | 1:0.35.1-4.module_el8.6.0+2780+a40f65e1 | ALSA-2024:3466 |
| Debian:12 | pypy3 | 7.3.11+dfsg-2+deb12u2 | DEBIAN-CVE-2023-6597 |
| Debian:13 | pypy3 | 7.3.13+dfsg-1 | DEBIAN-CVE-2023-6597 |
| Debian:14 | pypy3 | 7.3.13+dfsg-1 | DEBIAN-CVE-2023-6597 |
| Debian:12 | python3.11 | 3.11.2-6+deb12u2 | DEBIAN-CVE-2023-6597 |
| Rocky Linux:8 | python3 | 0:3.6.8-62.el8_10.rocky.0 | RLSA-2024:3347 |
| Rocky Linux:9 | python3.11 | 0:3.11.7-1.el9_4.1 | RLSA-2024:4077 |
| Rocky Linux:9 | python3.9 | 0:3.9.18-3.el9_4.1 | RLSA-2024:4078 |
| Ubuntu:22.04:LTS | python3.10 | 3.10.12-1~22.04.4 | USN-6891-1 |
| Ubuntu:22.04:LTS | python3.10 | 3.10.12-1~22.04.4 | UBUNTU-CVE-2023-6597 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| Python Software Foundation | CPython | 0 – before 3.8.193.9.0 – before 3.9.193.10.0 – before 3.10.143.11.0 – before 3.11.83.12.0 – before 3.12.13.13.0a1 – before 3.13.0a3 |
References
- https://github.com/python/cpython/commit/81c16cd94ec38d61aa478b9a452436dc3b1b524d patch
- https://github.com/python/cpython/commit/6ceb8aeda504b079fef7a57b8d81472f15cdd9a5 patch
- https://github.com/python/cpython/commit/5585334d772b253a01a6730e8202ffb1607c3d25 patch
- https://github.com/python/cpython/commit/8eaeefe49d179ca4908d052745e3bb8b6f238f82 patch
- https://github.com/python/cpython/commit/d54e22a669ae6e987199bb5d2c69bb5a46b0083b patch
- https://github.com/python/cpython/commit/02a9259c717738dfe6b463c44d7e17f2b6d2cb3a patch
- https://github.com/python/cpython/issues/91133 issue-tracking
- https://mail.python.org/archives/list/security-announce@python.org/thread/Q5C6ATFC67K53XFV4KE45325S7NS62LD/ vendor-advisory
- https://lists.debian.org/debian-lts-announce/2024/03/msg00025.html
- http://www.openwall.com/lists/oss-security/2024/03/20/5
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/T3IGRX54M7RNCQOXVQO5KQKTGWCOABIM/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/U5VHWS52HGD743C47UMCSAK2A773M2YE/
- https://lists.debian.org/debian-lts-announce/2024/12/msg00000.html
- https://lists.debian.org/debian-lts-announce/2024/11/msg00005.html