CVE-2026-72847: broot Terminal Escape Sequence Injection via Unsanitized File and Directory Names in the Tree View
broot renders each file and directory name in its interactive tree view exactly as read from the filesystem. Names are converted with a plain tostringlossy() call in src/treebuild/builder.rs and in TreeLine::unprune in src/tree/treeline.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 Software
Event History
Frequently Asked Questions
Who is exposed to this issue?
Any broot user who browses a directory containing a maliciously named file or subdirectory is exposed. The attacker needs the ability to create or influence a name in a directory the victim will view.
Does exploitation require a special broot configuration?
No special configuration is described. broot's normal tree-view behavior renders filesystem names, and the reported proof of concept confirmed that an OSC 52 sequence was written unmodified to the terminal.
What does an attacker need to do to trigger it?
An attacker must create a filesystem entry whose name contains terminal escape sequences, then cause or wait for a victim to browse the containing directory with broot. The resulting effect depends on the victim's terminal emulator and its handling of OSC or CSI sequences.
How can I determine whether I may already be affected?
Review directories browsed with broot for file or directory names containing control characters or terminal escape sequences, especially entries created by untrusted local users. The issue is present where names are rendered unfiltered in the tree view.