CVE-2026-12345
The cleanup of tempfile.TemporaryDirectory is vulnerable to a race condition. An attacker who can modify the tree during cleanup can replace a directory with a symbolic link, causing files outside of the temporary directory to be deleted or have their permissions and file flags reset, with the privileges of the process performing the cleanup. Note that platforms where shutil.rmtree.avoids_symlink_attacks is false, remain affected, and file flags may still be reset outside of the tree on all platforms.
CVSS
- Version: 4.0
- Vector: CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
- Base score: 5.9
Exploitation probability (EPSS)
- Probability of exploitation in the next 30 days: 0.18%
- Percentile among all scored CVEs: 7
- Score date: 9/30/2026
EPSS (Exploit Prediction Scoring System, FIRST) estimates how likely a vulnerability is to be exploited in the wild within 30 days. It complements CVSS (impact) and CISA KEV (confirmed exploitation).
Affected technologies (1)
⚠ AI-inferred from the description — NVD hasn't analyzed this CVE yet, these aren't verified CPEs.
CWEs
- CWE-59
References
- https://github.com/python/cpython/commit/458e7134a5af7f86aee9d21b51cf499b41aa4420
- https://github.com/python/cpython/commit/5c20517a4fc56683efe63a7751020db9573f538d
- https://github.com/python/cpython/commit/e1f3590f155c6d66007e958c98c9d69316551993
- https://github.com/python/cpython/issues/157579
- https://github.com/python/cpython/pull/157580
- http://www.openwall.com/lists/oss-security/2026/09/29/40
Raw JSON (NVD)
Show
{
"id": "CVE-2026-12345",
"cveTags": [],
"metrics": {
"ssvcV203": [
{
"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
"ssvcData": {
"id": "CVE-2026-12345",
"role": "CISA Coordinator",
"options": [
{
"exploitation": "none"
},
{
"automatable": "no"
},
{
"technicalImpact": "partial"
}
],
"version": "2.0.3",
"timestamp": "2026-09-29T18:38:00.590353Z"
}
}
],
"cvssMetricV40": [
{
"type": "Secondary",
"source": "cna@python.org",
"cvssData": {
"Safety": "NOT_DEFINED",
"version": "4.0",
"Recovery": "NOT_DEFINED",
"baseScore": 5.9,
"Automatable": "NOT_DEFINED",
"attackVector": "LOCAL",
"baseSeverity": "MEDIUM",
"valueDensity": "NOT_DEFINED",
"vectorString": "CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
"exploitMaturity": "NOT_DEFINED",
"providerUrgency": "NOT_DEFINED",
"userInteraction": "NONE",
"attackComplexity": "LOW",
"attackRequirements": "PRESENT",
"privilegesRequired": "NONE",
"subIntegrityImpact": "NONE",
"vulnIntegrityImpact": "HIGH",
"integrityRequirement": "NOT_DEFINED",
"modifiedAttackVector": "NOT_DEFINED",
"subAvailabilityImpact": "NONE",
"vulnAvailabilityImpact": "HIGH",
"availabilityRequirement": "NOT_DEFINED",
"modifiedUserInteraction": "NOT_DEFINED",
"modifiedAttackComplexity": "NOT_DEFINED",
"subConfidentialityImpact": "NONE",
"vulnConfidentialityImpact": "NONE",
"confidentialityRequirement": "NOT_DEFINED",
"modifiedAttackRequirements": "NOT_DEFINED",
"modifiedPrivilegesRequired": "NOT_DEFINED",
"modifiedSubIntegrityImpact": "NOT_DEFINED",
"modifiedVulnIntegrityImpact": "NOT_DEFINED",
"vulnerabilityResponseEffort": "NOT_DEFINED",
"modifiedSubAvailabilityImpact": "NOT_DEFINED",
"modifiedVulnAvailabilityImpact": "NOT_DEFINED",
"modifiedSubConfidentialityImpact": "NOT_DEFINED",
"modifiedVulnConfidentialityImpact": "NOT_DEFINED"
}
}
]
},
"affected": [
{
"source": "cna@python.org",
"affectedData": [
{
"repo": "https://github.com/python/cpython",
"vendor": "Python Software Foundation",
"modules": [
"tempfile"
],
"product": "CPython",
"versions": [
{
"status": "affected",
"version": "0",
"lessThan": "3.12.15",
"versionType": "python"
},
{
"status": "affected",
"version": "3.13.0a1",
"lessThan": "3.15.0",
"versionType": "python"
}
],
"defaultStatus": "unaffected"
}
]
}
],
"published": "2026-09-29T18:17:14.707",
"references": [
{
"url": "https://github.com/python/cpython/commit/458e7134a5af7f86aee9d21b51cf499b41aa4420",
"source": "cna@python.org"
},
{
"url": "https://github.com/python/cpython/commit/5c20517a4fc56683efe63a7751020db9573f538d",
"source": "cna@python.org"
},
{
"url": "https://github.com/python/cpython/commit/e1f3590f155c6d66007e958c98c9d69316551993",
"source": "cna@python.org"
},
{
"url": "https://github.com/python/cpython/issues/157579",
"source": "cna@python.org"
},
{
"url": "https://github.com/python/cpython/pull/157580",
"source": "cna@python.org"
},
{
"url": "http://www.openwall.com/lists/oss-security/2026/09/29/40",
"source": "af854a3a-2127-422b-91ae-364da2661108"
}
],
"vulnStatus": "Awaiting Analysis",
"weaknesses": [
{
"type": "Secondary",
"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
"description": [
{
"lang": "en",
"value": "CWE-59"
}
]
}
],
"descriptions": [
{
"lang": "en",
"value": "The cleanup of tempfile.TemporaryDirectory is vulnerable to a race condition. An attacker who can modify the tree during cleanup can replace a directory with a symbolic link, causing files outside of the temporary directory to be deleted or have their permissions and file flags reset, with the privileges of the process performing the cleanup. Note that platforms where shutil.rmtree.avoids_symlink_attacks is false, remain affected, and file flags may still be reset outside of the tree on all platforms."
}
],
"lastModified": "2026-09-30T23:16:59.127",
"sourceIdentifier": "cna@python.org"
}