iTerm2 vulnerability: cat on a crafted file runs commands
Part of the iTerm2 story · since 21 Nov
- Sat 21 Nov, 19:59 UTC. cybersixt, first report. iTerm2 vulnerability: cat on a crafted file runs commands. This article, 1st of 1.
iTerm2, a popular terminal app for macOS, has fixed a flaw that let a booby-trapped file run commands on a Mac as soon as its contents were printed in the terminal, for example with cat. Version 3.7.9, built on Friday, is labelled a security update. Its changelog says a crafted file "could run arbitrary commands by abusing the Kitty image and drag-and-drop protocols."
The researcher who found it, Minseong Kim of NSHC Red Alert Labs, published a full write-up with proof-of-concept code on Saturday, and the iTerm2 changelog credits Kim for the report. Kim, who posts as ii4gsp, wrote on X that it needs "no configuration changes, no special tools, default installation."
No CVE has been assigned yet. Kim's researcher page lists the bug as "CVE-pending".
How the attack works
iTerm2 supports the Kitty graphics protocol, which lets programs send images to the terminal inside escape sequences that the terminal reads and does not display. According to the write-up, an attacker hides one of these sequences in an ordinary file and asks iTerm2 to load an image from a file path that does not exist. The path contains newline characters with a command between them.
Because the file is missing, iTerm2 builds an error reply from macOS's own error message, which keeps the newlines from the path. It then writes that reply back into the terminal's input, the same channel the keyboard uses. The shell reads each line as if the user had typed it, so the line holding the attacker's command runs. Kim's proof of concept hides the sequence in a README.md file and opens Calculator.
Kim describes three weaknesses that combine. iTerm2 did not apply to these sequences the trust check it uses for other escape sequences; the error path kept literal newlines; and the reply was always sent under the default settings. A check for unsafe file names existed, but it only ran after the file was found, so it never ran for a missing one. The write-up says the attack works in bash, zsh and fish. The user does see garbled shell errors around the injected command, and Kim says hiding that output "was not explored".
Who is exposed
Any file printed to the screen can carry the sequence: Markdown, text, logs, CSV, configuration files or source code. Kim lists git repositories, shared folders, archives and email attachments as ways to deliver one. According to the write-up, every iTerm2 version with Kitty image protocol support is affected.
Kim also explains why a trust check alone would not have protected most users. iTerm2 treats the terminal as trusted unless the advanced setting "Disable potentially insecure escape sequences" is turned on, and it is off by default. Cleaning the replies themselves is what closes the hole for everyone.
The fix and affected versions
The developer fixed the bug in two commits. The first replaces every control character in Kitty image replies, including newline and escape, with a space. The second applies the same cleaning to two more paths that echoed attacker-influenced text back into the terminal input: Kitty drag-and-drop messages and window title reports.
Version 3.7.9 requires macOS 13 or later. The newest build for macOS 12 on the download page, 3.6.11, dates from June, before the fix, and the 3.6 line already handled Kitty images: its February 3.6.7 release lists fixes to the Kitty image protocol. iTerm2 has not said whether the 3.6 line is affected.
What to do
Update to iTerm2 3.7.9 through the app's built-in update check or from the download page. The release notes give no other workaround.
A second iTerm2 command bug this month
It is the second iTerm2 flaw in November that lets an attacker run commands. CVE-2026-123014, published on November 5, is an argument injection in iTerm2's x-man-page: link handler, fixed in 3.7.7beta2. NVD describes it as the result of an incomplete fix for CVE-2023-46321; that one needed the victim to open a crafted link. A CVE number for the Kitty image bug is still awaited.
How the story developed
1 article from 1 outlet since 21 Nov. Still developing; the latest report was 44 minutes ago. This was the first report.
- Sat 21 Nov, 19:59 UTC. cybersixt, first report. iTerm2 vulnerability: cat on a crafted file runs commands. This article, 1st of 1.
- No CVE
- Larger: an outlet’s first report
- Coverage over time
Show all 1 articles as a listHide the list
- Sat 21 NovDay 01
- iTerm2 vulnerability: cat on a crafted file runs commands19:59 · cybersixt · First report · This article, 1st of 1
Sources
- iTerm2 3.7.9 changelogPrimary sourceiterm2.com
- iTerm2 RCE via Kitty Image Protocol APC Response InjectionPrimary sourceii4gsp.github.io
- ii4gsp on Xx.com
- Minseong Kim researcher pageii4gsp.github.io
- Kitty graphics protocol specificationsw.kovidgoyal.net
- iTerm2 commit a53b1bc: sanitize Kitty graphics responsesPrimary sourcegithub.com
- iTerm2 commit 2a63835: strip control characters from report pathsPrimary sourcegithub.com
- NVD CVE-2026-123014nvd.nist.gov
More reporting
- Upload2Shell: Ghostscript CVE-2026-125396 lets uploads run code21 Nov
- GL.iNet GoodCloud flaw used to plant malware on routers, KVMs21 Nov
- FBI hacked again as NCIC crime database is breached21 Nov
- 1984 Hosting hack takes sites offline, blamed for XMR1 theft21 Nov
- Hugendubel cyberattack knocks shop and tolino cloud offline21 Nov
Written by CyberSIXT from the sources above.How we reportCorrectionsRSS