← Back to CVE Explorer

CVE-2026-12345

Full vulnerability record from the local CVENow database.

Description

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.

Severity
MEDIUM
CVSS score
5.9 (v4.0)
Vulnerability status
Awaiting Analysis
Source identifier
Published
2026-09-29 18:17:14.707000
Last modified
2026-10-26 01:17:15.940000
View original CVE JSON
{
  "id": "CVE-2026-12345",
  "sourceIdentifier": "[email protected]",
  "published": "2026-09-29T18:17:14.707",
  "lastModified": "2026-10-26T01:17:15.940",
  "vulnStatus": "Awaiting Analysis",
  "cveTags": [],
  "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."
    }
  ],
  "affected": [
    {
      "source": "[email protected]",
      "affectedData": [
        {
          "vendor": "Python Software Foundation",
          "product": "CPython",
          "defaultStatus": "unaffected",
          "modules": [
            "tempfile"
          ],
          "repo": "https://github.com/python/cpython",
          "versions": [
            {
              "version": "0",
              "lessThan": "3.12.15",
              "versionType": "python",
              "status": "affected"
            },
            {
              "version": "3.13.0",
              "lessThan": "3.13.18",
              "versionType": "python",
              "status": "affected"
            },
            {
              "version": "3.14.0",
              "lessThan": "3.14.9",
              "versionType": "python",
              "status": "affected"
            },
            {
              "version": "3.15.0a1",
              "lessThan": "3.15.0rc3",
              "versionType": "python",
              "status": "affected"
            }
          ]
        }
      ]
    }
  ],
  "metrics": {
    "cvssMetricV40": [
      {
        "source": "[email protected]",
        "type": "Secondary",
        "cvssData": {
          "version": "4.0",
          "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",
          "baseScore": 5.9,
          "baseSeverity": "MEDIUM",
          "attackVector": "LOCAL",
          "attackComplexity": "LOW",
          "attackRequirements": "PRESENT",
          "privilegesRequired": "NONE",
          "userInteraction": "NONE",
          "vulnConfidentialityImpact": "NONE",
          "vulnIntegrityImpact": "HIGH",
          "vulnAvailabilityImpact": "HIGH",
          "subConfidentialityImpact": "NONE",
          "subIntegrityImpact": "NONE",
          "subAvailabilityImpact": "NONE",
          "exploitMaturity": "NOT_DEFINED",
          "confidentialityRequirement": "NOT_DEFINED",
          "integrityRequirement": "NOT_DEFINED",
          "availabilityRequirement": "NOT_DEFINED",
          "modifiedAttackVector": "NOT_DEFINED",
          "modifiedAttackComplexity": "NOT_DEFINED",
          "modifiedAttackRequirements": "NOT_DEFINED",
          "modifiedPrivilegesRequired": "NOT_DEFINED",
          "modifiedUserInteraction": "NOT_DEFINED",
          "modifiedVulnConfidentialityImpact": "NOT_DEFINED",
          "modifiedVulnIntegrityImpact": "NOT_DEFINED",
          "modifiedVulnAvailabilityImpact": "NOT_DEFINED",
          "modifiedSubConfidentialityImpact": "NOT_DEFINED",
          "modifiedSubIntegrityImpact": "NOT_DEFINED",
          "modifiedSubAvailabilityImpact": "NOT_DEFINED",
          "Safety": "NOT_DEFINED",
          "Automatable": "NOT_DEFINED",
          "Recovery": "NOT_DEFINED",
          "valueDensity": "NOT_DEFINED",
          "vulnerabilityResponseEffort": "NOT_DEFINED",
          "providerUrgency": "NOT_DEFINED"
        }
      }
    ],
    "ssvcV203": [
      {
        "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
        "ssvcData": {
          "timestamp": "2026-09-29T18:38:00.590353Z",
          "id": "CVE-2026-12345",
          "options": [
            {
              "exploitation": "none"
            },
            {
              "automatable": "no"
            },
            {
              "technicalImpact": "partial"
            }
          ],
          "role": "CISA Coordinator",
          "version": "2.0.3"
        }
      }
    ]
  },
  "weaknesses": [
    {
      "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
      "type": "Secondary",
      "description": [
        {
          "lang": "en",
          "value": "CWE-59"
        }
      ]
    }
  ],
  "references": [
    {
      "url": "https://github.com/python/cpython/commit/0478b52788117db4b831b3efd648f56b777628aa",
      "source": "[email protected]"
    },
    {
      "url": "https://github.com/python/cpython/commit/06ef3d43fdaf4da97af12fa694b4886092c4b970",
      "source": "[email protected]"
    },
    {
      "url": "https://github.com/python/cpython/commit/458e7134a5af7f86aee9d21b51cf499b41aa4420",
      "source": "[email protected]"
    },
    {
      "url": "https://github.com/python/cpython/commit/58ed0259cae509a19138795df302fe60b544dc74",
      "source": "[email protected]"
    },
    {
      "url": "https://github.com/python/cpython/commit/5c20517a4fc56683efe63a7751020db9573f538d",
      "source": "[email protected]"
    },
    {
      "url": "https://github.com/python/cpython/commit/c39b52d00b42200aaadff679e2fe3f1006d57c58",
      "source": "[email protected]"
    },
    {
      "url": "https://github.com/python/cpython/commit/e1f3590f155c6d66007e958c98c9d69316551993",
      "source": "[email protected]"
    },
    {
      "url": "https://github.com/python/cpython/issues/157579",
      "source": "[email protected]"
    },
    {
      "url": "https://github.com/python/cpython/pull/157580",
      "source": "[email protected]"
    },
    {
      "url": "http://www.openwall.com/lists/oss-security/2026/09/29/40",
      "source": "af854a3a-2127-422b-91ae-364da2661108"
    }
  ]
}