iTerm2 has released version 3.7.9 to fix command execution triggered by displaying a crafted file. The macOS terminal could turn attacker-controlled text in a protocol response into shell input. Reading an unfamiliar document could therefore become an execution step, even when the user only intended to inspect it.
Minseong Kim of NSHC Red Alert Labs published the technical account on November 21. The official download page credits Kim and identifies 3.7.9, built November 20, as the stable security update.
Evidence status: researcher-controlled demonstration, corroborated by the maintainer’s security release and source patches. The reviewed sources identify no confirmed campaign exploiting this flaw against victims.
Displayed text crossed into shell input
The Kitty image protocol lets programs ask a terminal to display images. Its presence in iTerm2 is an implementation feature; this report concerns iTerm2, not proof of the same defect in every terminal supporting that protocol.
Kim describes a file containing hidden terminal control sequences. When those bytes reached iTerm2, its image handler generated an error message containing attacker-influenced text. Unescaped line breaks survived into the response sent back through the terminal’s input channel. The shell could interpret that response as commands typed by the user.
The user had to deliver the crafted bytes to the vulnerable terminal, for example by printing the file’s raw contents. Merely storing or downloading the document is different from displaying it this way. The researcher reports the demonstration working with bash, zsh and fish under default iTerm2 settings.
This makes repository documents, shared text files and logs relevant inspection boundaries. A text-looking filename does not establish that its contents are safe for a terminal to interpret.
The fix covers several reply paths
The first maintainer patch replaces control characters in image-response text before sending it back to the program. It also adds regression tests for the reported injection.
A follow-up patch shares that filtering across image replies, Kitty drag-and-drop replies and title reports. The release notes explicitly identify the image and drag-and-drop security fixes and the related title-report hardening.
The researcher describes affected releases as those with Kitty image support. The reviewed upstream release notice supplies the fixed version but no exact first-affected release. Avoid translating that into a claim that every historical iTerm2 version is vulnerable.
Update iTerm2 before inspecting untrusted output
- Install the official 3.7.9 stable security update. Confirm the running application’s version after completing its update and relaunch procedure. The current stable download requires macOS 13 or later.
- Treat the terminal application as part of the execution boundary. Updating the shell or the tool printing a file does not install this terminal fix.
- Until updated, avoid sending unfamiliar raw file contents to affected iTerm2 sessions. Use a viewer that does not interpret terminal control sequences. Changing shells is unsupported as a workaround for this report.
- Keep suspicious-file investigation separate from ordinary inspection. Unexpected shell activity after displaying a file warrants preserving the file and available logs through the normal incident-response process.
Caveat: the public evidence verifies a demonstration and a shipped fix, not the prevalence of attacks or a complete historical affected-version matrix.