Skip to main content
Mallory
HighVulnerability

CVE-2023-6597: Symlink-following permission modification in CPython TemporaryDirectory cleanup

Published Mar 19, 2024 · Updated 1 month ago
Trending this weekNot trendingOutside this week’s top 100
Mention activity · 30 daysNo mention activity in the last 30 days.
CVSS7.8High · v3.1
EPSS0.39%24th percentile
CISA KEVNoNot listed
In the wildNoneNo exploitation reported
Vendor
Python Software Foundation
IdentifiersCVE-2023-6597CWE-59

CVE-2023-6597 is a symlink-handling vulnerability in CPython's tempfile.TemporaryDirectory cleanup logic. When recursive deletion encounters a permission-related error, the _rmtree error handler can call os.chmod with mode 0700 on a symbolic link. Because this operation follows symbolic links, it can change the permissions of the target file, including files outside the temporary directory. An attacker who can influence temporary-directory contents processed by a higher-privileged Python program may cause unauthorized permission changes. Affected releases include Python 3.12.1, 3.11.7, 3.10.13, 3.9.18, 3.8.18, and earlier releases in those branches.

Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Analyst brief

Impact, mitigation & remediation

What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation can cause a privileged Python process to reset permissions on an attacker-selected symlink target to 0700, crossing the intended temporary-directory boundary. This can compromise filesystem access controls and potentially enable confidentiality or integrity violations, depending on target ownership and application behavior. It does not inherently grant the attacker ownership, arbitrary file contents modification, or code execution. Without sufficient process privileges to change the target's permissions, cleanup may instead fail and leave temporary files behind.

Mitigation

If you can’t patch tonight, do this now.

Until an update is installed, avoid processing attacker-controlled temporary-directory trees or extracting untrusted archives with symbolic links in privileged Python processes. Run such processing with the minimum necessary filesystem privileges. A code-level workaround is to use follow_symlinks=False for permission and flag changes where supported, and otherwise avoid applying those operations to symbolic links.

Remediation

Patch, then assume compromise.

Upgrade to Python 3.12.2, 3.11.8, 3.10.14, 3.9.19, or 3.8.19, or a later fixed release in the corresponding branch. Alternatively, install the operating-system vendor's backported security update. Fixed Debian packages include python3.7 3.7.3-2+deb10u7 for Debian 10, python3.9 3.9.2-1+deb11u2 for Debian 11, and pypy3 7.3.5+dfsg-2+deb11u3 for Debian 11. For affected container deployments, update the base image and rebuild and redeploy dependent images. The code fix prevents symlink dereferencing during permission-error recovery.

Public exploits

Exploits

No public exploits tracked yet. Mallory keeps watching.

View more in app →
No public exploit code observed for this vulnerability. Mallory keeps watching.
Exposure surface

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
Python Software FoundationCpythonapplication
FAQ

Frequently asked questions

Is CVE-2023-6597 exploited in the wild?
As of Oct 22, 2026, Mallory has no reports of CVE-2023-6597 being exploited in the wild. It is not listed in CISA KEV.
Is there a public exploit for CVE-2023-6597?
As of Oct 22, 2026, Mallory has found no public exploit for CVE-2023-6597.
Is there a patch for CVE-2023-6597?
Upgrade to Python 3.12.2, 3.11.8, 3.10.14, 3.9.19, or 3.8.19, or a later fixed release in the corresponding branch. Alternatively, install the operating-system vendor's backported security update.
What products are affected by CVE-2023-6597?
Python Software Foundation Cpython.
How severe is CVE-2023-6597?
CVE-2023-6597 has a CVSS v3.1 score of 7.8 (High) and an EPSS score of 0.39% (24th percentile) as of Oct 22, 2026.
Activity feed

Recent activity

64 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.

View more in app →
tenable nessus pluginsNews · Oct 21, 2026Unity Linux 20.1070a Security Update: python3.11 (UTSA-2026-14... | Tenable®A local vulnerability in CPython's tempfile.TemporaryDirectory cleanup permits unintended permission changes to files referenced by symbolic links under certain privileged-execution conditions. The advisory identifies affected CPython releases as 3.12.1, 3.11.7, 3.10.13, 3.9.18, 3.8.18 and prior. The Unity Linux advisory provides a python3.11 security update. Nessus identifies exposure using the application's self-reported version rather than testing exploitation. The plugin reports high severity and a CVSS v3 base score of 7.8.Read more ↗tenable nessus pluginsNews · Oct 1, 2026AlmaLinux 9.2 [TuxCare] Security Update: python3.11 / python3.... | Tenable®A locally exploitable vulnerability tracked as CVE-2023-6597, affecting the Alma Linux package/update addressed by CLSA-2025-1740479778. The supplied metadata indicates high confidentiality and integrity impact with changed scope, but high attack complexity and no availability impact.Read more ↗tenable nessus pluginsNews · Sep 30, 2026CentOS Linux 7 [TuxCare] Security Update: python3 / python3-de... | Tenable®An Important-severity vulnerability addressed by a TuxCare CentOS 7 live-security advisory (CLSA-2024-1720548714). The supplied CVSS v3 vector indicates a local attack with high complexity, no privileges or user interaction required, changed scope, and high confidentiality and integrity impact.Read more ↗redhat accessNews · Jan 1, 2026RHSA-2025:0650 - Security Advisory - Red Hat Customer PortalA path-traversal vulnerability in Python's tempfile.TemporaryDirectory component, fixed in the OpenShift Container Platform 4.16.32 update.Read more ↗
+55 more in the timeline. Sign up to see them
Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Mallory platform

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, and which detections to deploy tonight.
Exposure mappingQuery your assets running an affected version, and investigate the blast radius.
Threat actor evidenceEvery report linking this CVE to a named adversary.
Associated malwareMalware families linked to this CVE, with evidence and IOCs.
Detection signaturesYARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Vendor-by-vendor mappingCross-references every affected SKU, including bundled OEM variants.
Social activity1Community discussion across Reddit, Mastodon, and other social sources.