CVE-2026-42851: Kitty Terminal Arbitrary Code Execution via Malicious Terminal Input
Kitty is a popular GPU-accelerated terminal emulator that runs on multiple platforms. A critical design flaw in versions before 0.47.0 allows any untrusted content written to the terminal—such as text from a remote SSH session, a downloaded file, log output, or an email viewed in a pager—to execute arbitrary Python code within kitty's process space with the user's full privileges. This happens silently, with no warnings, permission dialogs, or user interaction required beyond the initial act of viewing the content. The vulnerability is especially dangerous because users often pipe untrusted data to their terminal without suspicion (e.g., viewing logs, reading downloaded files, or reviewing remote output).
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 7.8 HIGH · CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- Weaknesses (CWE)
- CWE-862, 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.0, a program able to write bytes to a kitty terminal — a remote SSH peer, a downloaded file viewed with `cat`, a log line, an email body rendered in `less`, an issue body in a TUI, etc. — can cause kitty to execute attacker-supplied Python inside the running kitty process, with the user's full privileges. There is no approval prompt, no remote-control permission requirement, no shell-integration interaction, no clipboard touch, and no editor interaction. Version 0.47.0 fixes the issue.
1 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
The vulnerability (CWE-862: Missing Authorization, CWE-94: Improper Control of Generation of Code) stems from kitty's handling of terminal input without proper validation or sandboxing. Kitty interprets certain byte sequences as control codes and, in affected versions, fails to restrict execution of embedded Python payloads. An attacker can craft a string containing malicious Python that, when rendered in the terminal, is parsed and executed directly in the kitty process context. The attack vector is local (AV:L) but requires only that the user view or interact with attacker-controlled content—no authentication or special privileges are needed from the attacker. The CVSS 3.1 score of 7.8 (HIGH) reflects high impact to confidentiality, integrity, and availability, combined with low attack complexity and no privilege requirement.
Business impact
Any organization or individual using kitty as their terminal is at risk of privilege escalation and code execution through routine work: reading server logs, checking emails in text-mode clients, downloading and reviewing files, or reviewing output from remote systems. A compromised terminal gives the attacker the ability to steal credentials, modify local files, exfiltrate data, or establish persistence—all with the user's full permissions. For development teams, DevOps engineers, and security professionals who rely on kitty, this is particularly concerning because they often work with untrusted or semi-trusted input (e.g., CI/CD logs, security research artifacts, third-party code repositories).
Affected systems
Kitty versions prior to 0.47.0 are affected on all supported platforms (Linux, macOS, BSD). Version 0.47.0 and later contain the fix. Users of earlier versions remain vulnerable regardless of their operating system or deployment method (package manager, source build, etc.).
Exploitability
Exploitability is straightforward because the attack requires only that an attacker control content displayed in a kitty terminal. No special prerequisites, shell integration hooks, or remote-control permissions are needed. An attacker might inject malicious payloads through: (1) a compromised SSH server or man-in-the-middle attack on SSH traffic, (2) a malicious file or archive unpacked and read by the user, (3) log aggregation or monitoring tools that fetch and display remote logs, (4) email clients or chat applications that render untrusted message bodies, or (5) TUI-based tools that display external data. The absence of any user-approval prompt or warning makes this exceptionally easy to weaponize. However, the vulnerability remains local in scope (AV:L), meaning it does not provide a direct network entry point; the attacker must first get malicious content to the victim's terminal by other means.
Remediation
Upgrade to kitty version 0.47.0 or later immediately. Users should check their current version with `kitty --version` and consult the official kitty releases page or their distribution's package manager for availability. After upgrading, restart or reconnect any active kitty sessions to ensure the fixed version is in use.
Patch guidance
The official fix is available in kitty version 0.47.0 and later. Verify your current version by running `kitty --version` in your terminal. If you are on version 0.46.z or earlier, update through your package manager (apt, brew, dnf, etc.) or download the latest release from the official kovidgoyal/kitty GitHub repository. For Linux systems, check if your distribution has pushed the update; if not, building from source is an option. macOS users can update via Homebrew or the official installer. After installation, restart kitty or all running instances to ensure the fix is active.
Detection guidance
Identify systems running kitty by querying process listings for 'kitty' or checking configuration in user shell profiles. Run `kitty --version` on suspected systems to confirm the version. Organizations with device inventory or MDM systems should flag any kitty installations on versions below 0.47.0 for immediate upgrade. Intrusion detection can monitor for unusual Python subprocess spawning from a kitty process, though this is a reactive measure and should not replace patching. Additionally, audit terminal output logs or session recordings for suspicious escape sequences or Python code fragments to identify potential exploitation attempts, though this is forensic rather than preventative.
Why prioritize this
Although not yet listed on the CISA Known Exploited Vulnerabilities (KEV) catalog, this vulnerability should be prioritized as HIGH because: (1) it enables arbitrary code execution with user privileges via a local attack vector requiring minimal attacker effort, (2) the affected software (kitty) is widely used by developers and engineers who routinely handle sensitive data, (3) there is no user-facing warning or approval step, making exploitation silent and difficult to detect, and (4) patch availability makes remediation straightforward. Teams should patch within days, not weeks.
Risk score, explained
CVSS 3.1 score of 7.8 (HIGH) is justified by: Attack Vector (L - local, meaning the attacker must have some form of access to the system or its user), Attack Complexity (L - no special conditions required beyond viewing content), Privileges Required (N - the attacker does not need to be authenticated or privileged), User Interaction (R - required; the user must view or interact with the attacker's content), Scope (U - unchanged; the impact is limited to the vulnerable component and the user's context), and impact metrics (C:H/I:H/A:H - high impact on confidentiality, integrity, and availability). The score appropriately reflects the severity of unauthenticated code execution, moderated slightly by the local and user-interaction requirements.
Frequently asked questions
If I upgrade to 0.47.0, do I need to do anything else?
No. Simply upgrading kitty to version 0.47.0 or later eliminates the vulnerability. Restart kitty or your terminal sessions to ensure the patched version is running. No configuration changes or workarounds are needed.
Can I work around this vulnerability without upgrading?
There is no reliable workaround. You could attempt to restrict the sources of terminal input (e.g., avoid untrusted SSH sessions or files), but this is impractical for most users and does not fully mitigate the risk. Patching is the only secure solution.
Is this vulnerability exploitable over the network?
The vulnerability itself is local (AV:L), meaning the attacker cannot directly exploit kitty across the network. However, an attacker can inject malicious payloads through network channels—for example, a compromised server's output, a malicious email body, or man-in-the-middle tampering with SSH traffic. The local requirement reflects that the malicious content must reach the victim's terminal; the delivery mechanism may be remote.
Which users are at highest risk?
Developers, DevOps engineers, security researchers, and system administrators are at highest risk because they frequently view untrusted or semi-trusted data (logs, CI/CD output, downloaded artifacts, remote command output). Any kitty user who reads email, downloads files, or connects to remote systems should update immediately.
This analysis is based on the CVE record and vendor advisory as of the publication date. CVSS scores and severity assessments reflect the Common Vulnerability Scoring System v3.1. Organizations should verify patch availability and compatibility in their specific environments before deploying updates. This intelligence is provided for informational purposes and does not constitute legal or compliance advice. Always consult your organization's change management and patch deployment policies. Source: NVD (public-domain), retrieved 2026-07-20. Analysis generated by SEC.co (claude-haiku-4-5).
Related vulnerabilities
- CVE-2018-25391HIGHHaPe PKH 1.1 Authorization Bypass – Unauthorized Record Deletion Vulnerability
- CVE-2025-26418HIGHAndroid CarDevicePolicyService Privilege Escalation (CVSS 7.8)
- CVE-2025-53345HIGHThimPress Thim Core Missing Authorization Leads to Code Execution
- CVE-2026-0133HIGHAndroid ARM SMMU v3 Privilege Escalation (CVSS 7.8)
- CVE-2026-0272HIGHPalo Alto PAN-OS Privilege Escalation Vulnerability (PA-Series, VM-Series, Panorama)
- CVE-2026-10737HIGHWordPress SP Project & Document Manager Unauthenticated File Access Vulnerability
- CVE-2026-10904HIGHChrome V8 Sandbox Escape Remote Code Execution
- CVE-2026-10928HIGHScript Injection in Google Chrome Headless – CVSS 8.8 High Severity