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

CVE-2026-95835: Kitty Terminal Information Disclosure Flaw

CVE-2026-95835 is an information disclosure vulnerability in kitty terminal versions 0.25.0 to 0.49.0 that allows unauthorized local users to capture secrets typed into prompts. This article covers technical details, affected versions, 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-95835 Overview

CVE-2026-95835 is a missing authorization vulnerability [CWE-862] in the kitty terminal emulator. Versions 0.25.0 through 0.48.x fail to verify ownership and permissions of POSIX shared memory objects referenced by the askpass escape code handler. A second local user on the same host can craft a shared memory object, trigger the victim's terminal to render an attacker-controlled password prompt, and read the typed secret back from the shared memory. The flaw was fixed in kitty 0.49.0.

Critical Impact

A local attacker who can cause bytes to be displayed in the victim's kitty window can harvest cleartext secrets, including masked passwords, without requiring any privilege on the victim's account.

Affected Products

  • kitty terminal emulator versions 0.25.0 through 0.48.x
  • Linux and Unix-like systems where POSIX shared memory namespace is shared between users
  • Multi-user hosts using kitty as the terminal

Discovery Timeline

  • 2026-09-25 - CVE-2026-95835 published to NVD
  • 2026-09-29 - Last updated in NVD database
  • Patch released - kitty v0.49.0 ships the ownership and permission check

Technical Details for CVE-2026-95835

Vulnerability Analysis

The vulnerability resides in handle_remote_askpass() within kitty/window.py. The handler opens a POSIX shared memory object whose name is supplied in a device control string (DCS) escape sequence received through the terminal byte stream. It parses a prompt definition from the object, displays the prompt to the user, and writes the user's typed response back into a shared memory object of the same name.

At no point does the handler validate that the shared memory object is owned by the user running kitty, nor that its mode bits exclude access by other users. The ssh kitten, which consumes the same SharedMemory class, performs this check correctly. The askpass path did not.

Because the prompt text is passed to the display without control character sanitisation, an attacker can overwrite the warning line that kitty prints above the prompt. The response is written by reopening a shared memory object of that name rather than through the file handle originally held, giving the attacker a second window to swap the object.

Root Cause

The root cause is the absence of st_uid, st_gid, and mode validation on the shared memory object before trusting its contents. In the ssh kitten, read_data_from_shared_memory() explicitly compared shm.stats.st_uid to os.geteuid() and verified mode bits equal S_IREAD | S_IWRITE. The askpass code path omitted that verification entirely.

Attack Vector

Exploitation requires two conditions on the target host. First, the POSIX shared memory namespace must be shared between the attacker and victim, which is the default on Linux (/dev/shm). Second, the attacker must cause attacker-chosen bytes to be rendered by the victim's kitty window. This can occur through log files, chat clients, cat-ing attacker-controlled files, or any process that forwards bytes to the terminal.

The attacker creates a shared memory object with permissions allowing the victim to read and write it, then delivers the DCS escape sequence that references that object. The victim's kitty renders the attacker's prompt (potentially impersonating sudo or ssh-askpass), the victim types a secret, and the attacker reads the response from the same shared memory object.

python
# Patch from kittens/ssh/utils.py showing the equivalent check
# that was MISSING from the askpass handler path
def read_data_from_shared_memory(shm_name: str) -> Any:
    import json

    from kitty.shm import SharedMemory

    with SharedMemory(shm_name, readonly=True) as shm:
        shm.unlink()
        shm.verify_owner_and_mode()
        return json.loads(shm.read_data_with_size())

Source: GitHub commit 3281919

Detection Methods for CVE-2026-95835

Indicators of Compromise

  • Unexpected files in /dev/shm/ owned by users other than the kitty process owner but with world-readable or world-writable permissions
  • Shell history or process logs showing another local user creating POSIX shared memory objects (shm_open calls) targeting another user's session
  • Terminal sessions where unexpected prompt text appears without a preceding legitimate command invocation
  • Instances of kitty versions earlier than 0.49.0 on multi-user systems

Detection Strategies

  • Audit /dev/shm/ ownership and mode bits regularly on multi-user hosts, flagging objects with cross-user accessible permissions
  • Monitor for processes writing device control strings (DCS, \eP...\e\\) into TTYs owned by other users
  • Inventory installed kitty versions across the fleet and compare against the fixed 0.49.0 release

Monitoring Recommendations

  • Enable Linux audit rules on shm_open, shm_unlink, and TTY write syscalls targeting other users' terminals
  • Alert on any process writing to /dev/pts/* devices that are not owned by the writing user's UID
  • Correlate terminal process spawn events with subsequent /dev/shm/ object creation by a different UID

How to Mitigate CVE-2026-95835

Immediate Actions Required

  • Upgrade kitty to version 0.49.0 or later on all affected systems
  • On multi-user hosts where upgrade is delayed, restrict interactive logins to a single trusted user
  • Audit /dev/shm/ for pre-existing attacker-staged objects and remove any owned by unexpected UIDs
  • Educate users to treat unexpected password prompts in terminals as suspicious

Patch Information

The fix landed in kitty 0.49.0. The patch replaces inline ownership and mode checks with a centralised shm.verify_owner_and_mode() call and extends that verification to the askpass code path. Reference the GitHub release notes for v0.49.0 and the upstream commit 3281919. Additional analysis is available in the Secur0 advisory for CVE-2026-95835.

Workarounds

  • Avoid displaying untrusted content in kitty windows on multi-user systems until patched
  • Mount /dev/shm with per-user namespaces or use systemd PrivateTmp=yes units to isolate shared memory namespaces where feasible
  • Disable kitty's remote control and DCS-driven features in kitty.conf for sessions handling sensitive input
bash
# Verify installed kitty version and upgrade
kitty --version

# Debian/Ubuntu
sudo apt update && sudo apt install --only-upgrade kitty

# Arch
sudo pacman -Syu kitty

# Audit /dev/shm for cross-user accessible objects
ls -la /dev/shm/ | awk '$3 != ENVIRON["USER"] && /^-rw/'

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.