llamaCVEVulnerability Intelligence
/
Advisory · GitHub · crates.io · coreutils

GHSA-54X6-C4C8-44FR

`install` fd-based copy path creates the destination `0666` and without `O_EXCL`

Parche disponible
Descargar PNG JSON
CVSS 3.1
5.0
Media
CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche1 versiónPrimer parche el mismo día de la divulgación
Exposición64 dDesde la divulgación, 17 sept 2026, 2:36 p. m.
Detección64 dDesde la divulgación hasta su ingreso al índice
Decisión estimadaSeguir
Remediar en la ventana regular de mantenimiento
Estimación de Llama con el árbol SSVC de CISA a partir de vector CVSS 3.1 y la evidencia de explotación (sin evaluación oficial): sin explotación conocida, no automatizable e impacto técnico parcial. Hay versiones corregidas disponibles.
Hoy toca mantenimiento, no heroísmo.Parche en la próxima ventana y listo, campeón.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Parche 0.12.0
Monitoreo
Detectada +1
17 sept 26
21 nov 26
17 sept 26
4 oct 26
20 oct 26
5 nov 26
21 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-54X6-C4C8-44FR divulgada · CVSS 5 (GitHub)
Remediación Parche 0.12.0 coreutils · 0 d desde divulgación
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

Hi, @sylvestre

`install` has two copy implementations that are documented as equivalent. The path-based one is deliberately hardened:

let mut dest = OpenOptions::new()
    .write(true)
    .create_new(true)   // O_EXCL
    .mode(0o600)        // no exposure window
    .open(to)?;

The fd-based one — reached by `install -D SRC DST`, the form used pervasively by packaging Makefiles, it protection is strictly weaker:

// src/uu/install/src/install.rs:966-968 — copy_file_safe()
let mut src = File::open(from)?;
let mut dst = to_parent_fd.open_file_at(to_filename)?;
copy_fast(&mut src, &mut dst)?;
// src/uucore/src/lib/features/safe_traversal.rs:465-472 — open_file_at()
let flags = OFlag::O_CREAT | OFlag::O_WRONLY | OFlag::O_TRUNC
          | OFlag::O_CLOEXEC | OFlag::O_NOFOLLOW;
let mode = Mode::from_bits_truncate(0o666); // Default file permissions

Two distinct weaknesses follow.

(a) Permission-exposure window. `install -m 600 secret.key /etc/…` creates the file with mode `0666 and ~umask` (typically `0644`), writes the secret content into it, and only afterwards chmods it to `0600`. Any local user can read the secret during the copy. This is exactly the defect `uucore::safe_copy` was written to prevent:

> `DEST_INITIAL_MODE` = `0o600` — "ensures no other user can open the file during the copy, see issue #10011"

Also The fd-based path bypasses that module entirely.

(b) Hard-link planting race. The caller unlinks the target and then opens with `O_CREAT|O_TRUNC`:

// src/uu/install/src/install.rs:791-800
if let Err(e) = parent_fd.unlink_at(filename.as_os_str(), false) ...
copy_file_safe(source, parent_fd, filename.as_os_str())?;

`O_NOFOLLOW` blocks symlinks but does not block hard links. An attacker with write access to the target directory can plant a hard link to a victim file in that window. `install` running as root then truncates and overwrites the victim file, and F-04 below proceeds to `chown`/`chmod` it to the requested owner and mode. `create_new(true)` in the sibling function closes precisely this hole by failing if the name exists.

the impact is Disclosure of secrets installed with restrictive modes to the attacker-writable target directory, arbitrary file overwrite plus the attacker chosen ownership and mode that leads by example to local privilege escalation when `install -D` is run as root common in `make install` and packaging.

To fix that:

  • Add an `O_EXCL` variant of `DirFd::open_file_at()` and a create mode of `0o600`, matching `safe_copy::DEST_INITIAL_MODE`.
  • Or route the impl trought `copy_file_safe()` through `safe_copy::create_dest_restrictive()` so both paths share one implementation. That is the duplication noted in the code comment at the following location `install.rs:947-950` is the root cause of the vuln.
Vector CVSS 3.1

Desglose de métricas

Opción resaltada = valor del vector · izquierda = peor caso · GitHub
Vector de ataqueAV:L
RedAdyacenteLocalFísica
ComplejidadAC:L
BajaAlta
PrivilegiosPR:L
NingunoBajosAltos
InteracciónUI:R
NingunaRequerida
AlcanceS:U
CambiadoSin cambio
ConfidencialidadC:H
AltoBajoNinguno
IntegridadI:N
AltoBajoNinguno
DisponibilidadA:N
AltoBajoNinguno
Score de explotaciónQué tan fácil y probable es que la exploten
5.3/ 10Medio
Vector 5.3 (moderada) · sin evidencia de explotación.
Versiones

Rangos afectados

Afectada Corregida Última
coreutils≤ 0.11.0
0.11.0
0.12.0
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
crates.iocoreutils
Corregida 0.12.0 0 d 0.12.0 no afectada
Versiones corregidas0.12.0
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://github.com/uutils/coreutils/security/advisories/GHSA-54x6-c4c8-44fr

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.