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

GHSA-H85F-WCQC-8JF9

cp: a symlinked destination is followed (no O_NOFOLLOW), writing outside the destination tree

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:N/I:H/A:N Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche1 versiónPrimer parche a -3 d de la divulgación
Exposición105 dDesde la divulgación, 8 ago 2026, 3:13 a. m.
Detección104 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.
Si haces parches mensuales, ya estás cubierto.Si tu inventario está al día, ya ganaste.
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
8 ago 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_cp · -3 d desde divulgación
Divulgación Publicada GHSA-H85F-WCQC-8JF9 divulgada · CVSS 5 (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

During a recursive copy, uutils treats a destination subdirectory that is actually a symlink as an existing directory (path-based `.exists()` at `copydir.rs:282`) and writes through it, instead of refusing as GNU does (GNU follows destination directory symlinks only under `--keep-directory-symlink`).

Verified: with `dst/hooks -> outside` preexisting, `cp -a src/. dst` wrote `src/hooks/*` into the off-tree `outside/`; GNU did not.

Impact: an attacker who can pre-place a symlink in a destination tree can redirect a privileged recursive `cp` to write attacker-influenced content outside the intended destination. Fix: detect destination subdirectory symlinks via `symlink_metadata()` and refuse (or honor `--keep-directory-symlink` semantics like GNU).

Same root cause, single-file data-write open: every `cp` platform copy hardcodes `create_dest_restrictive(dest, false)` (`src/uu/cp/src/platform/linux.rs`, `other_unix.rs`), so the destination is opened without `O_NOFOLLOW`; `mv` correctly passes `true` (`src/uu/mv/src/mv.rs:1311`), and `safe_copy.rs` documents the risk. Reported separately as draft GHSA-95x2-59mg-f69w (no CVE) — a duplicate of this finding.

---
_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

Fixed in 0.10.0 (released 2026-08-05), commit `e05072e26`, https://github.com/uutils/coreutils/pull/13624 (merged 2026-07-28).

Root cause: `copy_direntry` tested the destination with `exists()`, which resolves symlinks, so a destination entry that was itself a symlink to a directory looked like an already-existing directory and was descended into.

Re-confirmed on `0.9.0-575-g0d02663c6`:

$ mkdir -p src/hooks dst outside && echo PAYLOAD > src/hooks/evil
$ ln -s "$PWD/outside" dst/hooks
$ cp -a src/. dst
GNU 9.10 : cp: cannot overwrite non-directory 'dst/./hooks' with directory 'src/./hooks'  (exit 1)
uutils   : exit 0 -- outside/evil == PAYLOAD, escaped the destination tree

The fix treats a symlink at the destination as the non-directory it is, matching GNU. A symlinked directory named as the *target* itself stays allowed; only entries discovered inside the tree are refused. Both behaviours are pinned by tests.

Correction affecting the related draft GHSA-vwj2-hp86-chj8

The single-file destination open (`create_dest_restrictive(dest, false)`, no `O_NOFOLLOW`) is not part of this defect. Measured against GNU 9.10:

$ ln -s victim/file out/dest ; cp src out/dest
GNU 9.10 : exit 0 -- victim/file == NEW   (writes through the symlink)
uutils   : exit 0 -- victim/file == NEW   (identical)

Following a symlinked file destination is GNU's documented behaviour, which is why `cp` passes `nofollow = false` while `mv` passes `true`. Flipping the flag would be a GNU-compatibility regression, not a fix.

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: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
uu_cp≤ 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_cp
Corregida 0.10.0 -3 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-h85f-wcqc-8jf9

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