Skip to content

install: TOCTOU symlink race (unlink-then-create without O_EXCL) allows arbitrary file overwrite

High
sylvestre published GHSA-239g-2685-54x3 May 30, 2026

Package

cargo uu_install (Rust)

Affected versions

< 0.6.0

Patched versions

0.6.0

Description

copy_file in install/src/install.rs removes the destination then recreates it by pathname via File::create / fs::copy without O_EXCL/create_new. Between the unlink and the recreate, a local attacker with write access to the destination directory can drop in a symlink and redirect the write.

Impact: when install runs privileged into an attacker-writable directory (staging/build paths), the race allows redirecting writes to arbitrary files and overwriting sensitive system files (/etc/passwd, /etc/shadow). Recommendation: create atomically with create_new/O_EXCL and copy via the opened fd rather than reopening by path.

Remediation: Acknowledged by Canonical; fixed in commit b5bbabc.


Reported by Zellic in the uutils coreutils Program Security Assessment (prepared for Canonical, Jan 20 2026), audited commit 3a07ffc5a9bd4c283e75afa548ba1f1957bad242. Finding 3.50. Credit: Zellic.

Severity

High

CVE ID

CVE-2026-35355

Weaknesses

Improper Link Resolution Before File Access ('Link Following')

The product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. Learn more on MITRE.

Time-of-check Time-of-use (TOCTOU) Race Condition

The product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check. Learn more on MITRE.