Multiple validation and resource-management flaws in Ghostty's handling of the Kitty graphics protocol allow attacker-controlled terminal output to crash or hang Ghostty, consume excessive memory, alter the terminal's graphics state, and, on Unix-like systems in limited circumstances, make Ghostty read or delete unintended local files.
A victim must cause malicious output to be displayed, for example by running a malicious program, viewing a crafted file, or connecting to an attacker-controlled remote host, but Ghostty does not prompt before processing the graphics commands.
Temporary-file path restrictions: Temporary directory checks used byte-prefix comparisons, so sibling directories such as /tmpX were treated as if they were inside /tmp . A temporary-file transmission could read and unlink a file outside the spec-permitted directories.
Placement geometry validation: Protocol-controlled dimensions and offsets were used in unchecked arithmetic and iteration. Maximum values could panic in safety-enabled builds, wrap in optimized builds, underflow into enormous page traversals, overflow visibility calculations, or make cursor movement loop billions of times.
Opened-file path validation: File paths were canonicalized and validated before opening, leaving a time-of-check/time-of-use race in which a cooperating local process could replace a symlink or directory entry and make Ghostty read a blocklisted target.
Shared-memory range validation: Shared-memory offsets and sizes were not checked against the mapped object before slicing, and raw image dimensions were multiplied before being bounded. Malformed commands could panic or request incorrectly wrapped allocations.
PNG decoder allocation limits: PNG dimensions were checked only after decoding, while Wuffs permits decoded images approaching 4 GiB. A very small crafted PNG could therefore cause a multi-gigabyte allocation and severe memory pressure before rejection.
Fixed in Ghostty v1.4.0.
There is no viable workaround in affected versions except to avoid any untrusted programs that could transmit Kitty graphics protocol sequences.
The full story
This article is one source in a clustered incident — the cluster page carries the summary, timeline and every other outlet covering it.
