Skip to main content
Vulnerability Database/CVE-2026-100866

CVE-2026-100866: onefetch Terminal Escape Sequence XSS

CVE-2026-100866 is a cross-site scripting vulnerability in onefetch that enables terminal escape sequence injection through repository fields. Attackers can manipulate terminal output and window titles. This article covers technical details, affected versions, impact analysis, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-100866 Overview

CVE-2026-100866 is a terminal escape sequence injection vulnerability in onefetch, a command-line Git repository summary tool. Versions through 2.28.1 write repository information field values directly to the terminal without sanitizing control characters. Attackers can embed ANSI or Operating System Command (OSC) escape sequences in project manifest version and name fields. When a victim runs onefetch against a malicious repository, the injected sequences execute in the user's terminal emulator. The flaw is tracked as improper neutralization of escape sequences in output [CWE-150].

Critical Impact

Attackers can manipulate terminal output, rewrite window titles, hide text, or trigger emulator-specific behavior that may lead to user deception or further exploitation.

Affected Products

  • onefetch versions through 2.28.1
  • Any environment where developers run onefetch against untrusted Git repositories
  • Terminal emulators that honor ANSI and OSC escape sequences

Discovery Timeline

  • 2026-09-27 - CVE-2026-100866 published to the National Vulnerability Database
  • 2026-09-30 - Last updated in NVD database

Technical Details for CVE-2026-100866

Vulnerability Analysis

onefetch reads project metadata from manifest files such as Cargo.toml, package.json, and similar sources, then prints that data alongside Git statistics in the terminal. The information field rendering path, implemented in src/info/utils/info_field.rs, writes field values directly to standard output. The version rendering path in src/info/version.rs behaves the same way. Neither path strips or escapes ANSI Control Sequence Introducer (CSI) or OSC byte sequences before display.

An attacker who controls a repository can set the project name or version to a value containing escape characters. When a victim clones the repository and runs onefetch, the terminal interprets those sequences rather than printing them literally. The attacker can overwrite the terminal title bar, move the cursor, clear regions of the screen, change colors, or render deceptive text over earlier output.

Root Cause

The root cause is missing output neutralization [CWE-150]. The affected code paths treat untrusted repository metadata as safe display strings. There is no filter that removes 0x1B (ESC), 0x9B (CSI), BEL, or other control bytes that drive terminal state changes.

Attack Vector

Exploitation requires local execution of onefetch by the victim against an attacker-controlled repository. The attacker publishes a repository with a crafted manifest, for example a Cargo.toml with a version field containing OSC ]0; sequences to rewrite the window title or CSI sequences to hide subsequent text. User interaction is required: the developer must clone the repository and run the tool. Technical details are referenced in the VulnCheck advisory for onefetch and the upstream onefetch issue #1828.

The vulnerability manifests in the information field rendering functions. See the GitHub onefetch info field code and the GitHub onefetch version code for the affected code paths.

Detection Methods for CVE-2026-100866

Indicators of Compromise

  • Repository manifest files (Cargo.toml, package.json, pyproject.toml) containing 0x1B ESC bytes inside name or version strings
  • Unexpected changes to terminal window titles after running onefetch
  • Shell history or scrollback showing missing, overwritten, or hidden output immediately after invoking onefetch
  • Presence of OSC sequences such as \\x1b]0; or CSI sequences such as \\x1b[ inside Git-tracked metadata files

Detection Strategies

  • Scan cloned repositories for non-printable control bytes in manifest files using tools such as grep -P "\\x1b" or cat -v
  • Audit CI pipelines that invoke onefetch and log raw stdout for escape sequences prior to terminal rendering
  • Flag commits that introduce control characters into name, version, description, or authors fields during code review

Monitoring Recommendations

  • Monitor developer workstations for execution of onefetch against newly cloned, untrusted repositories
  • Capture terminal session logs in sensitive environments to retain evidence of injected sequences
  • Track installed versions of onefetch across engineering fleets and alert on any instance at or below 2.28.1

How to Mitigate CVE-2026-100866

Immediate Actions Required

  • Upgrade onefetch to a release later than 2.28.1 once a fixed version is published by the maintainers
  • Avoid running onefetch against repositories from untrusted sources until patched
  • Inspect manifest files manually with a hex viewer before invoking onefetch on unknown projects

Patch Information

A tracking issue is open upstream at onefetch issue #1828. Monitor the onefetch GitHub repository for a release that neutralizes control characters in the src/info/utils/info_field.rs and src/info/version.rs rendering paths. Review the VulnCheck advisory for onefetch for the authoritative fix status.

Workarounds

  • Pipe onefetch output through a filter that strips escape sequences, for example onefetch | sed 's/\\x1b\[[0-9;]*[a-zA-Z]//g; s/\\x1b\][^\\x07]*\\x07//g'
  • Run onefetch inside a disposable terminal session or container so that title rewrites and hidden text do not persist
  • Disable onefetch execution in automated post-clone hooks until a patched release is available
bash
# Configuration example: wrap onefetch to strip ANSI/OSC escape sequences before display
alias onefetch-safe='onefetch "$@" | perl -pe '\''s/\e\[[0-9;?]*[a-zA-Z]//g; s/\e\][^\a]*(?:\a|\e\\)//g; s/[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F]//g'\'''

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.