Developer platforms, tools and supply chain
iTerm2 (macOS)
iTerm2: a file shown in the terminal can run commands (3.6.1 to 3.7.8)
iTerm2 terminal-reply command execution (macOS)
The rest of this collection is for GNU/Linux. iTerm2 is the terminal many administrators use to reach those servers, so this tool checks Macs too.
iTerm2 3.6.1 to 3.7.8 answer a Kitty graphics file-transfer request with an error reply that keeps the control characters from the request. A file that carries such a request, shown with cat README.md, makes iTerm2 type the attacker's text into your shell, which runs it, in bash, zsh and fish, on a default install. All you see is a few shell errors.
| CVE | None assigned as of 23 November 2026 |
|---|---|
| Affected | iTerm2 3.6.1 (when Kitty image file transfer arrived) to 3.7.8; 3.6.11, the newest release for macOS 12, is affected too |
| Fixed | iTerm2 3.7.9, 20 November 2026 (macOS 13 or later). No fixed release for macOS 12.4 to 12.x |
| Exploited | No attacks reported; the researcher (ii4gsp) published a complete exploit |
| Setting | "Disable potentially insecure escape sequences" does not cover it |
Quick start
-
Download the script. The repository is mirrored on GitHub and Codeberg; pick a base URL.
# BASE from GitHub: https://raw.githubusercontent.com/PrivacySafe/security-patches/refs/heads/main # BASE from Codeberg: https://codeberg.org/PrivacySafe/security-patches/raw/branch/main curl -fLO https://raw.githubusercontent.com/PrivacySafe/security-patches/refs/heads/main/developer/iterm2/iterm2-kitty-check.sh -
Read it before running it, then make it executable.
less iterm2-kitty-check.sh chmod +x iterm2-kitty-check.sh -
Check this Mac. With
sudoit also reads every user's~/Applications../iterm2-kitty-check.sh check -
Look through files you might show in a terminal (a cloned repository, a downloads folder), on a Mac or a GNU/Linux server:
./iterm2-kitty-check.sh scan ~/src/some-repo ~/Downloads
Commands
| Command | What it does |
|---|---|
check (default) |
Finds every iTerm2 in /Applications, each user's ~/Applications, Homebrew's Caskroom and through Spotlight, reads its version from its Info.plist without running it, and says whether this macOS can run the fix. Read-only. Exits 0 if no copy is affected, 1 if one is, 2 if a version could not be read |
scan PATH... |
Looks through the files under each path (skipping .git folders) for the Kitty graphics escape sequence the attack hides in text (ESC _ G), and lists files with other escape sequences that make a terminal answer (APC, DCS, device status and attribute requests) for a look by hand. Read-only. Exits 0 if nothing is found, 1 if files are listed, 2 for a bad argument |
version |
Prints the script version |
Environment: APP_DIRS (where to look for iTerm.app), SCAN_MAX_SIZE (largest file scan reads, in MB, default 20).
What to do
- iTerm2 > Check for Updates, to 3.7.9 or later, then quit and reopen iTerm2: a window that is still open runs the old code.
- On macOS 12 there is no fixed iTerm2. Upgrade macOS if you can, or use Terminal.app for files from others.
- Until you have updated, read files from others with
less(which shows escape characters as^[instead of sending them to the terminal) or in an editor, not withcat,headortail.
Before you run it
- It works with the bash 3.2 that macOS ships and needs nothing that macOS does not include.
- A file that
scanlists for review is not necessarily hostile: test captures and terminal tools use these sequences. A Kitty graphics command in a README or a text file is not something you should display.
Sources: iTerm2 downloads and release notes, the researcher's write-up, and the fixes a53b1bc and 2a63835. Status current on 23 November 2026.
The Security Patches software and this documentation are dedicated to the public domain under CC0 1.0 Universal. Other pages on privacysafe.app/docs are CC BY-SA 4.0 unless the page says otherwise.