CVE-2026-72847
JSON

2.4low

broot Terminal Escape Sequence Injection via Unsanitized File and Directory Names in the Tree View

Severity
2.4low CVSS:4.0 by VulnCheck
Exploit likelihood
0.10% (higher than 1% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
VulnCheck

Description

broot renders each file and directory name in its interactive tree view exactly as read from the filesystem. Names are converted with a plain to_string_lossy() call in src/tree_build/builder.rs and in TreeLine::unprune in src/tree/tree_line.rs, and no control-character filtering exists anywhere in the code, even though the doc comment on the TreeLine name field states that some characters may have been stripped. Any local user who can create a file can therefore place an escape sequence in its name and have it written unmodified to the terminal of anyone who browses that directory, between broot's own styling codes. A reported proof of concept used an OSC 52 clipboard-write sequence and captured the raw bytes broot wrote to its pty, confirming the sequence reaches the terminal unstripped. What an injected OSC or CSI sequence can then do depends on the terminal emulator in use. Browsing a directory is broot's primary function and carries no expectation that the content is trusted.

Affected

Product or packageVersionsReported by
Canop brootup to 1.58.0CVE List

All scores

VulnCheck2.4low CVSS:4.0CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N
VulnCheck4.6medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N

Classification

CWE-150

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.

What each source says

CVE List

broot renders each file and directory name in its interactive tree view exactly as read from the filesystem. Names are converted with a plain to_string_lossy() call in src/tree_build/builder.rs and in TreeLine::unprune in src/tree/tree_line.rs, and no control-character filtering exists anywhere in the code, even though the doc comment on the TreeLine name field states that some characters may have been stripped. Any local user who can create a file can therefore place an escape sequence in its name and have it written unmodified to the terminal of anyone who browses that directory, between broot's own styling codes. A reported proof of concept used an OSC 52 clipboard-write sequence and captured the raw bytes broot wrote to its pty, confirming the sequence reaches the terminal unstripped. What an injected OSC or CSI sequence can then do depends on the terminal emulator in use. Browsing a directory is broot's primary function and carries no expectation that the content is trusted.

NVD (es)

broot renderiza cada nombre de archivo y directorio en su vista de árbol interactiva exactamente como se lee del sistema de archivos. Los nombres se convierten con una llamada simple a to_string_lossy() en src/tree_build/builder.rs y en TreeLine::unprune en src/tree/tree_line.rs, y no existe ningún filtrado de caracteres de control en ninguna parte del código, a pesar de que el comentario de la documentación en el campo de nombre de TreeLine indica que algunos caracteres pueden haber sido eliminados. Cualquier usuario local que pueda crear un archivo puede, por lo tanto, colocar una secuencia de escape en su nombre y hacer que se escriba sin modificar en la terminal de cualquiera que explore ese directorio, entre los propios códigos de estilo de broot. Una prueba de concepto reportada utilizó una secuencia de escritura de portapapeles OSC 52 y capturó los bytes sin procesar que broot escribió en su pty, confirmando que la secuencia llega a la terminal sin eliminar. Lo que una secuencia OSC o CSI inyectada puede hacer entonces depende del emulador de terminal en uso. Explorar un directorio es la función principal de broot y no conlleva la expectativa de que el contenido sea de confianza.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-72847 changed 2026-09-24CVE Terms of Use
NVDCVE-2026-72847 changed 2026-10-18Public domain