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

GHSA-PP2G-C3J7-J725

mv: cross-device (EXDEV) directory fallback removes then path-recreates the destination (symlink race)

Parche disponible
Descargar PNG JSON
CVSS 3.1
6.6
Media
CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:H Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche1 versiónPrimer parche a -35 d de la divulgación
Exposición73 dDesde la divulgación, 9 sept 2026, 1:15 a. m.
Detección72 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.
Agenda, parchea y celebra con un mate.Esta la tienes controlada, confío en ti.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Parche 0.10.0
Monitoreo
Detectada +1
5 ago 26
9 sept 26
21 nov 26
5 ago 26
1 sept 26
28 sept 26
25 oct 26
21 nov 26
FechaFaseEventoDetalle
Remediación Parche 0.10.0 uu_mv · -35 d desde divulgación
Divulgación Publicada GHSA-PP2G-C3J7-J725 divulgada · CVSS 6.6 (GitHub)
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

`mv`'s cross-filesystem fallback for directories (`rename_dir_fallback`, `mv.rs:1028`) does `fs::remove_dir_all(to)` then recreates and populates the destination with path-based `fs::create_dir_all`/`fs::copy`. Between the removal and the recreate, an attacker with write access to the destination's parent can plant a symlink; the subsequent path-based copy follows it, writing off-tree, and the source is then deleted.

Verified (code, current HEAD): the directory fallback still uses the remove-then-path-recreate pattern. The single-file fallback (now O_NOFOLLOW `safe_copy`, `515d74b99`) and the symlink fallback (temp + `renameat`) were hardened -- the directory path was not. Relates to CVE-2026-35364 (Zellic), whose fix covered the file path only.

Impact: a privileged cross-device `mv` into an attacker-writable parent can be redirected to overwrite arbitrary files and deletes the source. Fix: apply the same fd-anchored / no-unlink-then-path-recreate approach used for the single-file and symlink paths.

---
_Source: Cantina audit (2026-05-03). Independently verified 2026-05-30 against uutils/coreutils `e0ad63471` with a sandboxed PoC; GNU coreutils 9.7 used as control. See cantina-report/VERIFICATION-2026-05-30.md._

---

Fix and measurement (2026-07-29)

Branch https://github.com/sylvestre/coreutils/tree/mv-cross-device-dir-fail-closed replaces `fs::create_dir_all` with a fail-closed `fs::create_dir` at the top-level destination and for each subdirectory, so a path that reappeared between the removal and the recreate is refused with `EEXIST` rather than followed.

This is the most easily exploited issue of the cluster — effectively deterministic, not a narrow race. The racer is a tight `symlink(victim, dest)` loop, which only succeeds while `dest` does not exist, i.e. exactly the window described above. 30 rounds of a cross-device `mv -T srcdir dest`, counting rounds where the source files landed inside an off-tree victim directory:

| build | rounds that wrote off-tree |
|---|---|
| uutils `0.9.0-575` (before) | 30/30 |
| uutils with this fix | 0/30 |
| GNU coreutils 9.10 | 0/30 |

This is a genuine GNU divergence: GNU never wrote off-tree in any round.

Also observed: pre-planted symlink destination diverges from GNU

Independent of the race, with `dest` already a symlink to a directory before `mv` starts:

$ mv -T <srcdir on tmpfs> dest        # dest -> victim/
GNU 9.10 : mv: cannot overwrite non-directory 'dest' with directory 'srcdir'   (exit 1, symlink intact)
uutils   : exit 0 — the symlink is replaced by a real directory

No off-tree write occurs there, so it is a compatibility divergence rather than a security issue, and this fix does not change it.

Verified not to regress

Destination-absent, `mv srcdir existingdir/`, and `-T` onto an existing empty directory all still behave as before and match GNU. 126/126 mv tests pass, plus a regression test mirroring the existing file-level `test_mv_cross_device_refuses_planted_symlink_dest` for the directory case.

Scope

The recursive copy is still path-derived (`to_dir.join(name)` per child) rather than anchored to a directory fd. This closes the destination-recreate hole without making the whole walk fd-safe; `create_dir_all_safe` in `uucore::safe_traversal` is the primitive for that follow-up.

Open PR #13334 covers the *file* and special-file destroy-before-create ordering and does not touch the directory fallback, so the two changes do not overlap.

Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.

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:N
AltoBajoNinguno
IntegridadI:H
AltoBajoNinguno
DisponibilidadA:H
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
uu_mv≤ 0.9.0
0.9.0
0.12.0
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
crates.iouu_mv
Corregida 0.10.0 -35 d 0.12.0 no afectada
Versiones corregidas0.10.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-pp2g-c3j7-j725

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