{"id":"CVE-2026-80431","summary":"Out-of-bounds write in the kitty text sizing protocol allows termination of the terminal process","details":"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.","modified":"2026-09-27T08:04:16.649165Z","published":"2026-09-25T13:23:51.590Z","database_specific":{"cna_assigner":"Secur0","cwe_ids":["CWE-787"],"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/80xxx/CVE-2026-80431.json","unresolved_ranges":[{"extracted_events":[{"introduced":"0.40.0"},{"fixed":"0.49.0"}],"source":"AFFECTED_FIELD"},{"extracted_events":[{"introduced":"0.40.0"},{"fixed":"0.49.0"}],"source":"CPE_FIELD"},{"extracted_events":[{"introduced":"0.40.0"},{"fixed":"0.49.0"}],"source":"DESCRIPTION"}]},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/80xxx/CVE-2026-80431.json"},{"type":"ADVISORY","url":"https://github.com/kovidgoyal/kitty/releases/tag/v0.49.0"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-80431"},{"type":"ADVISORY","url":"https://secur0.com/en/cna/cve-list/cve-2026-80431-kitty-text-sizing-out-of-bounds-write"},{"type":"FIX","url":"https://github.com/kovidgoyal/kitty/commit/7d2fbaadcc2b1eeeef89bd875ec622b42362574b"},{"type":"PACKAGE","url":"https://github.com/kovidgoyal/kitty"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/kovidgoyal/kitty","events":[{"introduced":"0"},{"fixed":"7d2fbaadcc2b1eeeef89bd875ec622b42362574b"},{"fixed":"07ed6aa3de28af2a01e521f18c56ed292aa34cfc"}],"database_specific":{"source":"REFERENCES"}}],"versions":["v0.47.0","v0.48.2","v0.48.1","v0.48.0","v0.47.4","v0.47.3","v0.47.2","v0.47.1","v0.46.2","v0.46.1","v0.46.0","nightly","v0.45.0","v0.44.0","v0.43.1","v0.43.0","v0.42.2","v0.42.1","v0.42.0","v0.41.1","v0.41.0","v0.40.1","v0.40.0","v0.39.1","v0.39.0","v0.38.1","v0.38.0","v0.37.0","v0.36.4","v0.36.3","v0.36.2","v0.36.1","v0.36.0","v0.35.2","v0.35.1","v0.35.0","v0.34.1","v0.34.0","v0.33.1","v0.33.0","v0.32.2","v0.32.1","v0.32.0","v0.31.0","v0.30.1","v0.30.0","v0.29.2","v0.29.1","v0.29.0","v0.28.1","v0.28.0","v0.27.1","v0.27.0","v0.26.5","v0.26.4","v0.26.3","v0.26.2","v0.26.1","v0.26.0","v0.25.2","v0.25.1","v0.25.0","v0.24.4","v0.24.3","v0.24.2","v0.24.1","v0.24.0","v0.23.1","v0.23.0","v0.22.2","v0.22.1","v0.22.0","v0.21.2","v0.21.1","v0.21.0","v0.20.3","v0.20.2","v0.20.1","v0.20.0","v0.19.3","v0.19.2","v0.19.1","v0.19.0","v0.18.3","v0.18.2","v0.18.1","v0.18.0","v0.17.4","v0.17.3","v0.17.2","v0.17.1","v0.17.0","v0.16.0","v0.15.1","v0.15.0","v0.14.6","v0.14.5","v0.14.4","v0.14.3","v0.14.2","v0.14.1","v0.14.0","v0.13.3","v0.13.2","v0.13.1","v0.13.0","v0.12.3","v0.12.2","v0.12.1","v0.12.0","v0.11.3","v0.11.2","v0.11.1","v0.11.0","v0.10.1","v0.10.0","v0.9.1","v0.9.0","v0.8.4","v0.8.3","v0.8.2","v0.8.1","v0.8.0","v0.7.1","v0.7.0","v0.6.1","v0.6.0","v0.5.1","v0.5.0","v0.4.2","v0.4.1","v0.4.0","v0.3.0","v0.2.8","v0.2.7","v0.2.6","v0.2.5","v0.2.4","v0.2.3","v0.2.2","v0.2.1","v0.2.0","v0.1.0"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-80431.json","vanir_signatures_modified":"2026-09-27T08:04:16Z","vanir_signatures":[{"digest":{"function_hash":"124675723751343412283227646228436901329","length":1562},"id":"CVE-2026-80431-2a9b4afe","signature_type":"Function","signature_version":"v1","source":"https://github.com/kovidgoyal/kitty/commit/7d2fbaadcc2b1eeeef89bd875ec622b42362574b","target":{"file":"kitty/screen.c","function":"screen_handle_multicell_command"},"deprecated":false},{"id":"CVE-2026-80431-8678572d","signature_type":"Line","signature_version":"v1","source":"https://github.com/kovidgoyal/kitty/commit/7d2fbaadcc2b1eeeef89bd875ec622b42362574b","target":{"file":"kitty/screen.c"},"deprecated":false,"digest":{"line_hashes":["72792286790462330004774758914164571098","579768602607796312266109759146632207","288408673375767561784981786624140652804","59759986667114008691276290081129616936","203876779650048597572406135475748490132"],"threshold":0.9}}]}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V4","score":"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"}]}