iTerm2 Flaw Allows Shell Command Execution When Displaying Crafted Files
Vulnerability Disclosure · 3 sources · Updated 3d ago · First seen Nov 21, 2026

A command-execution vulnerability in iTerm2 allows malicious files to trigger arbitrary shell commands simply when their contents are displayed in a vulnerable terminal session, without executing a script or pasting a command. The flaw affects installations with Kitty image protocol support, with reported affected versions spanning 3.6.1 through 3.7.8, including default configurations. Researcher ii4gsp reported that the exploit works across bash, zsh, and fish without memory corruption or a race condition.
The exploit chains a missing trust check in Application Program Command (APC) handling with unsafe Kitty file-transfer error responses. A crafted file path causes literal newlines to survive in an error reply written to pseudoterminal input, where the shell interprets them as command separators. iTerm2 3.7.9 fixes the issue by filtering control characters from replies. The vendor’s release notes do not report exploitation in the wild. Organizations should update to 3.7.9 or later and avoid displaying unfamiliar files as raw terminal output until patched.


