Multiple Security Issues in GNU Screen

135 st_goliath 70 5/13/2025, 11:28:49 AM openwall.com ↗

Comments (70)

RMPR · 2h ago
Nice write-up.

> Screen offers a multi-user mode which allows to attach to Screen sessions owned by other users in the system (given the proper credentials). These multi-user features are only available when Screen is installed with the setuid-root bit set. This configuration of Screen results in highly increased attack surface, because of the complex Screen code that runs with root privileges in this case

I wasn't aware of such a feature but I guess it's what makes stuff like tmate possible. Speaking of which, I wonder if tmux is affected by the same kind of vulnerability.

dooglius · 2h ago
No, tmux uses unix domain sockets. I have no idea why screen chose to take the setuid approach instead here; it seems totally unnecessary to have root privileges.

EDIT: Further down, TFA gives a plausible explanation: the current screen devs are not fully familiar with the code base. If so, the setuid-root approach was probably the easiest way to make the feature work in lieu of such familiarity.

JdeBP · 1h ago
screen has a lot of architectural baggage that can be traced back to its initial 1987 comp.sources.unix/mod.sources versions in some cases. Being set-UID to the superuser is one of them. See the doco for screen as it was posted in volume 10:

https://sources.vsta.org/comp.sources.unix/volume10/screen/

ngangaga · 1h ago
Kind of nuts that a tool that hasn't fixed nearly 40-year old practices is in common usage among developers. Never tell me engineers are rational people.
JdeBP · 21m ago
It's a combination of factors:

* The original author of the project has not been involved in it since 1990. The people who took it over and made it a GNU project then largely stopped working on it in 2004. The people who are now working on it are something like its 3rd or 4th wave of developers.

* Learning the internals of screen now from scratch is a lot harder than when I did it in 1987. There's an awful lot more operating system historical and portability factors, now. In 1987, it was works-on-4.3BSD-might-not-on-your-Unix.

* If you deal with pseudo-terminals cross-platform, there are still huge variations on how pseudo-terminals work and how the long-standing security issues of pseudo-terminals, identified in the 1990s, have been addressed in operating systems.

* screen is encumbered by a lot of 1980s Think. It still today diligently manages, and puts quite a lot of effort into constructing, a generated-on-the-fly TERMCAP environment variable, for example.

* Attitudes to security have changed. At least one security hole in the headlined report was actually a neat-o feature of terminals in Unix in the 1970s and 1980s.

entropie · 57m ago
For me it felt (!) like screen is pretty much obsolute since 10+ years. When tmux came I switched and never looked back and I know a few that handled it the same.
noosphr · 33m ago
Screens main use case is to open an emacs session remotely.

Tmux's main use case is to be glue for a unix IDE.

The two use cases are rather different and the tools are very specialized for them.

skydhash · 23m ago
I switched to dtach for the first case.
anthk · 14m ago
Emacs can work as a daemon.
noosphr · 7m ago
It also has tramp mode which means you can use all your local packages remotely.
DrillShopper · 9m ago
Try as I might I cannot get my fingers to re-learn the tmux keybindings. The GNU Screen keybindings are that burned into my brain.
SSLy · 1m ago
[delayed]
90s_dev · 1h ago
Nostalgia and novelty are powerful narcotics.
guappa · 28m ago
On my sistems screen doesn't have setuid.
chasil · 8m ago
In the EPEL versions of screen, I am seeing the setgid bit set only. I am guessing that later versions setuid to root?

  $ ll /usr/bin/screen
  -rwxr-sr-x. 1 root screen 495816 Feb  3  2022 /usr/bin/screen

  $ rpm -q screen
  screen-4.8.0-6.el9.x86_64
Edit: Yes, Screen 5.0.0.
fzzzy · 1h ago
screen has used setuid root for multiuser for at least 20 years. Used to use it in multiuser for remote pair programming.
fullstop · 1h ago
I guess I'm glad that I switched to tmux ages ago.
trollied · 2h ago
Yup, screen -x
qwertox · 1h ago
The problem isn't with the use of `screen -x ...` itself, but rather if `ls -l "$(which screen)"` returns something like `-rwsr-xr-x 1 root root ... /usr/bin/screen`, where the `s` in the fourth position indicates the setuid bit is set. That means the screen binary runs with root privileges.
trollied · 1h ago
I am well aware of setuid. I was informing the parent comment of which arg to use for the actual functionality.
zoobab · 1h ago
I emailed the author of GNU Screen about the lack of proper documentation about the logging to a file feature:

http://www.zoobab.com/screenrc

GNU need a better issue tracking system :-)

CelestialMystic · 31m ago
There was a Q&A with the author of Tmux. He was complaining about the lack of documentation ~16 years ago.

https://undeadly.org/cgi?action=article&sid=20090712190402

anthk · 12m ago
Tmux has been in OBSD base side several releases and documented since the first one.
CelestialMystic · 7m ago
I know. I suggest you read the Q&A I posted.
teddyh · 2h ago
Note: In Debian, GNU screen is not installed with setuid-root privileges.
perlgeek · 47m ago
And the package in Debian Stable (aka bookworm) is too old to be affected by the vulnerabilities in 5.0.0.

I used to hate that Debian always was behind on software versions, but now I use different package sources for the few applications where I really don't want to rely on old software (like browsers), and otherwise doing great with the old stuff :-)

mjevans · 36m ago
Related... https://bugzilla.mozilla.org/show_bug.cgi?id=1966096

If you're running Firefox on Debian please make sure you manually update it since the package repo's been down for a while. I filed a 'support' ticket first ( https://support.mozilla.org/en-US/questions/1510388 ) since it seemed to be the proper place, but no one seems to look at those.

jesprenj · 1h ago
Likewise in Gentoo. But in Gentoo it has SETGID for utmp group. Though I'm not sure what the implications are.
JdeBP · 42m ago
If one is in group utmp, one can mess with the login accounting database: the table of currently active logins, the log of log-ons/log-offs, and the table of per-user last logins.

https://jdebp.uk/FGA/unix-login-database.html

The login accounting system that Linux-based operating systems have inherited from Unix really has never reconciled its initial real-terminal-login-only superuser-managed design with the fact that non-superuser programs that allocate pseudo-terminals (e.g. any local terminal emulator, NeoVIM, tmux, screen) want to (over)write entries for those pseudo-terminals in the login accounting database to make the output of the "who" command (and its ilk) more complete.

The best approach I've seen was to re-think the idea; have the pseudo-terminal-using programs run entirely unprivileged and use a client-server model where only the server actually has access to the database files.

Laurent Bercot did this. It fixes many holes, including that the log of log-ons/log-offs is made truly append-only (modulo superuser access to the underlying files). But it has the same architectural problem that any client in the group can overwrite any currently active login record if it knows the record ID, which by design (and the Single Unix Specification) there's an API for enumerating.

* https://skarnet.org/software/utmps/

Both the BSDs and M. Bercot have improved the situation with pututxline(), but it's still not out of the woods yet.

anthk · 11m ago
I set TMPDIR to $HOME/tmp because of that.
jmclnx · 49m ago
Slackware 15:

lrwxrwxrwx 1 root root 12 Feb 11 2022 /usr/bin/screen -> screen-4.9.0

-rwxr-xr-x 1 root root 455016 Feb 1 2022 /usr/bin/screen-4.9.0

no suid

ktm5j · 1h ago
Looks like it is in Fedora.
mlichvar · 40m ago
On Fedora it is setgid screen, not root.
tmtvl · 54m ago
Likewise in Arch.
znpy · 56m ago
I wonder if there is some selinux policy to reduce the attack surface
mmsc · 2h ago
It's surprising that upstream was involved in this. Around 5 years ago, I came to the (sad) conclusion that GNU screen development had completely halted. Is that still not the case?

Does screen have the functionality to add a new window to an existing screen without attaching to the screen yet?

jzb · 1h ago
Upstream requested that the SUSE team take a look at it. It seems that development is understaffed and the upstream may not have the expertise to maintain it properly. Which, if true, is sad -- I know that tmux and others exist, but a lot of people have used Screen for many many years. It sucks when a tool bitrots.
marcosdumay · 20m ago
Looks like a tech-debt ridden large piece of software that new developers just can't understand.

If that's the case, it's not really about it being "understaffed". Instead, it's doomed to rot until it's replaced of rewritten. There's no scenario where more maintainers will help, except for marginally delaying it.

The good news is that there are almost perfect replacements out there, and most of them are leaner.

criddell · 27m ago
It’s not necessarily sad for GNU tool development to stop (other than bug fixes, of course). I would take that as a sign that they are basically complete.
croemer · 1h ago
Involved only insofar as shipping it as setuid-root counts. Distros that configure it like this are vulnerable, others aren't. Very thin involvement I'd say. Distros patch if upstream is too slow.
mmsc · 1h ago
TFA says upstream asked for the review.
croemer · 20m ago
Right, I got the direction wrong.
immibis · 55m ago
Open source does have a problem with inertia whenever one piece of software ends and another piece is created to replace it, but there's no immediate incentive to switch, because it is a switch, not an update.

Though conversely, when someone buys the trademark for an existing piece of software, and replaces it with something entirely different, like what happened with Audacity, that's also bad. So there's no good solution.

Wowfunhappy · 44m ago
Isn't this what distros are for? So e.g. Debian could decide to replace screen with tmux, possibly with some sort of compatibility package that takes all the same command line arguments as screen but uses tmux under the hood. (I've used screen very little and have never used tmux so I'm not sure if that would make sense in this context).
marcosdumay · 17m ago
You can reconfigure the key-bindings, that I guess would be the largest annoyance for a new user. But there are many fundamental differences between them that you just can't hide.
kevin_thibedeau · 28m ago
Tmux doesn't support serial ports.
PhilipRoman · 15m ago
I'm not sure what made "screen" integrate the two separate pieces of functionality - you can use something minimal like "tio" for serial port access and it's much more elegant.
Trasmatta · 1h ago
> Due to difficulties in the communication with upstream we do not currently have detailed information about bugfixes and releases published on their end.

It sounds like they requested the security review, but have been difficult to keep in touch with? I'm not sure what the whole story is there.

mmsc · 1h ago
Seems like a prime target for Jia Tan.
tecleandor · 1h ago
Yep, from the timeline it looks like lack of communication (and maybe also capabilities/resources/time/will, not sure) [0]

  0: https://security.opensuse.org/2025/05/12/screen-security-issues.html#8-timeline
jedimastert · 1h ago
warpeggio · 2h ago
So ... my tmux lifestyle is objectively superior in this one respect. Excellent.
exploderate · 59m ago
Yes, that's why all the cool kids switched to tmux 17 years ago. The only argument the screen camp had was "no serial port support in tmux". To which we answered something about a smaller more modern code base...
worldsavior · 1h ago
mistrial9 · 1h ago
so it appears that packaged Debian `screen` is not installed with root execution, therefore this entire situation is not a problem on Debian?
anthk · 21m ago
Then:

Unix: Small, light, mediocre OS for underpowered microcomputers. Either crash silently, or cut down the bloat.

MIT/GNU: Correct systems first. Plenty or resources. Lisp. Detect the errors, fix and step over them, continue the process.

Now:

GNU=Ugly bloated umUnix like, mega light Elisp editor but s l o w and prone to lock. Good FS' on Linux. FDo it's mainly Red Hat bloatware. Screen does too much.

OpenBSD=Correctness, ISC licensed mainly. Unix bound, small tools, but so-so FFSv2. Sndio works. Audio, video and so on perms work, no DBUS needed. CWM it's really fast and much easier than I3. Dumb config, fvwm looks like rocket science. Tmux, no screen(1) except for ports. Snappy, easy to config and script. Use damn cu(1) for serial, thanks.

Trasmatta · 2h ago
Only tangentially related, but I'm always fascinated that mailing lists are still a thing in 2025.
teddyh · 1h ago
Please, inform us of an alternative which is:

• Non-proprietary

• Federated

• Archivable

• Accessible

• Not dependent on a specific company

zoobab · 1h ago
GIT promised to be "Non-proprietary, Decentralized" but still does not have a built-in issue tracker :-)
HappMacDonald · 1h ago
GIT is non-proprietary and decentralized so it keeps that promise.

And having a built-in issue tracker

1. isn't related to those properties, and

2. isn't truly within the scope of a source code version control management solution.

That's the domain of project management.

graemep · 26m ago
Fossil has one. If its something you want use Fossil - which I think is a great alternative for small teams, on the other hand, this is probably not something large teams (which are a high priority for git) want.
somat · 50m ago
Shouldn't the git native issue tracker be as simple as adding file pr/the_problem_i_am_having
badmintonbaseba · 34m ago
Issues shouldn't really live in the same source tree, IMO. But AFAIK there are forges that keep the issues in the same repository, just not in the same tree of commits that the source tree has, git notes style.
delfinom · 45m ago
For large projects like the Linux kernel as an example out of many, I would assume the built-in issue tracker would end up 100x the size of the code base in storage space. lol
Trasmatta · 1h ago
I wasn't criticizing the use of them, I just find it fascinating that we still use them. They'll probably still be around in some form in another 3 decades.
walterbell · 1h ago
Email is a root-of-trust for authentication in most non-email systems.
KolmogorovComp · 1h ago
My qualm against them is rather different. Why, after so much time, are they still so user-hostile, both in their web appearance and more generally usage?

It's rhetorical of course, it's because their users are completely blind to their pitfalls after decades of use, and it seems that generation-renewal is not a priority.

Discord servers and other contemporary solutions are much worse on the long run, but it does not matter. Software is like startups, long term is not a goal when you are not sure to survive (or in that case, being used and having contributors) next week.

skydhash · 1h ago
I don’t think GitHub adds that much over using and contributing to software. I generally prefer when the project have its own website and a proper about and documentation section.

As far as contributing go, coding a bug fix or a new features takes way longer than figuring how sending patch over mail works (for the extreme case) and you only need to do it once.

And opensource is not a popularity contest.

jzb · 1h ago
"Discord servers and other contemporary solutions are much worse on the long run, but it does not matter. Software is like startups, long term is not a goal when you are not sure to survive (or in that case, being used and having contributors) next week."

I don't think I've read anything that I disagree with so strongly in a while. "Software is like startups" is about as user and contributor-hostile a concept as they come.

The long term absolutely matters and projects choosing convenience today over long-term thinking are screwing over their future. It's damn near impossible to find information about these projects outside the proprietary silos they've dug themselves into and they will regret the choice one of these days when Discord or whatever proprietary service starts tightening the screws to make money.

I'm not sure what you find hostile about their web appearance. It's a light, clean page with text that doesn't throw tons of JS at you, pop-ups, or a cookie accept/reject/ponder bullshit dialog. It could use a bit of a copy edit / redo and a screenshot (I always complain when a project doesn't have screenshots...), but I don't find it hostile in the least.

mistrial9 · 1h ago
> The long term absolutely matters and projects choosing convenience today

I would be happy to engage on that thought, but here on this thread there is a lynchmob gathering to declare an emergency to remove all GPL-connected code everywhere, again.. because `screen`

immibis · 51m ago
A mailing list is just a kind of public group chat. You're probably in many public group chats, including this one right now. Mailing lists, IRC, traditional web forums, Discord, WhatsApp are all implementations of the same basic concept.

Like any implementation, it comes with certain affordances which differ from other implementations.

Messages feel "heavy" for several reasons: sending one involves a lot of clicks (or keypresses); if you send a very high number you may be banned from your email provider, and unable to communicate with anyone.

Messages often arrive instantly, but can be delayed up to hours or days, so conversation round-trips are kept to a minimum.

Messages are all the same - there are no "lite messages" such as emoji reactions - so any message must contain enough content to justify being a full-fledged message, or it won't be sent at all. (Sometimes an "emoji reaction" is felt to be enough content to justify a full-fledged message, which is sent.)

Being off the web increases the barrier to entry, reducing the eternal september effect (ironically, Usenet is one of the least eternal-september-ish of the public discussion boards currently in existence).

Overall, the feel of the system tends to somewhat discourage quantity and encourage per-message quality.