• Sources: primary
  • Summary: An APC Kitty image transmit command naming a nonexistent file path with embedded newlines makes iTerm2 send an error reply to the PTY that keeps those newlines, so the shell runs the text between them as a command. The APC handler had no trust check and the reply is sent at default verbosity, so it works on default installs with bash, zsh and fish. iTerm2 3.7.9 replaces control characters with spaces in Kitty image, Kitty drag-and-drop and title reports.
  • Why it matters: Upgrade iTerm2 to 3.7.9 before printing untrusted files such as READMEs or logs, since a cat of a cloned repository was enough to execute code.
  • Background: Terminals answer some escape sequences by writing a reply into the same input stream the shell reads, which is how queries like cursor position work. When a reply echoes attacker-controlled text, control characters in it act as keystrokes, a recurring class of terminal bugs. The Kitty graphics protocol uses APC sequences to move images, including by file path.