Even "cat readme.txt" is not safe
by arkadiyt on 4/17/2026, 6:43:32 PM
https://blog.calif.io/p/mad-bugs-even-cat-readmetxt-is-not
Comments
by: Drunk_Engineer
An almost identical security issue in iterm2 reported 6 years ago:<p><a href="https://blog.mozilla.org/security/2019/10/09/iterm2-critical-issue-moss-audit/" rel="nofollow">https://blog.mozilla.org/security/2019/10/09/iterm2-critical...</a>
4/17/2026, 11:12:04 PM
by: KerrickStaley
> At the time of writing, the fix has not yet reached stable releases.<p>Why was this disclosed before the hole was patched in the stable release?<p>It's only been 18 days since the bug was reported to upstream, which is much shorter than typical vulnerability disclosure deadlines. The upstream commit (<a href="https://github.com/gnachman/iTerm2/commit/a9e745993c2e2cbb30b884a16617cd5495899f86" rel="nofollow">https://github.com/gnachman/iTerm2/commit/a9e745993c2e2cbb30...</a>) has way less information than this blog post, so I think releasing this blog post now materially increases the chance that this will be exploited in the wild.<p>Update: The author was able to develop an exploit by prompting an LLM with just the upstream commit, but I still think this blog post raises the visibility of the vulnerability.
4/17/2026, 9:01:20 PM
by: chromacity
This is cool work, but it's also somewhat unsurprising: this is a recurring problem with fancy, richly-featured terminal apps. I think we had at least ten publicly reported vulns of this type in the past 15 years. We also had vulnerabilities in tools such as less, in text editors such as vim, etc. And notably, many of these are logic bugs - i.e., they are not alleviated by a rewrite to Rust.<p>I don't know what to do with this. I think there's this problematic tension between the expectation that on one hand, basic OS-level tools should remain simple and predictable; but on the other hand, that <i>of course</i> we want to have pretty colors, animations, and endless customization in the terminal.<p>And of course, we're now adding AI agents into the mix, so that evil text file might just need to say "disregard previous instructions and...".
4/17/2026, 10:50:38 PM
by: bananaboy
I used to use iTerm2. I had no idea it was doing all of this behind my back. That’s not what I want my terminal to do!
4/17/2026, 11:41:34 PM
by: SrslyJosh
> We'd like to acknowledge OpenAI for partnering with us on this project<p>Thanks, saved me some reading time.
4/17/2026, 11:30:33 PM
by: Bender
What happens if instead of 'cat readme.txt' one does 'strings -a --unicode=hex readme.txt'? Does iTerm still monkey with it?<p><pre><code> alias cat cat='strings -a --unicode=hex'</code></pre>
4/17/2026, 7:38:55 PM
by: jdshaffer
Is it a problem with "cat" or a terminal problem?<p>If I wrote my own version of cat in C, simply reading and displaying a single TXT character at a time, wouldn't I see the same behavior?
4/17/2026, 10:39:22 PM
by: valleyer
Wait, so... cat -v <i>not</i> considered harmful, then?
4/17/2026, 11:35:02 PM
by: CodesInChaos
I never understood why outputting unescaped data is viewed differently from generating unenclosed html.<p>Like why doesn't `println` in a modern language like rust auto-escape output to a terminal, and require a special `TerminalStr` to output a raw string.
4/17/2026, 9:09:16 PM
by: delduca
Is ghostty vulnerable?
4/17/2026, 11:36:54 PM
by: TZubiri
More like iTerm2 is not safe
4/17/2026, 9:15:44 PM
by:
4/17/2026, 7:01:46 PM
by: anthk
It is under 9front. There are not terminals, you wan windows with shells on it.
4/17/2026, 11:20:46 PM
by: einpoklum
Even click-baity titles are not safe.
4/17/2026, 10:46:05 PM
by: holoduke
With LLM tool use potentially every cat action could be a prompt injection
4/17/2026, 9:32:54 PM
by: biglio23
[flagged]
4/17/2026, 10:52:45 PM