Xterm code execution via font ops
openwall.com
openwall.com
-- $XTermId: README,v 1.3 2007/05/24 19:49:19 tom Exp $
-- Below is the original README for xterm from 1991, for your amusement.
-- For a better overview, see http://invisible-island.net/xterm/
Abandon All Hope, Ye Who Enter Here
This is undoubtedly the most ugly program in the distribution. It was one of
the first "serious" programs ported, and still has a lot of historical baggage.
Ideally, there would be a general tty widget and then vt102 and tek4014
subwidgets so that they could be used in other programs. We are trying to
clean things up as we go, but there is still a lot of work to do.
If you are porting this to a machine that has problems with overlapping
bcopy's, watch out!
There are two documents on xterm: the man page, xterm.man, which describes
how to use it, and ctlseqs.ms, which describes the control sequences it
understands.Around computers it is difficult to find the correct unit of time to measure progress. Some cathedrals took a century to complete. Can you imagine the grandeur and scope of a program that would take as long?
-- Epigrams in Programming, ACM SIGPLAN Sept. 1982
Well, we have our cathedrals in programing, only we as as software engineers tend to be barbarians and call them "legacy code" or "obsolete systems" or "needs to be torn down and replaced with something new". Think of when people do this to actual cathedrals.I like xterm, use it daily, I think Thomas Dickey is a pretty great guy for his role in maintaining the program.
But then I look through apt or yum and see so many fresh faced usurpers, many written in modern languages... and also hear the same laments that Xterm is "unmaintainable". I didn't think of it as someone's cathedral. I'll put the shovel down. ;)
I think by now, both users have adjusted their settings.
I don't think it does, though. This is based only on my rough memory that I used to use nvim and zsh and didn't notice that.
See the docs: https://github.com/zsh-users/zsh/blob/f8d93888a8efd6c8142e74...
Relevant code: https://github.com/zsh-users/zsh/blob/f8d93888a8efd6c8142e74...
https://sources.debian.org/src/xterm/261-1/debian/changelog/...
so yeah, kind of a big deal, except not really, looks like some folks were already careful with that possibly dangerous setting. :)
> It so happens ^G is in Zsh when in vi line editing mode bound to "list-expand". Which can run commands as part of the expansion leading to command execution without pressing enter!
The exploit is "sending something that looks like user input that can also contain ^G"
Control sequences should not trigger key presses. That's a recipe for disaster.
I think its entirely reasonable for a terminal program to bind any key it wants to execute a command.
However, I think the design of the Unix tty subsystem is also at fault here - out-of-band messages (OSC/APC/DCS/PM) should be filtered out by default and only delivered to processes which explicitly declare that they are expecting them.
That said, if zsh is putting the tty in raw mode, it is saying it wants everything the terminal will send it, so it needs to do that filtering itself.
I find xterm works great with tmux plus I can easily change font size on the fly without any issues. Change font sizes on other terminals is either not allowed or sometime (rarely) corrupts the display.
But what I do notice is that xterm is the only program that shows things like ncurses (i.e. mc, tree, etc.), and tmux, and language/locale correctly on everything.
I can get 1-2 of the above items but never all of them. (Konsole does a great job too, but xterm opens faster on my i3 setup.) I've manipulated my various dotfiles, and tried multiple combinations but xterm works 100% of the time.
But maybe you don't care about that. 90% of the time, I don't.
I don't want my servers to be cutesy.
Other TEs, especially libvte-based ones, are more like crappy xterm emulators.
So there are reasons to want xterm, specifically.
Other terms as you say, suck.
BTW, does this work under OpenBSD and ksh with "set -o vi"?
It starts up fast and reads text comparably fast, and it works great with most console programs. It doesn't try to reflow text when resizing, which simply can't be done correctly. Most other terminals try to reflow and it is frequently a mess (last I checked is long ago)...
Another reason I like xterm is that it's one of the few left that support bitmap fonts, and on old low-res screens those are much better legible. (On more modern displays with DPI > 150, it starts to become difficult to find large enough bitmap fonts.)
You can also set .Xresources, but that's a bit more complicated.
It's enabled by default upstream.
https://invisible-island.net/xterm/manpage/xterm.html#VT100-...
https://src.fedoraproject.org/rpms/xterm/blob/rawhide/f/xter...
Interesting idea, but I don't think that's what happens:
https://sources.debian.org/src/xterm/375-1/debian/rules/#L22
I don't know if this is helpful or just annoying unsolicited "advice"