Логотип exploitDog
Консоль
Логотип exploitDog

exploitDog

redhat логотип

CVE-2026-12345

Опубликовано: 29 сент. 2026
Источник: redhat
CVSS3: 6.3
EPSS Низкий

Описание

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.

A flaw was found in Python. A race condition during the cleanup of temporary directories allows a local attacker with write access to replace a directory with a symbolic link (a reference pointing to another location). This can lead to unauthorized deletion or alteration of files outside the temporary directory, performed with the privileges of the process executing the cleanup.

Отчет

This vulnerability is rated as Moderate severity rather than Important because successful exploitation requires local system access, existing permissions to manipulate the target directory structure, and winning a narrow timing window during deletion. In Red Hat Enterprise Linux environments, standard temporary directory creation restricts access to the executing user, significantly limiting exposure to unprivileged local attackers. Applications running with elevated privileges that operate on shared or world-writable directories are at risk of unintended target file removal or permission tampering.

Меры по смягчению последствий

To mitigate this issue, ensure kernel symlink protection is enabled (active by default in RHEL) by verifying sysctl fs.protected_symlinks is set to 1. Additionally, restrict exposure on shared systems by setting the TMPDIR environment variable to a secure, user-private directory rather than a public shared path (e.g., export TMPDIR=/path/to/private_tmp).

Затронутые пакеты

ПлатформаПакетСостояниеРекомендацияРелиз
Red Hat Enterprise Linux 10python3.14Fix deferred
Red Hat Enterprise Linux 6pythonOut of support scope
Red Hat Enterprise Linux 7pythonFix deferred
Red Hat Enterprise Linux 7python3Fix deferred
Red Hat Enterprise Linux 8python3.12Fix deferred
Red Hat Enterprise Linux 8python36:3.6/python36Fix deferred
Red Hat Enterprise Linux 9python3.12Fix deferred
Red Hat Enterprise Linux 9python3.14Fix deferred
Red Hat Enterprise Linux AI (RHEL AI) 3rhelai3/bootc-aws-cuda-rhel9Fix deferred
Red Hat Enterprise Linux AI (RHEL AI) 3rhelai3/bootc-azure-cuda-rhel9Fix deferred

Показывать по

Дополнительная информация

Статус:

Moderate
Дефект:
CWE-59
https://bugzilla.redhat.com/show_bug.cgi?id=2543492python: python: Arbitrary file deletion via race condition during temporary directory cleanup

EPSS

Процентиль: 28%
0.00344
Низкий

6.3 Medium

CVSS3

Связанные уязвимости

ubuntu
около 2 месяцев назад

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.

nvd
около 2 месяцев назад

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.

msrc
около 1 месяца назад

Race condition in tempfile.TemporaryDirectory cleanup allows deleting files outside the temporary directory

debian
около 2 месяцев назад

The cleanup of tempfile.TemporaryDirectory is vulnerable to a race con ...

rocky
6 дней назад

Moderate: python3.12 security, bug fix, and enhancement update

EPSS

Процентиль: 28%
0.00344
Низкий

6.3 Medium

CVSS3