iTerm2 Arbitrary Command Execution via Kitty Image Protocol APC Response Injection
Summary
iTerm2's Kitty image protocol contains a vulnerability that allows arbitrary command execution via APC response injection. The article outlines the root causes (missing terminal trust checks, newline-preserving error messages from NSError.localizedDescription, and writing responses to PTY stdin), affected versions, exploitation flow, PoC, and patches that sanitize outputs to mitigate the issue. This is presented as a reproducible logic bug affecting default installations across shells, with remediation focusing on updated fixes and safer response handling.