---
id: CVE-2026-80431
title: >-
  Out-of-bounds Write in the natural width branch of the text sizing protocol in
  kitty from 0.40.0 before 0.49.0 allows a program writing to the terminal to
  write past the end of a fixed-size buffer, because
  screen_handle_multicell_command…
summary: >-
  Out-of-bounds Write in the natural width branch of the text sizing protocol in
  kitty from 0.40.0 before 0.49.0 allows a program writing to the terminal to
  write past the end of a fixed-size buffer, because
  screen_handle_multicell_command…
severity: medium
cvss: 6.8
cvssVector: 'CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N'
cwe:
  - CWE-787
vendor: Kovid Goyal
product: kitty
affected:
  - kitty >= 0.40.0 < 0.49.0
published: '2026-09-25'
updated: '2026-09-25'
sourceUpdated: '2026-09-25T16:17:27.880'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2026-80431'
references:
  - url: >-
      https://github.com/kovidgoyal/kitty/commit/7d2fbaadcc2b1eeeef89bd875ec622b42362574b
    label: 4daa8cea-433a-44bd-9456-53b127fc289a
  - url: 'https://github.com/kovidgoyal/kitty/releases/tag/v0.49.0'
    label: 4daa8cea-433a-44bd-9456-53b127fc289a
  - url: >-
      https://secur0.com/en/cna/cve-list/cve-2026-80431-kitty-text-sizing-out-of-bounds-write
    label: 4daa8cea-433a-44bd-9456-53b127fc289a
tags:
  - nvd
  - cve.org
ssvc:
  exploitation: none
  automatable: 'no'
  technicalImpact: partial
  timestamp: '2026-09-25T15:05:06.462333Z'
cvssSource: cna
ingestedAt: '2026-09-25T14:09:46.372Z'
---

## Overview

Out-of-bounds Write in the natural width branch of the text sizing protocol in kitty from 0.40.0 before 0.49.0 allows a program writing to the terminal to write past the end of a fixed-size buffer, because screen_handle_multicell_command() in kitty/screen.c appends each codepoint of a grapheme cluster with lc.chars[lc.count++] = ch without any capacity check, while lc is declared by the RAII_ListOfChars macro as a four-element char_type array in the function's stack frame, so an OSC 66 escape code whose payload carries a grapheme cluster longer than four codepoints writes beyond that buffer, one 32-bit value per additional codepoint, in the order the codepoints appear. Where the cluster is preceded in the same payload by a sequence that causes an intermediate flush, the buffer is first migrated to the heap by ensure_space_for_chars() and the write occurs past the heap allocation instead. This results in termination of the kitty process and therefore of all its windows, tabs and child processes.

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.
