A newly discovered vulnerability in iTerm2, a widely used terminal emulator for macOS, permits malicious actors to execute commands remotely by displaying specially crafted files. This security flaw affects users who open these files in compromised terminal sessions.
Understanding the iTerm2 Vulnerability
The vulnerability does not require users to execute a script or input any commands from the attacker. Simply displaying the file’s contents can activate the bug. The developers have addressed this issue in iTerm2 version 3.7.9, which was released as a security update on November 20, 2026.
Versions from 3.6.1 to 3.7.8 are susceptible to this flaw, especially those with default settings. Minseong Kim from NSHC Red Alert Labs is credited with identifying the issue, and the fix is confirmed in the vendor’s release notes. However, there have been no reports of the flaw being exploited in real-world attacks.
Technical Details of the Exploit
The root of the problem lies in iTerm2’s handling of the Kitty graphics protocol, which is designed to allow image display within a terminal. Terminals can process more than just text; they interpret escape sequences that can alter the display or trigger responses.
A GitHub advisory explains that iTerm2 processes embedded instructions instead of treating them as mere text, allowing seemingly benign files to execute commands. This issue arises from error messages in image requests that fail to discard untrusted characters, including line breaks.
The processed data is then sent to the pseudoterminal, which could interpret the line breaks as command executions, posing a significant security risk. This vulnerability is a logic flaw, differing from previous memory corruption issues.
Prevention and Mitigation Strategies
The initial fix involves replacing line breaks and control characters with spaces in Kitty graphics protocol responses, preventing the shell from executing unintended commands. Further adjustments apply similar protective measures to drag-and-drop responses and terminal title reports to ensure no unsafe characters remain.
Mac users are advised to verify their iTerm2 version and update to 3.7.9 or later via the official download page. Until the update is applied, users should avoid displaying raw data from unknown sources in iTerm2, opting instead for graphical text editors to review potentially harmful files.
Organizations managing macOS devices should confirm the update is applied across all systems, as merely updating the shell is not an adequate substitute. Providing security operations centers (SOC) with context about this threat can help in swiftly mitigating any potential incidents.
