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

CVE-2026-80430: Kitty Terminal Path Traversal Vulnerability

CVE-2026-80430 is a path traversal flaw in Kitty terminal emulator versions 0.47.0 to 0.49.0 that enables arbitrary file creation outside staging directories. This article covers technical details, affected versions, impact, and mitigation.

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-80430 Overview

CVE-2026-80430 is a symlink traversal vulnerability [CWE-59] in the kitty terminal emulator's drag and drop protocol. Affected versions range from 0.47.0 up to but not including 0.49.0. A program that writes to the terminal can abuse improper link resolution in the drag source staging path to create files and directories at arbitrary locations writable by the user running kitty. The flaw resides in subdir_data_for_drag() in kitty/dnd.c, which resolves a staged tree entry by opening a constructed path string instead of walking the tree one component at a time.

Critical Impact

Any process able to write escape sequences to a kitty terminal can create files and directories outside the staging directory, enabling attacker-controlled file placement at any location writable by the user.

Affected Products

  • kitty terminal emulator versions 0.47.0 through 0.48.x
  • Fixed in kitty 0.49.0
  • All platforms supported by kitty (Linux, macOS)

Discovery Timeline

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

Technical Details for CVE-2026-80430

Vulnerability Analysis

The vulnerability stems from how subdir_data_for_drag() in kitty/dnd.c resolves descendants of a staged item tree. The function constructs a path string and opens it with safe_open(path, O_DIRECTORY | O_RDONLY, 0) rather than walking the tree one component at a time with openat() and O_NOFOLLOW. Entry names are sanitised against path separators and dot components, but symlink targets supplied by the drag source are not validated.

A malicious client can declare two entries with the same name: first a symlink whose target is an arbitrary absolute path, and second a directory. The mkdirat() call for the directory fails with EEXIST, which the code ignores. The subsequent path resolution follows the symlink and returns a directory descriptor outside the staging directory. That descriptor is then passed as the dirfd argument to add_payload() and reused for every further create operation on the item and its descendants.

Root Cause

The root cause is improper link resolution before file access [CWE-59]. Files are created with O_CREAT | O_WRONLY | O_EXCL at mode 0644, so existing files cannot be overwritten. Directories are created with mkdirat() at mode 0755, allowing the attacker to create intermediate directories that did not previously exist. The absence of O_NOFOLLOW on the directory open and the lack of per-component tree walking enable the escape.

Attack Vector

Exploitation requires local interaction. An attacker needs the ability to write terminal escape sequences to a kitty window and requires the user to trigger a drag and drop operation. Attack vectors include malicious SSH sessions, hostile files viewed with cat, or compromised terminal applications that emit the drag and drop protocol sequences.

c
 static bool
 drop_send_file_data(Window *w, const char *path) {
     drop_close_file_fd(w);
-    int fd = safe_open(path, O_RDONLY | O_CLOEXEC | O_NONBLOCK, 0);
+    int fd = safe_open(path, O_RDONLY | O_CLOEXEC | O_NONBLOCK | O_NOFOLLOW, 0);
     if (fd < 0) {
         switch (errno) {
             case ENOENT:

Source: kitty commit 3c3133d — defense-in-depth patch adding O_NOFOLLOW when opening regular files during drag operations.

Detection Methods for CVE-2026-80430

Indicators of Compromise

  • Unexpected files or directories owned by the user running kitty appearing outside normal drag and drop staging paths.
  • Symlinks inside kitty temporary staging directories pointing to absolute paths such as /home/<user>/.ssh, /home/<user>/.config, or /tmp.
  • Kitty process creating files via openat()/mkdirat() with dirfd values that resolve outside the intended staging directory.

Detection Strategies

  • Audit kitty versions deployed across the fleet and flag any instance between 0.47.0 and 0.48.x.
  • Instrument syscall telemetry with auditd or eBPF to log openat(), symlinkat(), and mkdirat() calls originating from the kitty process.
  • Correlate kitty drag and drop activity with filesystem creation events in sensitive directories like ~/.ssh, ~/.config/autostart, and ~/bin.

Monitoring Recommendations

  • Monitor filesystem changes in user home directories, specifically additions to shell startup files, autostart entries, and SSH configuration.
  • Alert on new executable files written to directories listed in the user's PATH outside expected package manager activity.
  • Track terminal escape sequence anomalies from untrusted sources such as SSH sessions or displayed file contents.

How to Mitigate CVE-2026-80430

Immediate Actions Required

  • Upgrade kitty to version 0.49.0 or later on all systems where the terminal emulator is installed.
  • Avoid using cat, less, or similar utilities on untrusted files inside a kitty window until patched.
  • Treat SSH sessions to untrusted hosts from kitty as capable of writing arbitrary files to the local account until the upgrade is applied.

Patch Information

The fix is included in kitty 0.49.0. The upstream patches apply O_NOFOLLOW when opening regular files and explicitly deny drag sources that send identically named symlink and directory entries. See the GitHub release notes for v0.49.0 and the upstream fix commit.

text
 - Drag and drop protocol: deny requests for drag data made before the user has actually dropped something onto the window
+- Drag and drop protocol: Deny drag sources that send identically named symlink/dir entries with an appropriate error
 - Text sizing protocol: Fix a buffer overflow when a natural width (no explicit ``w`` key) text sizing escape code contains a grapheme cluster longer than four codepoints

Source: kitty changelog commit 554908e.

Workarounds

  • Do not perform drag and drop operations from kitty windows connected to untrusted content or remote hosts.
  • Restrict terminal use with untrusted input to kitty instances running inside sandboxes such as firejail or bubblewrap with limited filesystem write access.
  • Review the Secur0 CVE-2026-80430 analysis for additional context on exploitation preconditions.
bash
# Verify installed kitty version and upgrade if vulnerable
kitty --version
# On Arch Linux
sudo pacman -Syu kitty
# On Debian/Ubuntu (via upstream installer)
curl -L https://sw.kovidgoyal.net/kitty/installer.sh | sh /dev/stdin
# Confirm the patched version
kitty --version  # should report 0.49.0 or later

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.