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

GHSA-C24X-H627-MPRH

sort writes its temporary files with the umask, so other local users can read the data being sorted

Sin parche publicado
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
ParcheSin parcheEl fabricante no ha publicado corrección
Exposición16 dDesde la divulgación, 5 nov 2026, 2:35 a. m.
Detección15 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. No hay versión corregida: aplique mitigaciones.
Nivel de alerta: llama mascando hierba.Si tu inventario está al día, ya ganaste.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Monitoreo
Detectada +1
5 nov 26
21 nov 26
5 nov 26
9 nov 26
13 nov 26
17 nov 26
21 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-C24X-H627-MPRH 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
Summary

When its input does not fit in memory, `sort` writes sorted chunks to temporary files under `TMPDIR`, by default `/tmp`, and merges them at the end. uutils creates the temporary directory with `create_dir` and each chunk with `File::create`, so both get the process umask: 0755 and 0644 under the usual 022. Every local user can read the chunks, which are the input in sorted pieces, for as long as the sort runs, and afterwards if the run is interrupted. GNU coreutils creates each temporary file with `mkstemp`, mode 0600, and the contents are private to the user.

Details

`src/uu/sort/src/tmp_dir.rs:116-118` creates the directory:

            tempfile::Builder::new()
                .prefix("uutils_sort")
                .tempdir_in(&self.parent_path)

`tempfile`'s directory builder uses the default `create_dir` mode unless `.permissions()` is given, so the directory is 0777 masked by the umask. Each chunk is then opened at `tmp_dir.rs:149`:

            File::create(&path).map_err(|error| SortError::OpenTmpFileFailed { error })?,

which is 0666 masked by the umask. Neither call restricts the mode. With `--compress-program` the chunk file is handed to the program as its stdout, so the same mode applies to compressed chunks.

GNU's `sort.c` opens temporaries through `mkostemp`, which creates them 0600 regardless of the umask, directly in `TMPDIR`.

Suggested fix. Give the directory `.permissions(Permissions::from_mode(0o700))` in the builder, and open chunks with `OpenOptions::new().write(true).create_new(true).mode(0o600)`. A 0700 directory alone already closes the exposure; restricting the files as well protects a directory whose mode is later relaxed.

PoC

Verified on 0.11.0, source `bf65901e1ed82963436844c2cf8e796ba9158c65` (2026-08-30), the current release; first observed on 0.9.0 (`f66e155d8`, 2026-07-27) with identical output. Ubuntu 24.04.2 LTS, Linux 6.8.0 x86_64. Console output captured with `LANG=C`, `sort` resolving to uutils. `TMPDIR` is set to a scratch directory only to keep the listing short; the default is `/tmp`. `-S 64K` makes a modest input spill; without it any input larger than the buffer, a few hundred megabytes by default, behaves the same. Sort's output is sent into a pipe that nobody reads, so it stops part way through the merge and its temporary files stay in place for as long as `sleep` runs; with `> out` instead they exist for about a second on this machine and the listing has to be taken while sort is still running.

$ cd "$(mktemp -d)" ; mkdir tmp ; export TMPDIR=$PWD/tmp ; umask 022
$ seq 1 2000000 | shuf > big
$ sort -S 64K big | sleep 30 &
$ sleep 2 ; find tmp -mindepth 1 | head -3 | xargs stat -c "%A %U %s %n"
drwxr-xr-x user 4096 tmp/uutils_sortWL2FaP
-rw-r--r-- user 73728 tmp/uutils_sortWL2FaP/131
-rw-r--r-- user 73724 tmp/uutils_sortWL2FaP/186
$ head -c 40 tmp/uutils_sort*/8 | od -c | head -2
0000000   1   0   0   0   0   0   6  \n   1   0   0   0   0   5   7  \n
0000020   1   0   0   0   1   3  \n   1   0   0   0   4   4   8  \n   1

The chunk is the input, sorted. Any other account on the machine can run that `head` while the sort is in progress. The exposure also outlives the run: when `sleep` ends, sort is killed by SIGPIPE and the directory with its 202 chunk files is left behind, still world-readable, where GNU sort removes its files from its signal handler.

$ kill %1 ; sleep 1 ; find tmp -mindepth 1 -type f | wc -l
202

GNU coreutils 9.11, same commands:

$ sleep 2 ; find tmp -mindepth 1 | head -3 | xargs stat -c "%A %U %s %n"
-rw------- user 2891 tmp/sort6Y4BRN
-rw------- user 3612 tmp/sorta2xuxC
-rw------- user 3613 tmp/sortubRV75
$ kill %1 ; sleep 1 ; find tmp -mindepth 1 | wc -l
0
Impact

`sort` is routinely run over data that is private to its owner: log files, exports of user tables, password or token lists being deduplicated, anything piped through `sort | uniq`. On a multi-user host with the default `/tmp`, uutils copies that data into world-readable files for the duration of the sort. Nothing in the input, the command or the output changes, so the owner has no sign of it, and the files are gone when the sort finishes, so an audit afterwards finds nothing.

The window is the run time of the sort, which for an input large enough to spill is seconds to hours, and the reader needs only to list `/tmp` at the right moment. If the sort is interrupted, or fails as in the companion report, the directory stays with the same modes until something removes it.

The umask does not help in the usual case, since 022 is the default almost everywhere; only a user who runs with 077 is protected, and a process that inherits a permissive umask from a service manager is not.

In short, the temporary copy of a sort's input is created with the umask rather than mode 0600, allowing any local user to read it while the sort runs, and potential local information disclosure of whatever private data is being sorted.

My Acknowledgement Information

Hongkai Chen of SEFCOM Lab at Arizona State University

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: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
uu_sort≤ 0.11.0
0.11.0
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
crates.iouu_sort
Sin parche — — —
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-c24x-h627-mprh

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