News for hackers. Stuff that matters.
Re:Heap-based buffer overflow in Sudo by miohtama on Tuesday January 26, 2021 @05:43PM (#25921917)
Another question is who wants to maintain four decades old GNU C soup? It was written at a different time, with different best practices.

In some point someone will rewrite all GNU/UNIX user land in modern Rust or similar and save the day. Until this happens these kind of incidents will happen yearly.

Re:Heap-based buffer overflow in Sudo by im3w1l on Tuesday January 26, 2021 @06:06PM (#25922106)
Rewriting sudo is a weekend project*. Getting people to adopt it is a many-year political campaign.
Re:Heap-based buffer overflow in Sudo by toyg on Tuesday January 26, 2021 @06:16PM (#25922185)
You can bet your last dollar that if the "right" RedHat or Debian developer rewrote sudo with feature parity, it would be adopted by all major distros in a couple of months. It's the sort of thing nobody really cares about except OpenBSD (which wrote their own).

The problem is feature parity. Most rewrites cannot guarantee that off-the-bat, so they end up struggling to persuade people to switch - why break stuff that works just fine and lose features, in the name of some engineering purity?

Re:Heap-based buffer overflow in Sudo by axaxs on Tuesday January 26, 2021 @06:22PM (#25922240)
Poettering to save the day with systemd-sudo?
Re:Heap-based buffer overflow in Sudo by kuschku on Tuesday January 26, 2021 @06:50PM (#25922455)
Polkit-exec (pkexec) already exists, has much better security, and integrates with your DE instead of expecting passwords on the terminal.
Re:Heap-based buffer overflow in Sudo by deckard1 on Tuesday January 26, 2021 @07:54PM (#25922917)
This thing?

https://gitlab.freedesktop.org/polkit/polkit/-/blob/master/s...

Which also seems to not have tests. In fact, the only tests I'm seeing are from 2 years ago.

https://gitlab.freedesktop.org/polkit/polkit/-/tree/master/t...

> has much better security

It's using D-bus. My faith in D-bus security is close to my faith in seeing a fresh Linux install with zero D-bus error messages from apps. Which is to say, nonexistent.

> integrates with your DE instead of expecting passwords on the terminal.

There's nothing inherently insecure about passwords on the terminal, and certainly nothing a DE can do better. I have yet to see a display manager or lock screen app that knows what the hell PAM is doing. Try doing even the simplest things with PAM, such as getting a fingerprint reader or Yubikey working, and every single display manager simply chokes.

I'm not sure which is more of a Byzantine mess: Linux authentication and authorization, or Linux audio.

Re:Heap-based buffer overflow in Sudo by megous on Tuesday January 26, 2021 @08:26PM (#25923141)
PAM is fun. https://github.com/systemd/systemd/issues/16813

With all the .so modules loading into some process, etc. Some questionable design in sshd makes it lock up completely for all incoming connections when used with PAM and when pam module ends up in infinite loop.

Nevermind that systemd pam modules pull in a shitton of stuff, including dbus, into any process that tries to use PAM for auth, these days.

I guess it all runs as root, too. sshd at least tries to fork a child for all this and waits for it and kills it, so that the parent process can't be polluted. It just has no timeout when waiting for result, and doesn't accept further connections when waiting.

Sometimes it's better not to look too deep under the covers.

Re:Heap-based buffer overflow in Sudo by eklitzke on Wednesday January 27, 2021 @04:43AM (#25926163)
How else would you implement PAM? The whole point is that you can write arbitrary code to implement whatever custom authentication policy you have, so it needs to be able to dlopen things. And if you don't like the PAM policy written by your distro, you're free to change it by implementing your own authentication policies, or dropping things you don't care about (like systemd, you can configure PAM to just use /etc/passwd and /etc/shadow if you like).

sshd needs to run as root (obviously) because it grants login shells to people, so it needs to run in a privileged context. And the PAM modules it executes also need to be run as root, because PAM modules need to do things like read /etc/shadow.

Re:Heap-based buffer overflow in Sudo by JoachimSchipper on Wednesday January 27, 2021 @12:04PM (#25930649)
https://man.bsd.lv/login.conf.5#AUTHENTICATION documents OpenBSD's system, which revolves around running /usr/libexec/auth/login_<foo>. OpenBSD's system doesn't let you do the stack-of-libraries thing that PAM does, but having one binary is a lot simpler.

(In the past, OpenBSD had a login-locally-or-via-Kerberos binary there, which does show the downside of that approach over PAM's more flexible approach.)

Re:Heap-based buffer overflow in Sudo by vbezhenar on Wednesday January 27, 2021 @05:10AM (#25926352)
Does it work without GUI?
Re:Heap-based buffer overflow in Sudo by magicalhippo on Tuesday January 26, 2021 @06:37PM (#25922360)
Re:Heap-based buffer overflow in Sudo by rogerbinns on Tuesday January 26, 2021 @06:20PM (#25922220)
That would indeed be a huge feat of programming skill! I refer you to the configuration file documentation to treat as a spec: https://www.sudo.ws/man/1.8.3/sudoers.man.html

Implementing a subset of sudo is a weekend project, for some values of useful.

Re:Heap-based buffer overflow in Sudo by jeffbee on Tuesday January 26, 2021 @06:29PM (#25922294)
That's part of the dark outcome of so many untested features: it makes it easy to cast FUD upon any potential replacements. As we have no black-box test suite that shows `sudo` implements all of these features, so we also cannot have faith that any replacement would. Ideally it should be possible to run sudo's black box tests against any potential replacement. To start with, we need those tests.
Re:Heap-based buffer overflow in Sudo by arp242 on Tuesday January 26, 2021 @08:07PM (#25923014)
There are actually a bunch of tests for the sudoers file format.
Re:Heap-based buffer overflow in Sudo by masklinn on Wednesday January 27, 2021 @01:41PM (#25932069)
> Implementing a subset of sudo is a weekend project, for some values of useful.

openbsd dropped sudo for "weekend project" `doas`, in no small part because it does not support most of that stuff.

Here's the configuration file documentation: https://man.openbsd.org/doas.conf.5

Re:Heap-based buffer overflow in Sudo by stouset on Wednesday January 27, 2021 @12:03AM (#25924507)
This is why OpenBSD has `doas`.
Re:Heap-based buffer overflow in Sudo by umvi on Tuesday January 26, 2021 @05:52PM (#25921993)
> It was written at a different time, with different best practices.

Not that I have any faith in modern "best practices". I'm imagining `grep` written in modern a modern language like JS and I shutter when I think of the hundreds of micro-dependencies like "left-pad" that would need to be downloaded to make it work.

Maybe it's fair to say that systems programming languages are in a better state in terms of modern best practices than scripting languages.

Re:Heap-based buffer overflow in Sudo by acdha on Tuesday January 26, 2021 @10:15PM (#25923817)
Try https://github.com/BurntSushi/ripgrep – it’s across the board better, and one of the best personal productivity boosts you can make if you use grep frequently.
Re:Heap-based buffer overflow in Sudo by masklinn on Wednesday January 27, 2021 @01:48PM (#25932158)
> Not that I have any faith in modern "best practices". I'm imagining `grep` written in modern a modern language like JS and I shutter when I think of the hundreds of micro-dependencies like "left-pad" that would need to be downloaded to make it work.

You don't have to imagine: `ripgrep` exists and has all of 10 direct dependencies, 4 of which by the same author because they extracted features / systems from ripgrep (or developed them separately from the start) as they were useful on their own e.g.

* regex, for obvious reasons

* ignore to match and apply ignorefiles (gitignore and friends which ripgrep takes in account by default)

* bstr for conventional utf8 strings rather than guaranteed

* grep intends to be essentially "ripgrep as a library"

Re:Heap-based buffer overflow in Sudo by megous on Tuesday January 26, 2021 @08:32PM (#25923199)
I actually like some modern grep alternatives, like `ag`.
Re:Heap-based buffer overflow in Sudo by young_unixer on Tuesday January 26, 2021 @06:06PM (#25922104)
> someone will rewrite all GNU/UNIX user land in modern Rust or similar

Or everyone just switches to musl + busybox.

Re:Heap-based buffer overflow in Sudo by anthk on Tuesday January 26, 2021 @08:35PM (#25923217)
Or doas. Much simpler.
[dead]
Re:Heap-based buffer overflow in Sudo by mtrycz2 on Tuesday January 26, 2021 @06:06PM (#25922098)
Three decades of free software that generated billions upon billions of revenue and a big part of existing infrastructure is built upon is far from "wall to wall toxic waste".

I'm not a fanboy for the sake of it, but you're being a little over your head here.

Re:Heap-based buffer overflow in Sudo by jart on Wednesday January 27, 2021 @01:05AM (#25924845)
Online Linux services are so powerful, that they can even ban the president of the united states of america.
Re:Heap-based buffer overflow in Sudo by jeffbee on Tuesday January 26, 2021 @06:10PM (#25922130)
Even in the literal sense revenue does not imply the absence of toxic waste. Indeed, historically speaking, revenue has been strongly associated with toxic waste.

I don't mind expressing this opinion. There is nothing anywhere in the GNU project which should be emulated, except the license.

Re:Heap-based buffer overflow in Sudo by DaiPlusPlus on Tuesday January 26, 2021 @06:02PM (#25922062)
How is it possible that GNU’s `sudo` is not GPL?

Unless it’s BSD, I guess?

Re:Heap-based buffer overflow in Sudo by rincebrain on Tuesday January 26, 2021 @06:10PM (#25922129)
It's not GNU's `sudo`, it's under an ISC-style license, and is maintained by an OpenBSD developer, so it's closer to "BSD's sudo" (though OpenBSD has been shipping `doas` instead for a little while now).
Re:Heap-based buffer overflow in Sudo by arp242 on Tuesday January 26, 2021 @07:30PM (#25922747)
sudo even predates GNU by several years.
Re:Heap-based buffer overflow in Sudo by riffraff on Wednesday January 27, 2021 @02:19AM (#25925269)
wow, I never realized sudo is from 1980[0]! I thought it was a product of the late '90s. It's actually incredible it has managed to stay around this long.

[0] https://www.sudo.ws/history.html

Re:Heap-based buffer overflow in Sudo by DaiPlusPlus on Wednesday January 27, 2021 @08:47AM (#25928168)
Pffft, `sed` is from 1974: https://en.wikipedia.org/wiki/Sed

And `ed` dates from 1969: https://en.wikipedia.org/wiki/Ed_(text_editor)

Re:Heap-based buffer overflow in Sudo by riffraff on Thursday January 28, 2021 @01:40AM (#25938940)
ah, yes, but those _felt_ as old as dirt.

On the other side, I remember howtos/manuals/READMEs in the early '00s referring to su(1) and only sometimes saying "..these days you should be using sudo(8)", so it always felt like something "new" :)

Re:Heap-based buffer overflow in Sudo by cbarrick on Tuesday January 26, 2021 @06:13PM (#25922156)
There is no such thing as GNU sudo.

The homepage for sudo is https://www.sudo.ws/

It is licensed under an ISC style license.