---
title: "CVE-2023-6597\n    | Ubuntu"
description: Ubuntu is an open source software operating system that runs from the
  desktop, to the cloud, to all your internet connected things.
url: https://ubuntu.com/security/CVE-2023-6597?format=md
keywords: index, follow
---

# CVE-2023-6597

Publication date 19 March 2024

Last updated 24 June 2025

---

Ubuntu priority

**Medium**

[Why this priority?](https://ubuntu.com/security/cves/about#priority )

## Cvss 3 Severity Score

**7.8 · High**

[Score breakdown](https://ubuntu.com/security/CVE-2023-6597?format=md#impact-score)

Toggle side navigation

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

[Read the notes from the security team](https://ubuntu.com/security/CVE-2023-6597?format=md#notes)

## Mitigation

allenpthuang> https://bugs.python.org/issue26660

## Status

Show unmaintained releases

| Package | Ubuntu Release | Status |
| --- | --- | --- |
| python2.7 | 26.04 LTS resolute | Not in release |
| 25.10 questing | Not in release |
| 25.04 plucky | Not in release |
| 24.10 oracular | Not in release |
| 24.04 LTS noble | Not in release |
| 23.10 mantic | Not in release |
| 22.04 LTS jammy | Not affected |
| 20.04 LTS focal | Not affected |
| 18.04 LTS bionic | Not affected |
| 16.04 LTS xenial | Not affected |
| 14.04 LTS trusty | Not affected |
| python3.10 | 26.04 LTS resolute | Not in release |
| 25.10 questing | Not in release |
| 25.04 plucky | Not in release |
| 24.10 oracular | Not in release |
| 24.04 LTS noble | Not in release |
| 23.10 mantic | Not in release |
| 22.04 LTS jammy | Fixed 3.10.12-1~22.04.4 |
| 20.04 LTS focal | Not in release |
| python3.11 | 26.04 LTS resolute | Not in release |
| 25.10 questing | Not in release |
| 25.04 plucky | Not in release |
| 24.10 oracular | Not in release |
| 24.04 LTS noble | Not in release |
| 23.10 mantic | Fixed 3.11.6-3ubuntu0.1 |
| 22.04 LTS jammy | Fixed 3.11.0~rc1-1~22.04.1~esm1  Ubuntu Pro |
| 20.04 LTS focal | Not in release |
| python3.12 | 26.04 LTS resolute | Not in release |
| 25.10 questing | Not in release |
| 25.04 plucky | Not in release |
| 24.10 oracular | Not affected |
| 24.04 LTS noble | Not affected |
| 23.10 mantic | Fixed 3.12.0-1ubuntu0.1 |
| 22.04 LTS jammy | Not in release |
| 20.04 LTS focal | Not in release |
| python3.4 | 26.04 LTS resolute | Not in release |
| 25.10 questing | Not in release |
| 25.04 plucky | Not in release |
| 24.10 oracular | Not in release |
| 24.04 LTS noble | Not in release |
| 23.10 mantic | Not in release |
| 22.04 LTS jammy | Not in release |
| 20.04 LTS focal | Not in release |
| 14.04 LTS trusty | Needs evaluation |
| python3.5 | 26.04 LTS resolute | Not in release |
| 25.10 questing | Not in release |
| 25.04 plucky | Not in release |
| 24.10 oracular | Not in release |
| 24.04 LTS noble | Not in release |
| 23.10 mantic | Not in release |
| 22.04 LTS jammy | Not in release |
| 20.04 LTS focal | Not in release |
| 16.04 LTS xenial | Fixed 3.5.2-2ubuntu0~16.04.13+esm13  Ubuntu Pro |
| 14.04 LTS trusty | Not affected |
| python3.6 | 26.04 LTS resolute | Not in release |
| 25.10 questing | Not in release |
| 25.04 plucky | Not in release |
| 24.10 oracular | Not in release |
| 24.04 LTS noble | Not in release |
| 23.10 mantic | Not in release |
| 22.04 LTS jammy | Not in release |
| 20.04 LTS focal | Not in release |
| 18.04 LTS bionic | Not affected |
| python3.7 | 26.04 LTS resolute | Not in release |
| 25.10 questing | Not in release |
| 25.04 plucky | Not in release |
| 24.10 oracular | Not in release |
| 24.04 LTS noble | Not in release |
| 23.10 mantic | Not in release |
| 22.04 LTS jammy | Not in release |
| 20.04 LTS focal | Not in release |
| 18.04 LTS bionic | Fixed 3.7.5-2ubuntu1~18.04.2+esm3  Ubuntu Pro |
| python3.8 | 26.04 LTS resolute | Not in release |
| 25.10 questing | Not in release |
| 25.04 plucky | Not in release |
| 24.10 oracular | Not in release |
| 24.04 LTS noble | Not in release |
| 23.10 mantic | Not in release |
| 22.04 LTS jammy | Not in release |
| 20.04 LTS focal | Fixed 3.8.10-0ubuntu1~20.04.10 |
| 18.04 LTS bionic | Fixed 3.8.0-3ubuntu1~18.04.2+esm2  Ubuntu Pro |
| python3.9 | 26.04 LTS resolute | Not in release |
| 25.10 questing | Not in release |
| 25.04 plucky | Not in release |
| 24.10 oracular | Not in release |
| 24.04 LTS noble | Not in release |
| 23.10 mantic | Not in release |
| 22.04 LTS jammy | Not in release |
| 20.04 LTS focal | Fixed 3.9.5-3ubuntu0~20.04.1+esm2  Ubuntu Pro |

---

* [How can I get the fixes?](https://ubuntu.com/security/cves/about#security)
* [What do statuses mean?](https://ubuntu.com/security/cves/about#statuses)
* [Patch details](https://ubuntu.com/security/CVE-2023-6597?format=md#patch-details)

### Get expanded security coverage with Ubuntu Pro

Reduce your average CVE exposure time from 98 days to 1 day with expanded CVE patching, ten-years security maintenance and optional support for the full stack of open-source applications. Free for personal use.

[Get Ubuntu Pro](https://ubuntu.com/pro)
[30-day free trial](https://ubuntu.com/pro/free-trial)

## Notes

---

### [allenpthuang](https://launchpad.net/~allenpthuang)

this was introduced in https://github.com/python/cpython/pull/10320/commits/dcd67c568a477ddf7524e373ac266d2f087e5665

### Patch details

For informational purposes only. We recommend not to cherry-pick updates. [How can I get the fixes?](https://ubuntu.com/security/cves/about#security)

| Package | Patch details |
| --- | --- |
| python3.12 | * Upstream:   [6ceb8ae](https://github.com/python/cpython/commit/6ceb8aeda504b079fef7a57b8d81472f15cdd9a5) |

## Severity score breakdown

CVSS version:
CVSS v3.0

**Base score**

7.8 · High

* Base metrics

  | Parameter | Value |
  | --- | --- |
  | Attack vector | Local |
  | Attack complexity | High |
  | Privileges required | None |
  | User interaction | None |
  | Scope | Changed |
  | Confidentiality impact | High |
  | Integrity impact | High |
  | Availability impact | None |
* Scores

  | Parameter | Value |
  | --- | --- |
  | Base score | 7.8 · High |
  | Exploitability score | - |
  | Impact score | - |

**Vector:** CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:N

## References

* [MITRE](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-6597)
* [NVD](https://nvd.nist.gov/vuln/detail/CVE-2023-6597)
* [Launchpad](https://launchpad.net/bugs/cve/CVE-2023-6597)
* [Debian](https://security-tracker.debian.org/tracker/CVE-2023-6597)

### Related Ubuntu Security Notices (USN)

+ [USN-6891-1](https://usn.ubuntu.com/USN-6891-1)
+ Python vulnerabilities
+ 11 July 2024

### Other references

* <https://seclists.org/oss-sec/2024/q1/240>
* <https://discuss.python.org/t/python-3-10-14-3-9-19-and-3-8-19-is-now-available/48993>
* <https://www.cve.org/CVERecord?id=CVE-2023-6597>
* <https://github.com/advisories/GHSA-797f-63wg-8chv>
