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

CVE-2026-95832: Kitty Terminal Emulator RCE Vulnerability

CVE-2026-95832 is a remote code execution vulnerability in Kitty terminal emulator affecting versions 0.47.3 to 0.49.0. Attackers can execute arbitrary commands through malicious escape sequences. This article covers technical details, affected versions, impact assessment, 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-95832 Overview

CVE-2026-95832 is a command injection vulnerability in the kitty terminal emulator affecting versions 0.47.3 through versions prior to 0.49.0. The flaw resides in the color control escape code handler, where color_control() in kitty/window.py echoes unrecognised field names back into the reply. The function write_escape_code_to_child() in kitty/screen.c then writes that reply to the pseudoterminal master, where the shell cannot distinguish it from user-typed input. Any program able to write to the terminal can inject an attacker-chosen command that executes with the privileges of the user running kitty [CWE-74].

Critical Impact

An attacker who can write to the terminal, including through SSH prelude data, can execute arbitrary shell commands as the local user before any credential check occurs.

Affected Products

  • kitty terminal emulator version 0.47.3
  • kitty terminal emulator versions after 0.47.3 and before 0.49.0
  • Installations relying on the ssh kitten remote handling path

Discovery Timeline

  • 2026-09-25 - CVE-2026-95832 published to NVD
  • 2026-09-29 - Last updated in NVD database

Technical Details for CVE-2026-95832

Vulnerability Analysis

The color control protocol in kitty allows a client to query color fields using an Operating System Command (OSC) escape sequence. When a client requests an unknown field, the terminal replies with field=? and includes the original field name verbatim. That reply is written directly to the pseudoterminal master, the same channel used by keyboard input, so the shell parses it as typed commands.

The payload is restricted to printable ASCII, which was the fix introduced in version 0.47.3 for CVE-2026-54057. The record separator ; and the field separator = are consumed as delimiters, but every other printable character passes through. That residual character set is sufficient to compose a complete shell command.

A newline byte, normally required to force the shell to execute the injected line, is reachable through handle_remote_ssh() in kitty/window.py. That function invokes get_ssh_data() in kittens/ssh/utils.py, whose first yielded bytes begin with a newline and are written to the pseudoterminal before the request's credential is validated.

Root Cause

The terminal trusts an untrusted field name supplied by a writer to the TTY and reflects it into a channel that the shell treats as input. There is no neutralisation of shell metacharacters, and the privileged write path (write_escape_code_to_child()) does not separate program output from user input.

Attack Vector

Attack delivery requires only the ability to write bytes to the terminal: a malicious file viewed with cat, output from an SSH session, log data, or crafted content served over a terminal-connected pipe. The reply is framed as an OSC sequence carrying the escape code number, the field name, and the literal value ?.

text
- Color control protocol: Report unknown fields as ``unknown=<base64 encoded
  field name>`` instead of echoing the field name back verbatim, which allowed
  using the escape code to make the terminal emit arbitrary printable ASCII text

Source: GitHub commit 03fbdad8

Stop Remote Code Execution Before It Runs

Singularity™ Endpoint detects and blocks exploit attempts at machine speed, including zero-days and novel attack techniques.

Stop Exploit Attempts

Detection Methods for CVE-2026-95832

Indicators of Compromise

  • Unexpected OSC sequences carrying color control escape code number 21 with unusual field names written to user terminals.
  • Shell history entries containing commands the user did not type, especially following a session where untrusted content was displayed.
  • SSH kitten remote echo messages whose base64-decoded payload is not purely digits, as flagged by handle_remote_echo() after the patch.

Detection Strategies

  • Monitor process creation events where the parent is a shell inside kitty and the command line contains characters from an OSC reply pattern.
  • Inspect terminal recordings or logged pseudoterminal traffic for \\x1b]21; sequences containing non-standard color field names.
  • Correlate SSH prelude activity from handle_remote_ssh() with subsequent child process creation that lacks a corresponding user keystroke source.

Monitoring Recommendations

  • Alert on execution of installed kitty binaries at versions between 0.47.3 and 0.48.2 inclusive.
  • Track reads of untrusted files by terminal processes followed by unexpected shell child processes within a short time window.
  • Capture command-line telemetry from Linux and macOS endpoints running kitty and baseline for OSC-derived command patterns.

How to Mitigate CVE-2026-95832

Immediate Actions Required

  • Upgrade kitty to version 0.49.0 or later on every workstation where it is installed.
  • Avoid using cat, less, or similar tools to display untrusted files or network output in affected kitty versions.
  • Disable or restrict the ssh kitten remote handling path on hosts that cannot be upgraded immediately.

Patch Information

The fix landed in kitty version 0.49.0. The patch changes the color control protocol so that unknown field names are returned as unknown=<base64 encoded field name>, encoded without padding. This removes the attacker's ability to make the terminal emit arbitrary printable ASCII through this escape code. A related change tightens handle_remote_echo() to accept only digit payloads using data.isdigit() instead of a regex match. See GitHub release v0.49.0 and GitHub commit 57bb144d for the complete change set, and the CNA analysis of CVE-2026-95832 for further context.

Workarounds

  • Switch to a different terminal emulator until the upgrade can be deployed.
  • Pipe untrusted output through a sanitiser that strips escape sequences, for example cat -v or a dedicated tool, before rendering.
  • Block inbound SSH sessions from untrusted sources that could reach a vulnerable kitty-hosted terminal.
bash
# Verify installed kitty version and upgrade
kitty --version
# On systems with the project installer:
curl -L https://sw.kovidgoyal.net/kitty/installer.sh | sh /dev/stdin \
  installer=version-0.49.0

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.