Hacker News Viewer

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:&#x2F;&#x2F;blog.mozilla.org&#x2F;security&#x2F;2019&#x2F;10&#x2F;09&#x2F;iterm2-critical-issue-moss-audit&#x2F;" rel="nofollow">https:&#x2F;&#x2F;blog.mozilla.org&#x2F;security&#x2F;2019&#x2F;10&#x2F;09&#x2F;iterm2-critical...</a>

4/17/2026, 11:12:04 PM


by: KerrickStaley

&gt; 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&#x27;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:&#x2F;&#x2F;github.com&#x2F;gnachman&#x2F;iTerm2&#x2F;commit&#x2F;a9e745993c2e2cbb30b884a16617cd5495899f86" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;gnachman&#x2F;iTerm2&#x2F;commit&#x2F;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&#x27;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&#x27;t know what to do with this. I think there&#x27;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&#x27;re now adding AI agents into the mix, so that evil text file might just need to say &quot;disregard previous instructions and...&quot;.

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

&gt; We&#x27;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 &#x27;cat readme.txt&#x27; one does &#x27;strings -a --unicode=hex readme.txt&#x27;? Does iTerm still monkey with it?<p><pre><code> alias cat cat=&#x27;strings -a --unicode=hex&#x27;</code></pre>

4/17/2026, 7:38:55 PM


by: jdshaffer

Is it a problem with &quot;cat&quot; 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&#x27;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&#x27;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