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

exploitDog

redhat логотип

CVE-2022-21658

Опубликовано: 20 янв. 2022
Источник: redhat
CVSS3: 5.3
EPSS Низкий

Описание

Rust is a multi-paradigm, general-purpose programming language designed for performance and safety, especially safe concurrency. The Rust Security Response WG was notified that the std::fs::remove_dir_all standard library function is vulnerable a race condition enabling symlink following (CWE-363). An attacker could use this security issue to trick a privileged program into deleting files and directories the attacker couldn't otherwise access or delete. Rust 1.0.0 through Rust 1.58.0 is affected by this vulnerability with 1.58.1 containing a patch. Note that the following build targets don't have usable APIs to properly mitigate the attack, and are thus still vulnerable even with a patched toolchain: macOS before version 10.10 (Yosemite) and REDOX. We recommend everyone to update to Rust 1.58.1 as soon as possible, especially people developing programs expected to run in privileged contexts (including system daemons and setuid binaries), as those have the highest risk of being affected by this. Note that adding checks in your codebase before calling remove_dir_all will not mitigate the vulnerability, as they would also be vulnerable to race conditions like remove_dir_all itself. The existing mitigation is working as intended outside of race conditions.

A race condition flaw was found in Rust's std::fs::remove_dir_all function. Rust applications that use this function may be vulnerable to a race condition where an unprivileged attacker can trick the application into deleting files and directories, causing an impact on system data integrity. If the application is privileged, an attacker can possibly delete files they would not usually have access to.

Отчет

This flaw has been given a Severity of Moderate because it is not exploitable at will on every Rust program as it requires a specific scenario where a privileged program uses a specific Rust stdlib function, the attacker has some knowledge of the program's file operations, and has the normal limitations and challenges of a Time-of-check to time-of-use (TOCTOU). It must also be carried out by an unprivileged attacker.

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

Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.

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

ПлатформаПакетСостояниеРекомендацияРелиз
Red Hat Developer Toolsrust-toolset-1.54-rustAffected
Red Hat Enterprise Linux 8stratisdWill not fix
Red Hat Enterprise Linux 9rustNot affected
Red Hat Enterprise Linux 9stratisdWill not fix
Red Hat OpenShift Container Platform 4kata-containersNot affected
Red Hat Enterprise Linux 8rust-toolsetFixedRHSA-2022:189410.05.2022

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

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

Статус:

Moderate
Дефект:
CWE-363
Дефект:
CWE-367
https://bugzilla.redhat.com/show_bug.cgi?id=2041504rust: Race condition in remove_dir_all leading to removal of files outside of the directory being removed

EPSS

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

5.3 Medium

CVSS3

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

CVSS3: 7.3
ubuntu
больше 3 лет назад

Rust is a multi-paradigm, general-purpose programming language designed for performance and safety, especially safe concurrency. The Rust Security Response WG was notified that the `std::fs::remove_dir_all` standard library function is vulnerable a race condition enabling symlink following (CWE-363). An attacker could use this security issue to trick a privileged program into deleting files and directories the attacker couldn't otherwise access or delete. Rust 1.0.0 through Rust 1.58.0 is affected by this vulnerability with 1.58.1 containing a patch. Note that the following build targets don't have usable APIs to properly mitigate the attack, and are thus still vulnerable even with a patched toolchain: macOS before version 10.10 (Yosemite) and REDOX. We recommend everyone to update to Rust 1.58.1 as soon as possible, especially people developing programs expected to run in privileged contexts (including system daemons and setuid binaries), as those have the highest risk of being aff...

CVSS3: 7.3
nvd
больше 3 лет назад

Rust is a multi-paradigm, general-purpose programming language designed for performance and safety, especially safe concurrency. The Rust Security Response WG was notified that the `std::fs::remove_dir_all` standard library function is vulnerable a race condition enabling symlink following (CWE-363). An attacker could use this security issue to trick a privileged program into deleting files and directories the attacker couldn't otherwise access or delete. Rust 1.0.0 through Rust 1.58.0 is affected by this vulnerability with 1.58.1 containing a patch. Note that the following build targets don't have usable APIs to properly mitigate the attack, and are thus still vulnerable even with a patched toolchain: macOS before version 10.10 (Yosemite) and REDOX. We recommend everyone to update to Rust 1.58.1 as soon as possible, especially people developing programs expected to run in privileged contexts (including system daemons and setuid binaries), as those have the highest risk of being affect

CVSS3: 7.3
debian
больше 3 лет назад

Rust is a multi-paradigm, general-purpose programming language designe ...

suse-cvrf
больше 3 лет назад

Security update for rust, rust1.58, rust1.59

suse-cvrf
больше 3 лет назад

Security update for rust

EPSS

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

5.3 Medium

CVSS3