HIGH 7.8

CVE-2026-54057: Kitty Terminal OSC 21 Injection Vulnerability (CVSS 7.8)

Kitty, a GPU-accelerated terminal emulator, contains a vulnerability in how it handles color control queries. When a user runs certain terminal commands, an attacker can inject malicious input—including newlines and shell commands—that kitty reflects back into the shell without filtering. This allows arbitrary command execution under the user's privileges. The flaw affects all versions before 0.47.3, which includes the fix.

Source data · NVD / CISA · public domain

CVSS
3.1 · 7.8 HIGH · CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Weaknesses (CWE)
CWE-150, CWE-94
Affected products
1 configuration(s)
Published / Modified
2026-06-12 / 2026-06-17

NVD description (verbatim)

Kitty is a cross-platform GPU based terminal. In versions prior to 0.47.3, kitty's OSC 21 (color-control) query reply reflects attacker-controlled bytes, including newlines, into the shell's input without sanitization. Version 0.47.3 fixes the issue.

2 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

CVE-2026-54057 is an input validation failure in kitty's implementation of OSC 21 (Operating System Command sequence for color-control queries). When kitty processes a malicious OSC 21 sequence, it reflects attacker-controlled bytes—including newline characters—directly into the terminal input stream without sanitization. Because the shell interprets newlines as command delimiters, an attacker can inject and execute arbitrary shell commands in the context of the user running kitty. The vulnerability is classified under CWE-150 (Improper Neutralization of Escape, Meta, or Control Sequences) and CWE-94 (Improper Control of Generation of Code), reflecting both the escape-sequence handling failure and the code injection consequence.

Business impact

An attacker with the ability to send terminal escape sequences to a kitty user—via a malicious terminal application, SSH server, or crafted file output—can execute arbitrary commands with the privileges of the user running kitty. This breaks the isolation model of terminal sessions and can lead to credential theft, data exfiltration, lateral movement, or system compromise. Organizations relying on kitty as their primary terminal, especially in development, DevOps, or secure-access roles, face elevated risk if their users are exposed to untrusted terminal content.

Affected systems

Kitty versions prior to 0.47.3 are vulnerable. The vulnerability applies across all platforms kitty supports (Linux, macOS, and Windows). Any user running kitty 0.47.2 or earlier is at risk if they interact with untrusted terminal content, including output from remote servers, containerized environments, or third-party CLI tools.

Exploitability

Exploitation requires that an attacker can deliver a specially crafted OSC 21 sequence to kitty—a moderately low barrier. The attacker does not need local code execution; crafting a malicious output stream or terminal session is sufficient. However, exploitation is not automatic: the user must use kitty as their active terminal and allow the application producing the malicious sequence to run. The CVSS vector (AV:L/AC:L/PR:L/UI:N) confirms local attack surface, low complexity, and the need for a local user account; notably, UI:N indicates no user interaction beyond running the terminal itself is required once the sequence is delivered.

Remediation

Upgrade kitty to version 0.47.3 or later. This release patches the OSC 21 query handler to sanitize reflected bytes and prevent injection of newlines and shell metacharacters. Users unable to upgrade immediately should avoid using kitty with untrusted terminal sources (e.g., piping output from unverified scripts, connecting to compromised SSH servers) until patched.

Patch guidance

Visit the kitty GitHub repository or official distribution channels to obtain version 0.47.3 or a later stable release. Most package managers (homebrew, apt, dnf, etc.) should have the patched version available; verify the version number after installation using `kitty --version`. No manual configuration changes are required—the fix is automatic upon upgrade. Test the upgrade in a non-production environment first if kitty is critical to your workflow.

Detection guidance

Monitor process execution and shell command logs for unexpected command invocations originating from kitty sessions, particularly if they follow patterns of terminal output or escape-sequence injection. Endpoint Detection and Response (EDR) tools can alert on child processes spawned by the kitty binary or shell subprocess with suspicious arguments. Network monitoring can detect connections to known malicious servers if command exfiltration occurs. Log aggregation systems should correlate shell history (if available) with terminal session metadata to identify suspicious timing or source patterns.

Why prioritize this

This vulnerability scores CVSS 7.8 (HIGH) and combines high integrity and confidentiality impact with full system availability risk. Although it requires local user context, kitty's role in direct user interaction and the ease of delivering a malicious OSC sequence make it a practical attack vector in shared or supply-chain scenarios. The lack of KEV listing suggests lower real-world exploitation to date, but the technical simplicity and impactful consequences warrant prompt patching in most environments.

Risk score, explained

The CVSS 7.8 score reflects (1) local attack vector and low attack complexity, making the vulnerability feasible for local users or those controlling remote terminal output; (2) high integrity and confidentiality impact, enabling command execution and information disclosure; (3) high availability impact, as arbitrary commands can crash, hang, or delete data. The score would be higher if remote code execution were possible, but the local-user prerequisite caps severity. The actual risk to an organization depends on exposure—development teams using kitty with untrusted CI/CD or SSH sources face greater risk than isolated desktop users.

Frequently asked questions

Can this vulnerability be exploited remotely?

No, the CVE-2026-54057 attack vector is local; an attacker cannot exploit it over the network directly. However, if a remote server or CI/CD pipeline outputs malicious terminal escape sequences that a kitty user then runs, the remote actor can indirectly trigger the vulnerability. For example, a compromised SSH server or a third-party npm package that prints malicious output could be a remote attack vector in practice.

Does kitty's sandboxing or security model prevent exploitation?

Kitty does not sandbox terminal input processing by default. The vulnerability exists because kitty reflects OSC 21 responses without filtering, and the shell interprets the reflected content as commands. No special permissions or privilege escalation are required—the attacker's code runs with the same user ID as the kitty process.

What should I do if I cannot upgrade immediately?

Avoid piping untrusted output to your shell while using kitty. Be cautious with SSH connections to unfamiliar or potentially compromised systems, and avoid running scripts or CLI tools from sources you do not fully trust until you can upgrade. If possible, use a different terminal emulator temporarily, or isolate kitty usage to trusted local sessions only.

Will this affect my kitty configuration or key bindings?

No. Upgrading to 0.47.3 is a security patch that does not change user configuration, keybindings, themes, or appearance. Your kitty config files will continue to work unchanged.

This analysis is based on the published CVE record and vendor advisory as of the modification date. CVSS scores and severity ratings are sourced from the official CVSS:3.1 vector and are subject to change based on future evidence or vendor updates. This explainer does not constitute security advice for your specific environment; patch and risk decisions should be made in consultation with your security and systems teams, taking into account your organization's exposure to kitty, reliance on it, and the trustworthiness of terminal sources in your workflow. No exploit code or detailed attack steps are provided. Users are encouraged to review the official kitty security advisory and GitHub repository for the most current remediation guidance. Source: NVD (public-domain), retrieved 2026-07-20. Analysis generated by SEC.co (claude-haiku-4-5).