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.
Published: 2026-08-20
Score: 2.4 Low
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability allows a local user who can create or rename files and directories to embed terminal escape sequences, such as OSC 52 clipboard‑write or other CSI commands, directly into file names. Because broot renders the names in its interactive tree view using a plain to_string_lossy() call without any control‑character filtering, these sequences are sent unmodified to the terminal as the file list is drawn. Depending on the terminal emulator, the injected sequence can alter the clipboard, change terminal settings, or trigger arbitrary terminal actions.

Affected Systems

Canop’s broot is the affected product. No explicit version range is documented in the advisory; the concurrency issue exists in the code that builds and displays the tree view.

Risk and Exploitability

The CVSS score is 2.4, indicating low severity, and no EPSS data is available. The vulnerability is not listed in the CISA KEV catalog. The attack vector is local: an attacker must have the ability to create or rename files within a directory that a broot session will inspect. While the impact is limited to the terminal session of the user running broot, the ability to inject sequences that modify the clipboard or execute terminal commands can be exploited in environments where terminal output is not trusted. Overall risk is moderate for environments that rely on broot to view untrusted file systems.

Generated by OpenCVE AI on August 20, 2026 at 20:23 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Update broot to a version that sanitizes filenames in the tree view – see commit 0717a94b3c0efa19c7bbcfe0fb49a2374752a168 for reference.
  • If an update is not immediately possible, apply the patch from commit 4ba40f7d47af78457c7656f15eba71d63d97fce5 which adds control‑character filtering in the builder logic.
  • As a temporary measure, run broot in a terminal emulator that disables or ignores escape sequences, or avoid using broot to display directories that may contain untrusted files.

Generated by OpenCVE AI on August 20, 2026 at 20:23 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Thu, 20 Aug 2026 17:30:00 +0000

Type Values Removed Values Added
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.
Title broot Terminal Escape Sequence Injection via Unsanitized File and Directory Names in the Tree View
Weaknesses CWE-150
References
Metrics cvssV3_1

{'score': 4.6, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N'}

cvssV4_0

{'score': 2.4, 'vector': 'CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N'}


Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-08-20T17:19:34.678Z

Reserved: 2026-08-10T15:14:51.468Z

Link: CVE-2026-72847

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-08-20T18:16:45.540

Modified: 2026-08-20T18:16:45.540

Link: CVE-2026-72847

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-20T20:30:05Z

Weaknesses
  • CWE-150

    Improper Neutralization of Escape, Meta, or Control Sequences