2026-10-04 19:10 UTC
A parasitic Fibonacci computation inside /usr/bin/top
----
- 2 days ago | 14 points | 4 comments
- URL: https://seriot.ch/computation/terminfo/
- Discussions: https://news.ycombinator.com/item?id=49935250
- Summary: The article demonstrates that ncurses terminfo's parameter expansion language can simulate a two-counter Minsky machine, making it computationally universal under idealized unbounded counters and expansion steps. It provides examples: an addition machine (4+9=13) and a Fibonacci sequence generator, both executed by repeatedly expanding the `cup` capability via `tput -S`. A variant uses `/usr/bin/top` as an external clock, redrawing the screen and triggering cursor moves that advance the machine. The author notes that while terminfo lacks internal loops, repeated expansions provide the clock. Security implications are discussed: the behavior is a hack, not a bug, and terminfo expansion cannot open files or execute commands, so it poses no privilege escalation risk unless the parser itself is vulnerable. The conclusion emphasizes that terminfo is a small stateful programming language, not just passive terminal metadata.
Replies (0)
No replies.