A serious security issue in iTerm2—a popular terminal emulator for macOS—allows attackers to execute malicious commands simply by getting users to view a carefully crafted file. The vulnerability, which affects versions 3.6.1 through 3.7.8, has been patched as of iTerm2 version 3.7.9, released November 20, 2026. Users are urged to update immediately.
How the Exploit Works
The bug resides in iTerm2’s handling of the Kitty graphics protocol, a system that enables programs to display images directly within the terminal. Alongside images, iTerm2 processes escape sequences—control instructions that go beyond mere text display. An attacker can embed dangerous instructions into a file that appears harmless, such as a README or log, leveraging untrusted text included in Kitty graphics error messages.
In practice, when iTerm2 receives an error in response to an image request, it can send that error back through the pseudoterminal—a channel typically used for keyboard input to the shell. Embedded line breaks in the reply can be misinterpreted as presses of the Return key, allowing portions of the attacker-controlled data to execute as commands. This is a logic bug, not a memory safety flaw.
Patch Details and Risk Mitigation
The vulnerability, discovered by Minseong Kim of NSHC Red Alert Labs, was fixed in version 3.7.9. The update filters out line breaks and other control characters from Kitty graphics protocol replies before they’re sent to the pseudoterminal, preventing shell input from being triggered unintentionally. The same sanitization has been extended to arbitrary drag-and-drop image replies and terminal title updates. Tests have been added to ensure unsafe characters are removed without undermining valid functionality.
There’s no evidence so far that this flaw has been actively exploited in the wild. Users on versions 3.6.1–3.7.8, including those with default settings, are affected. Administrators should verify every Mac under management—not assume updates have been uniformly deployed.
Recommendations Until You’re Patched
Until devices are updated to iTerm2 3.7.9 or later, users should avoid printing raw contents from unfamiliar sources directly into iTerm2. Instead, deal with suspicious files using graphical text editors. It’s critical to check the actual installed version rather than assuming update tools have already done the job.
What this means: a terminal isn’t just a window to text—it’s a potential execution environment with serious attack surface if untrusted content can slip in. This flaw underscores how escape sequences, image protocols, and other non-text data deserve careful handling. Going forward, terminal app developers and security teams should re-evaluate trust boundaries, how terminal output is parsed, and what kinds of content get auto-processed. If this issue went unnoticed until now, others likely exist—vigilance and secure defaults matter more than ever.