frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Even "cat readme.txt" is not safe

https://blog.calif.io/p/mad-bugs-even-cat-readmetxt-is-not
54•arkadiyt•4h ago

Comments

Bender•3h ago
What happens if instead of 'cat readme.txt' one does 'strings -a --unicode=hex readme.txt'? Does iTerm still monkey with it?

    alias cat
    cat='strings -a --unicode=hex'
halJordan•2h ago
The whole "cat can hide unprintable characters" is such an old demo. I get this is a novel spin on which unprintable characters were doing but yeah, this was also my thought
Bender•2h ago
I'm just used to aliasing cat to strings after working around a lot of red-team penetration testers. They would prank each other and me all the time. Had to also watch out for this one [1].

[1] - https://thejh.net/misc/website-terminal-copy-paste

KerrickStaley•2h ago
> At the time of writing, the fix has not yet reached stable releases.

Why was this disclosed before the hole was patched in the stable release?

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 (https://github.com/gnachman/iTerm2/commit/a9e745993c2e2cbb30...) 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.

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.

ezoe•1h ago
I guess traditional moratorium period for vulnerability publication is going to be fade away as we rely on AI to find it.

If publicly accessible AI model with very cheap fee can find it, it's very natural to assume the attackers had found it already by the same method.

saddist0•57m ago
It’s a wrong way to look at things. Just because CIA can know your location (if they want to), would you share live location to everyone on the internet?

LLM is a tool, but people still need to know — what where how.

lxgr•29m ago
Not sure if that's a great example. If there's a catastrophic vulnerability in a widely used tool, I'd sure like to know about it even if the patch is taking some time!

The problem with this is that the credible information "there's a bug in widely used tool x" will soon (if not already) be enough to trigger massive token expenditure of various others that will then also discover the bug, so this will often effectively amount to disclosure.

I guess the only winning move is to also start using AI to rapidly fix the bugs and have fast release cycles... Which of course has a host of other problems.

CodesInChaos•2h ago
I never understood why outputting unescaped data is viewed differently from generating unenclosed html.

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.

im3w1l•2h ago
I think the problem is that 1) You want to be able to write arbitrary bytes, including shell escape sequences into files. 2) You don't want to accidentally write terminal escape sequences to stdout. 3) Stdout is modeled as a file.

Consider cat. It's short for concatenate. It concatenates the files based to it as arguments and writes them to stdout, that may or may not be redirected to a file. If it didn't pass along terminal escapes, it would fail at its job of accurate concatenation.

Now I don't mean to dismiss your idea, I do think you are on the right track. The question is just how to do this cleanly given the very entrenched assumptions that lead us where we are.

lxgr•33m ago
> that may or may not be redirected to a file

This is usually knowable.

It's a different question whether cat should be doing that, though – it's an extremely low level tool. What's wrong with `less`? (Other than the fact that some Docker images seem to not include it, which is pretty annoying and raises the question as to whether `docker exec` should be filtering escape sequences...)

TZubiri•2h ago
More like iTerm2 is not safe
ButlerianJihad•2h ago
A long, long time ago, it was literally possible to stuff the command buffer of a “dumb terminal” using ESC sequences and spoof keyboard input. So yeah, don’t count on ’cat’ being safe if your terminal isn’t!
tasty_freeze•27m ago
I did this in 1985 on SOROC terminals we had in my first job out of college. However, it depended on the dip switch settings that were under a little door on top of the keyboard.
holoduke•1h ago
With LLM tool use potentially every cat action could be a prompt injection
jdshaffer•45m ago
Is it a problem with "cat" or a terminal problem?

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?

rezonant•43m ago
As the article shows, it is a bug in iTerm2. cat is just one program that could trigger it, the key thing is outputting attacker controlled text to the terminal when the attacker can control what files are present (ie unzipping a folder that includes a specific executable file at a well chosen location that gets triggered to run when the readme is output to the terminal)
readthenotes1•33m ago
Give this one MS-DOS shell headline would be " why I never am using Microsoft again" or something dramatic like that.

It is a problem in iterm, Apple's overlay, not in the cat program. Program. At least from Reading the article. That's what I got

rezonant•23m ago
It's actually a third party terminal emulator: https://iterm2.com/
einpoklum•38m ago
Even click-baity titles are not safe.
chromacity•33m ago
Although this is cool work, keep in mind that 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.

I don't know what to do with this knowledge. I think there's this weird tension between the expectation that on one hand, basic OS-level tools should remain simple and predictable; but on the other hand, that of course you want to have pretty colors, animations, and endless customization in the terminal.

And of course, we're now adding AI agents into the mix, so that text file just needs to say "disregard previous instructions and...".

Drunk_Engineer•12m ago
An almost identical security issue in iterm2 reported 6 years ago:

https://blog.mozilla.org/security/2019/10/09/iterm2-critical...

anthk•3m ago
It is under 9front. There are not terminals, you wan windows with shells on it.

Claude Design

https://www.anthropic.com/news/claude-design-anthropic-labs
766•meetpateltech•8h ago•514 comments

A simplified model of Fil-C

https://www.corsix.org/content/simplified-model-of-fil-c
65•aw1621107•1h ago•26 comments

All 12 moonwalkers had "lunar hay fever" from dust smelling like gunpowder (2018)

https://www.esa.int/Science_Exploration/Human_and_Robotic_Exploration/The_toxic_side_of_the_Moon
187•cybermango•5h ago•101 comments

Measuring Claude 4.7's tokenizer costs

https://www.claudecodecamp.com/p/i-measured-claude-4-7-s-new-tokenizer-here-s-what-it-costs-you
508•aray07•7h ago•347 comments

Landmark ancient-genome study shows surprise acceleration of human evolution

https://www.nature.com/articles/d41586-026-01204-5
18•unsuspecting•54m ago•1 comments

Show HN: Smol machines – subsecond coldstart, portable virtual machines

https://github.com/smol-machines/smolvm
191•binsquare•6h ago•80 comments

Isaac Asimov: The Last Question (1956)

https://hex.ooo/library/last_question.html
588•ColinWright•11h ago•235 comments

I'm spending 3 months coding the old way

https://miguelconner.substack.com/p/im-coding-by-hand
101•evakhoury•7h ago•94 comments

How to Host a Blog on a Subdirectory Instead of a Subdomain

https://www.davidma.org/blog/2025-11-14-host-your-blog-on-a-subdirectory/
7•taikon•31m ago•2 comments

NASA Force

https://nasaforce.gov/
195•LorenDB•7h ago•216 comments

Arc Prize Foundation (YC W26) Is Hiring a Platform Engineer for ARC-AGI-4

https://www.ycombinator.com/companies/arc-prize-foundation/jobs/AKZRZDN-platform-engineer-benchma...
1•gkamradt_•2h ago

Middle schooler finds coin from Troy in Berlin

https://www.thehistoryblog.com/archives/75848
186•speckx•8h ago•86 comments

Are the costs of AI agents also rising exponentially? (2025)

https://www.tobyord.com/writing/hourly-costs-for-ai-agents
48•louiereederson•2d ago•1 comments

I built a 3D printing business and ran it for 8 months

https://www.wespiser.com/posts/2026-04-12-3D-Printing-Biz.html
64•wespiser_2018•2d ago•59 comments

NIST gives up enriching most CVEs

https://risky.biz/risky-bulletin-nist-gives-up-enriching-most-cves/
158•mooreds•8h ago•37 comments

Even "cat readme.txt" is not safe

https://blog.calif.io/p/mad-bugs-even-cat-readmetxt-is-not
54•arkadiyt•4h ago•22 comments

Hyperscalers have already outspent most famous US megaprojects

https://twitter.com/finmoorhouse/status/2044933442236776794
98•nowflux•7h ago•77 comments

Introducing: ShaderPad

https://rileyjshaw.com/blog/introducing-shaderpad/
24•evakhoury•2d ago•6 comments

The Unix Executable as a Smalltalk Method [video]

https://www.youtube.com/watch?v=sZjPQ7vtLNA
12•surprisetalk•1d ago•0 comments

The GNU libc atanh is correctly rounded

https://inria.hal.science/hal-05591661
36•matt_d•2d ago•2 comments

Webloc: Analysis of Penlink's Ad-Based Geolocation Surveillance Tech

https://citizenlab.ca/research/analysis-of-penlinks-ad-based-geolocation-surveillance-tech/
50•Cider9986•4d ago•0 comments

Ban the sale of precise geolocation

https://www.lawfaremedia.org/article/it-is-time-to-ban-the-sale-of-precise-geolocation
556•hn_acker•8h ago•153 comments

Healthchecks.io now uses self-hosted object storage

https://blog.healthchecks.io/2026/04/healthchecks-io-now-uses-self-hosted-object-storage/
134•zdw•8h ago•62 comments

Connie Converse was a folk-music genius. Then she vanished

https://www.bbc.com/culture/article/20260413-the-mystery-of-a-missing-folk-music-pioneer
60•mellosouls•2d ago•9 comments

Show HN: Stage – Putting humans back in control of code review

https://stagereview.app/
86•cpan22•1d ago•86 comments

Iceye Open Data

https://www.iceye.com/open-data-initiative
99•marklit•8h ago•14 comments

Detecting DOSBox from Within the Box

https://datagirl.xyz/posts/dos_inside_the_box.html
50•atan2•7h ago•14 comments

Tesla tells HW3 owner to 'be patient' after 7 years of waiting for FSD

https://electrek.co/2026/04/17/tesla-hw3-owners-be-patient-7-years-fsd/
140•breve•4h ago•95 comments

The Gregorio project – GPL tools for typesetting Gregorian chant

https://gregorio-project.github.io/index.html
53•mcookly•8h ago•9 comments

Solitaire simulator for finding the best strategy: Current record is 8.590%

https://github.com/dacracot/Klondike3-Simulator
38•PaulHoule•21h ago•17 comments