# CVE-2023-6597: 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 prio…

- Severity: High 7.8 (CVSS:3.1, scored by PSF) `CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.31%, higher than 26% of CVEs (2026-12-01)
- Published: 2024-03-19T15:44:28.989Z
- Modified: 2026-06-17T06:51:03.620Z
- Also known as: PSF-2024-1, BIT-LIBPYTHON-2023-6597, BIT-PYTHON-2023-6597, BIT-PYTHON-MIN-2023-6597
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: PSF

## 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.

(As written by CVE List.)

## Affected

- Python Software Foundation CPython: before 3.8.19; from 3.9.0 before 3.9.19; from 3.10.0 before 3.10.14; from 3.11.0 before 3.11.8; from 3.12.0 before 3.12.1; from 3.13.0a1 before 3.13.0a3
- python_software_foundation cpython: before 3.8.19; from 3.9.0 before 3.9.19; from 3.10.0 before 3.10.14; from 3.11.0 before 3.11.8; from 3.12.0 before 3.12.1; from 3.13.0a1 before 3.13.0a3
- https://github.com/python/cpython: before 81c16cd94ec38d61aa478b9a452436dc3b1b524d; before 6ceb8aeda504b079fef7a57b8d81472f15cdd9a5; before 5585334d772b253a01a6730e8202ffb1607c3d25; before 8eaeefe49d179ca4908d052745e3bb8b6f238f82; before d54e22a669ae6e987199bb5d2c69bb5a46b0083b; before 02a9259c717738dfe6b463c44d7e17f2b6d2cb3a
- libpython (Bitnami): before 3.8.19; from 3.9.0 before 3.9.19; from 3.10.0 before 3.10.14; from 3.11.0 before 3.11.8; from 3.12.0 before 3.12.1
- python (Bitnami): before 3.8.19; from 3.9.0 before 3.9.19; from 3.10.0 before 3.10.14; from 3.11.0 before 3.11.8; from 3.12.0 before 3.12.1
- python-min (Bitnami): before 3.8.19; from 3.9.0 before 3.9.19; from 3.10.0 before 3.10.14; from 3.11.0 before 3.11.8; from 3.12.0 before 3.12.1

## Every score

- PSF: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:N`
- Bitnami Vulnerability Database: rating High

## References

- <https://github.com/python/cpython/commit/81c16cd94ec38d61aa478b9a452436dc3b1b524d> (fix, patch, web)
- <https://github.com/python/cpython/commit/6ceb8aeda504b079fef7a57b8d81472f15cdd9a5> (fix, patch, web)
- <https://github.com/python/cpython/commit/5585334d772b253a01a6730e8202ffb1607c3d25> (fix, patch, web)
- <https://github.com/python/cpython/commit/8eaeefe49d179ca4908d052745e3bb8b6f238f82> (fix, patch, web)
- <https://github.com/python/cpython/commit/d54e22a669ae6e987199bb5d2c69bb5a46b0083b> (fix, patch, web)
- <https://github.com/python/cpython/commit/02a9259c717738dfe6b463c44d7e17f2b6d2cb3a> (fix, patch, web)
- <https://github.com/python/cpython/issues/91133> (issue-tracking, report, web)
- <https://mail.python.org/archives/list/security-announce@python.org/thread/Q5C6ATFC67K53XFV4KE45325S7NS62LD/> (advisory, vendor-advisory, web)
- <https://lists.debian.org/debian-lts-announce/2024/03/msg00025.html> (web)
- <http://www.openwall.com/lists/oss-security/2024/03/20/5> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/T3IGRX54M7RNCQOXVQO5KQKTGWCOABIM/> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/U5VHWS52HGD743C47UMCSAK2A773M2YE/> (web)
- <https://lists.debian.org/debian-lts-announce/2024/12/msg00000.html> (web)
- <https://lists.debian.org/debian-lts-announce/2024/11/msg00005.html> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2023-6597> (web)

## Sources

- CVE List: [CVE-2023-6597](https://www.cve.org/CVERecord?id=CVE-2023-6597), CVE Terms of Use, modified 2025-11-03
- Python Software Foundation: [PSF-2024-1](https://osv.dev/vulnerability/PSF-2024-1), CC-BY-4.0, modified 2025-10-09
- NVD: [CVE-2023-6597](https://nvd.nist.gov/vuln/detail/CVE-2023-6597), Public domain, modified 2026-06-17
- Bitnami Vulnerability Database: [BIT-LIBPYTHON-2023-6597](https://osv.dev/vulnerability/BIT-LIBPYTHON-2023-6597), Apache-2.0, modified 2025-11-06
- Bitnami Vulnerability Database: [BIT-PYTHON-2023-6597](https://osv.dev/vulnerability/BIT-PYTHON-2023-6597), Apache-2.0, modified 2025-11-06
- Bitnami Vulnerability Database: [BIT-PYTHON-MIN-2023-6597](https://osv.dev/vulnerability/BIT-PYTHON-MIN-2023-6597), Apache-2.0, modified 2025-11-06

---

Page: https://cve.day/CVE-2023-6597 · Whole record: https://cve.day/CVE-2023-6597.json · Rebuilt by cve.day 2026-11-25T22:58:33.367Z
