iTerm2 Arbitrary Command Execution via Kitty Image Protocol APC Response Injection
Web page · https://ii4gsp.github.io/iterm2-rce
First seen by Oriel on .
AI summary
The page documents an arbitrary command execution flaw in iTerm2 3.6.1–3.7.8, triggered by Kitty image protocol errors that inject newline-separated commands into PTY stdin; iTerm2 fixed it in 3.7.9.
- An APC handler accepted Kitty image commands without a trust check, and a file-transmit error preserved newlines from a nonexistent file path in NSError.localizedDescription.
- The error response was sent through PTY stdin by default, where the shell treated preserved newlines as command separators; the page reports this worked with bash, zsh, and fish.
- An attacker could embed APC bytes in a file and trigger the chain when a victim printed it with cat; the APC itself was invisible, but garbled shell errors and the executed command were visible.
- The initial fix replaced C0 controls and DEL with spaces in Kitty image error responses; a follow-up shared sanitizer covered C1 controls and was applied to Kitty image, drag-and-drop, and title reports.
#iterm2 #kitty protocol #terminal security
Generated by gpt-5.6-sol. Check the original for details.
Metric trends
Last 30 days · Up to 120 recorded samples per source and metric, with reposts kept separate · First and latest retained
Points
Score reported by the source.
- Lobsters: 8, latest observation ; +7 over observed period since
Comments
Comment count reported by the source.
- Lobsters: 3, latest observation ; +3 over observed period since
Aliases
| Source | External ID | URL |
|---|---|---|
| Lobsters | j66n8x | https://ii4gsp.github.io/iterm2-rce/ Read discussion |