CVE Catalog

CVE-2026-12345

MediumCVSS 5.9
Published: Updated: Translated: NVD NIST

Exploitation Probability (EPSS)

Low risk
0.34%

28th percentile - higher than 28% of all known CVEs

Summary

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.

Risk Assessment

Files outside the temporary directory may be deleted or modified, potentially leading to data loss or privilege escalation. The risk is particularly high in multi-user environments.

Recommendation

Update the tempfile library to a version containing the fix. Avoid using tempfile.TemporaryDirectory in environments where an attacker can modify the directory tree.

Related vulnerabilities

Original NVD description (English source)

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.

Vulnerability data from NVD (NIST) · CISA KEV · EPSS