Memory-safe sudo to become the default in Ubuntu

154 jnsgruk 147 5/6/2025, 11:22:55 AM trifectatech.org ↗

Comments (147)

bArray · 2h ago
> This move is part of a broader effort by Canonical to improve the resilience and maintainability of core system components. Sudo-rs is developed by the Trifecta Tech Foundation (TTF), a nonprofit organization that creates secure, open source building blocks for infrastructure software.

Ubuntu continuously updates itself without permission, killing apps and losing previous state. You have the Javascript based Gnome window manager that is always bugging out. The Ubuntu packages, drivers and kernel are laughably behind Debian and even further behind mainline. Ubuntu continues to morph into something I don't believe in.

That all said, Rust is not a smoking gun for incorrect application logic. It could still happily incorrectly execute stuff with the wrong permissions or blow something up badly. I think it's also a bad idea to offer it as a drop-in replacement when clearly features are still missing since a long time [1].

[1] https://github.com/trifectatechfoundation/sudo-rs/issues?pag...

nottorp · 4m ago
I have the hardware for a new home server waiting to be set up (as in, I don't need a new home server i'm just messing around, so once in a while i log in and configure one more service).

I tried the latest Ubuntu and it seems to be targeted at either containers or desktops. Everything I wanted to set up networking wise was a pain for my little non standard configuration.

Ended up wiping it and installing Debian instead.

As for this Rust thing, first question that comes to my mind is what features are missing from this new godly impervious to hackers by default implementation.

wkat4242 · 1h ago
I think you mean a magic bullet instead of a smoking gun :)
bArray · 1h ago
I meant "smoking gun" from a cyber security perspective, i.e. the conclusion or the final part of the investigation. "magic bullet" would also work here too though.
MaKey · 25m ago
Evidence, particularly of a crime, that is difficult or impossible to dispute. [1]

Even with your explanation I don't think it fits here.

[1] https://en.m.wiktionary.org/wiki/smoking_gun

nmstoker · 17m ago
You seem to have inferred the wrong meaning of "smoking gun" and that's why your usage above doesn't make sense.

There's no valid reason cyber security people would take a well known idiom and repurpose it as you imply, and a quick Google suggests they haven't done this.

Spivak · 56m ago
> Ubuntu continuously updates itself without permission, killing apps and losing previous state.

What? Is this some snap thing because apt sure as hell doesn't do this without you configuring it explicitly.

kokada · 5h ago
I am not sure if memory-safety is the biggest issue in sudo design. I find the fact that it is a setuid binary a much bigger issue because a bug can possible result in privilege escalation.

I found an alternative implementation that doesn't rely in being a setuid binary like systemd-run0 much more interesting from a security perspective, but I am no security expert.

MajesticHobo2 · 5h ago
Right, but now the vector for privilege escalation will have to be a logic bug in memory-safe sudo instead of either a memory corruption (see CVE-2021-3156) or a logic bug. It’s hard not to see this as a major improvement.
h4ck_th3_pl4n3t · 59m ago
A major improvement would be to get rid of glibc altogether. As long as glibc is the default, the problems persist.
charcircuit · 4h ago
Being a setuid binary means that sudo also suffers from attacks where an attacker runs `sudo ./malware` and then convinces the user to authenticate. Depending on how sudo authenticates phishing attacks or password reuse from another breach can be used to escalate privileges.
jvanderbot · 4h ago
Those will also have to be fixed/considered, but do not detract from the contribution of removing memory safety bugs which may enable exploits.
charcircuit · 4h ago
This is a case of doubling down on bad design. To me it's wasted effort preventing theoretical bugs in niche setups.
jvanderbot · 3h ago
I think the opposing view is that moving away from sudo is substantially more effort and would break basically everything to accomplish "the same" thing as robustifying sudo (for some very loose definition of "same")
charcircuit · 3h ago
Yes, it's more effort, but it's not close to being the same.
pixl97 · 14m ago
I mean moving from IPv4 to IPv6 is more effort, but it's not close to being the same...

And it's also why it mostly has not happened for most people.

a_t48 · 4h ago
Even with a new, perfect paradigm, there would be billions of systems running sudo for years.
remram · 57m ago
I don't see how this attack is related to the setuid binary. No matter what method you provide to the user to elevate their privileges, they can be tricked into doing it. If it was provided by a daemon, built into systemd, or anything else, the problem would be the same.
im3w1l · 3h ago
I don't think you can realistically enforce a security boundary between root, and a user account that occasionally elevates.

You can enforce a boundary between root and an account that never elevates though. And as far as I understand hardening sudo helps with that.

charcircuit · 3h ago
>I don't think you can realistically enforce a security boundary between root, and a user account that occasionally elevates.

So stop doing that!

msm_ · 3h ago
Who are you shouting at?

Going back to the topic of the discussion, making sudo more resilient prevents a whole class of possible bugs (see CVE-2021-3156). You may not like sudo, but it is very commonly used to manage access, prevent accidental errors, or improve accountability on Linux servers and workstations. It is not going away. Therefore, improving sudo is a worthwhile goal and a thing to be celebrated.

z3t4 · 3h ago
What should you do instead?
rurban · 2h ago
Capabilities. Proper microkernels already do that
charcircuit · 3h ago
Design the system so that you do not need users to escalate to root. Find each use case where a user may want to use sudo and then come up with an alternate way to accomplish that action from a regular account.
onli · 2h ago
That would just elevate each regular account to be a root account. There is no other way to make things like modifying files directly under / possible, or to change system configurations. You can lock everything down instead, then you have Android, but then you have certainly not enabled everything a user can do with sudo.
lupusreal · 2h ago
We have that, it's called android.

Anybody who finds themselves using sudo is already well off the beaten path, by their own choice. There's nothing wrong with that.

hulitu · 3h ago
> Being a setuid binary means that sudo also suffers from attacks where an attacker runs `sudo ./malware` and then convinces the user to authenticate

So does your OS.

Retr0id · 5h ago
A bug in a daemon-based sudo alternative would surely also result in privilege escalation?

I think the main benefit of eliminating setuid binaries is that you can forbid them system-wide (e.g. via mount flags), as a hardening measure.

JoshTriplett · 4h ago
There's value in always starting processes from a known-secure environment rather than attempting to transform a user's arbitrary environment into a secure one.
Retr0id · 4h ago
True, CVE-2021-4034 comes to mind as a recent example (exploiting zero-length argv)
hedora · 4h ago
How is that any different than a daemon that has a parser error in its message handler, except that the daemon could be misconfigured to listen on a network socket?

The original unix process abstraction was extremely simple; the entire spec is a few pages.

The problem is that Linux keeps adding more and more levels of Rube Goldberg machine to its security model, so now literally no one understands how a default minimal install of, say, Ubuntu works.

Adding a magic daemon that runs stuff as root to this pile of complexity probably won’t help. Ripping out almost all the cruft that’s accumulated over the years, and adding back something sane (maybe BSD jails) would work a lot better.

Dylan16807 · 4h ago
> How is that any different than a daemon that has a parser error in its message handler

The non-daemon has to parse just as much in addition to making itself secure. Actually it needs to parse more things in more complex ways.

hedora · 3h ago
Assuming static linkage (which sudo has to assume), there’s really not much to parse. It should just be dealing with a null-delimited list (argv) and the caller’s environment variables (which it just needs to ignore and clear by default).

Here’s a simple implementation: https://github.com/TheMilkies/rut/blob/main/rut.c

(Though it doesn’t clear the environment unless I’m missing something - they should probably replace the call to execvp with one to execvpe, and add a null pointer to the end of the argument list).

The problem of setting up root’s environment and parsing the command line is left to the shell in both solutions (the thing I linked doesn’t indirect through a root login shell).

There’s also the config file, but that’s the same for both.

Similarly, the system could be running some SEL derivative or be using a capability system that causes non-standard behavior from system calls, but the daemon has the same problem.

johnisgood · 3h ago
Rust version of sudo had lots of ridiculous logic bugs. I do not see the improvement.
TrueDuality · 2h ago
Do you have an example of the logic bugs you're referring to?
johnisgood · 2h ago
I am pretty sure it is around here somewhere: https://github.com/trifectatechfoundation/sudo-rs/issues.

I apologize, I do not bookmark these issues, but maybe I should start doing that? In any case, you will find logic bugs which may raise the question "is it really worth the rewrite?".

internetter · 1h ago
You have the burden of proof to substantiate your accusations. Until then they're entirely unfounded.
Gabrys1 · 3h ago
> Ubuntu is the most widely deployed Linux operating system

Nitpicking, but I thought Android was the most widely deployed Linux OS around...

apexalpha · 55m ago
You are correct but in this context Linux means GNU/Linux.

Bit like how tomato is technically a fruit but everyone knows that in the context of a supermarket it’s a vegtable

pietro72ohboy · 27m ago
Ironically, Ubuntu's efforts to replace its GNU components with non-GNU alternatives is very quickly going to turn it back into just Linux.
ffsm8 · 3h ago
Android uses the Linux Kernel, but iirc (correct me if I'm wrong), it doesn't come with the required application to make it Unix and hence is not the Linux operating system. That would mean it's only using the same kernel as the Linux operating system?

Idk, just speculating to maybe get the thought process

steveklabnik · 2h ago
> it doesn't come with the required application to make it Unix and hence is not the Linux operating system.

Linux is not a Unix https://en.wikipedia.org/wiki/Unix-like

flexagoon · 1h ago
> That would mean it's only using the same kernel as the Linux operating system?

There's no "Linux operating system". Linux is the name of the kernel. Android is an operating system, GNU/Linux is, things like BusyBox/Linux are. They're all operating systems that use the Linux kernel.

ffsm8 · 45m ago
Uh, didn't I say exactly that? Gnu/Linux Is just collegially known as "Linux" and the operation system suffix made it clear what he was talking about. I didn't come up with the usage of the term, I was merely trying to interpret their words.
dist-epoch · 3h ago
That's the logic Oracle uses to say Java is the most widely deployed language in the world, because it runs on phone sim cards and credit cards
FpUser · 3h ago
I was Ubuntu user until they've introduced snap and started forcing it down everybody's throat. No more Ubuntu for me.
pphysch · 3h ago
Maybe "deployed" is the key word here. Android is treated like a fixture of mobile devices rather than a fungible Linux distro.
Ygg2 · 2h ago
Some would say that Android isn't Linux OS[1]. It runs Linux, in same way Linux runs Wine. As a (POSIX) compatibility layer.

[1] because it doesn't abstract the hardware platform, doesn't multiplex hardware, nor protect software principals from each other https://www.youtube.com/watch?v=36myc8wQhLo&t=8m48s

ndegruchy · 5h ago
Seems like the trifecta group is /just/ about migrating tools to rust? Am I understanding that right?

I don't have a problem with it, specifically. Seems odd that they don't advertise it, though.

fossuser · 5h ago
The religious element of rust programmers seems more extreme than other languages. There’s always a little bit of that sort of thing, but rust programmers seem to have mixed theirs with politics too.

It makes me wonder how much is motivated by stuff other than what’s actually the best outcome.

tialaramex · 4h ago
Politics is just everything. "No politics" usually means, "Opinions which conflict with mine are unwelcome" or at best the small-C conservative idea that the status quo has existed forever and so whatever happens to presently be the case is just how things should be.

In your own comment you mention "actually the best outcome" but that's a matter of politics, doubtless you have different ideas about what "best" would be than I do, and I appreciate that perhaps you've never considered that anybody other than you could be right, but you might want to take a moment to think again.

dataflow · 3h ago
> Politics is just everything. "No politics" usually means, "Opinions which conflict with mine are unwelcome" or at best the small-C conservative idea that the status quo has existed forever and so whatever happens to presently be the case is just how things should be.

Everything is political in the same way that everything is offensive and everyone is evil. As in, you're welcome to go around saying that, but don't expect people to find this to be an enlightened perspective.

jvanderbot · 4h ago
You've always encountered this, it just not (until recently) had a _whole language_ to migrate to. It's this strong impulse to do things the "right way" which is a very good instinct, but always has the danger of becoming "rigor theater". It's the same any time anyone proposes to "just" port to a new framework, or runtime, or platform, or language.

Tale as old as time.

mid-kid · 4h ago
We've accepted it at this point, but I wonder if the religious element of GNU tools and free software in general was as contentious way back when.
steveklabnik · 2h ago
St IGNUcius has been a thing for a quarter century at least https://stallman.org/saint.html
hedora · 4h ago
GNU sort of lost its way around GPLv3 (it gives cloud services a free pass, but not locally run software, which is the opposite of letting users control what their computer does).

That killed most of the “user freedom” enthusiasm of the early days. These days, there’s the AGPL, but that’s mostly used like the BSL (“if you want to use AGPL in production, pay us”), than for bootstrapping freedom-respecting compute environments.

If you disagree, show me an AGPL userland that’s appropriate for daily-driving.

I’m slowly migrating off Linux to the BSDs these days. The politics seem less destructive to the user experience with them.

Dylan16807 · 4h ago
What kind of free pass would you want to give to locally run software?

Can't you already do anything you want to GPL code locally?

josefx · 3h ago
I think it is not that local code does not get a free pass by itself but the combination.

By letting cloud services that use GPL software stay closed source it actively encourages development of cloud based tooling in a commercial context and users end up getting forced to sign up with and connect to a closed source cloud service they have even less control over than traditional locally running closed source software.

I think Stallmans motivation for the FSF includes a story about modifying a driver for a printer to support new features. Now imagine if that printer had a cloud based interface and imagine how the GPL would help Stallman add features for a new printer to it. It doesn't, if he wanted to fix the interface he would have to reverse engineer it from scratch. 40 years of FSF and it lets a decades old trend run circles around its goals.

rbanffy · 1h ago
> By letting cloud services that use GPL software stay closed source it actively encourages development of cloud based tooling

This is why AGPL was invented. You might use my AGPL code in your cloud service, but you need to provide the source code you are running to your clients. You are not allowed to keep any secret sauce secret from your users.

MIT and BSD (and plain GPL) don’t protect users again abuses like this.

hedora · 3h ago
GPLv2 was fine. AGPL is fine.

V3 is incompatible with selling bootloader locked software stacks (pretty much all consumer hardware these days).

Concretely, I can’t do this local thing: Take GPLv3 software, build a board, link the software to vendor blob firmware (~ all current hardware requires this step), flash it to a ROM on the board and sell it to you with a copy of the GPLv3 software’s source code.

I can take the same vendor blob, add a TCP stack, and have your device shell into a copy of GPLv3 software with closed source modifications running in my data center.

This has massive negative consequences for users of GPLv3-reliant IoT crap and cloud services.

rbanffy · 1h ago
> V3 is incompatible with selling bootloader locked software stacks (pretty much all consumer hardware these days).

Which is great. It prevents enshitification of consumer devices.

Analemma_ · 4h ago
A little while ago I realized with a start that it's been years since I've heard anyone angrily insist on calling it "GNU/Linux", when that was constant background noise during the Slashdot era. One of those old fights that just faded away, I guess.
i80and · 4h ago
Oh yeah, I got to meet Stallman at a book signing when I was like 17, and like an idiot happened to wear a "Linux" shirt.

I genuinely hadn't thought of this point of contention beforehand, but oof he did not care for that.

mrpippy · 4h ago
Did you tell him you were a fan of just the kernel, not the userland?
hedora · 4h ago
I got him to imply I was being cheap!
jcalvinowens · 4h ago
Its more that it ceased to be true: you can build a "nognu" Linux now, with LLVM as the system compiler, and musl/libc++ instead of glibc/libstdc++.

https://distfiles.gentoo.org/releases/amd64/autobuilds/curre...

Klonoar · 36m ago
Or use Chimera Linux.
mid-kid · 4h ago
That's true. I find myself still saying GNU/Linux where it's relevant (e.g. when referring to the userland, or a compatible userland) but it's not as contentious as it used to be, which is a nice breath.
colechristensen · 3h ago
A lot of the userland _isn't_ GNU any more, people use a lot of alternatives for once much more dominant GNU tools, and people use a lot more commandline tools which have no relation to GNU. Systemd took over and for containers there's no init. Plenty of alternative libc implementations as well.

GNU is nowhere near as dominant in the non-kernel code that people run any longer.

And a lot of the GNU zealots who were particularly interested in getting credit with naming got old.

rs186 · 4h ago
> The religious element

It is only "religious" if you think it in such a way.

I'd say the amount of skepticism (rather than valid criticism) has been no less than enthusiam in the community.

As the saying goes, there are two kinds of languages...

No comments yet

dismalaf · 4h ago
Not like GNU is any less religious...

I think they just want to ditch GNU tools and lots of young, low level programmers want to use Rust (same rationale for Linus accepting Rust code into the kernel).

arp242 · 1h ago
sudo isn't GNU though.
lupusreal · 2h ago
It is almost always the case that proposed changes to the technology stack of a project is intrinsically political. Unless every participant is equally proficient with the new thing as the old thing, then the proposed change is a de facto power play which will change the balance of power and experience and consequently usher in a reorganization.

This is why so many Linux developers resists the addition of Rust or C++.

mardifoufs · 3h ago
I mean, I don't necessarily use rust a lot and it's not even possible to "use" in most cases in my domain (machine learning engineering)... But to say that it's religious is just weird. It would have been super easy to portray as religious every push for better engineering practices in other fields, in fact I bet that it would've happened if the internet was common back when people were doing exactly that for say, civil engineering or mechanical engineering.
atoav · 3h ago
The comment you responded to says: "Seems odd that they don't advertise it [the usage of Rust], though."

Isn't not advertising a language the polar opposite of being religious about a language?

I am all for a memory safe sudo and I don't care which language it is written in, use C, Ada, Rust, as long as it is a suitable systems programming language understood by a community of developers and you can proof memory safety to an acceptable degree. If the people first to do it in an such an way happen to use Rust, not accepting that based purely on the language is what would sound religious to me..

Maybe this protectionist reaction (see recent drama within the Linux kernel) is every bit as religiously colored as some people claim Rust people are.

I mean memory safety? What comes next? Not allowing us to use after free like true men would? \s

__s · 2h ago
There was recently that article about Python switching to a proof verified C crypto library. Yes, I welcome verified C code. But Rust is much easier to use instead

Tho the extra properties re side channels in said verified code outdoes Rust, so I'd also say it'd be undesirable to replace that C code with Rust

Ygg2 · 4h ago
> The religious element of rust programmers

Yeah. I too, hate the Rust Evangelically Orthodox Later Day Christians.

Oh, wait... You're serious. What is religious about rewriting tools in Rust? Isn't that what most programmers do for fun and learning?

Is it any more religious than worshiping Alan Kay or Dijkstra?

> It makes me wonder how much is motivated by stuff other than what’s actually the best outcome.

Looks in the thread... Sees https://www.sudo.ws/security/advisories/

Are you sure the status quo is the better outcome?

ziddoap · 4h ago
>What is religious about rewriting tools in Rust?

"Religious" isn't being used to refer to people rewriting tools in Rust.

It's used to refer to people zealously commenting on message boards that every single tool ever built should be rewritten in Rust, and if you aren't rewriting your tool in Rust, you're an idiot.

Ygg2 · 3h ago
> It's used to refer to people zealously commenting on message boards that every single tool ever built should be rewritten in Rust.

Ok, but between me, GP and the article, who said that? Where are the Rabid RIIR fans?

And before you misquote me, I said, why wouldn't you rewrite stuff in Rust, if the status quo is ridden with bugs, and safety issues? And why shouldn't a Linux distro switch to it if they desire.

ziddoap · 2h ago
>Ok, but between me, GP and the article, who said that? Where are the Rabid RIIR fans?

The person you replied to said: "The religious element of rust programmers seems more extreme than other languages."

You interpreted that in a way that ended up with you asking "What is religious about rewriting tools in Rust".

I clarified that the typical way "religious element of rust programmers" is interpreted is not the act of rewriting tools, but the proselytizing about rust on message boards. I then gave an example of what that proselytizing typically looks like (which was not a claim that you said something like that).

That is the "religious element" being referred to. The proselytizing is the religious element, not the act of rewriting tools in Rust.

(The meme "Rust Evangelists" didn't manifest out of thin air because people hate memory safety or whatever -- it's because people are really, really passionate about Rust, and are vocal about that passion)

Ygg2 · 22m ago
> The proselytizing is the religious element, not the act of rewriting tools in Rust.

Ok. Where is the proselytizing taking place in the article?

Is the sudo-rs did work, the proselytization? Where is it?

> The meme "Rust Evangelists" didn't manifest out of thin air

That's not how memes work. It's just something that appeals to some group that spreads it. It can be true, false and fabricated out of thin air.

What if I told you, that "What if I told you" meme isn't what Morpheus says to Neo? The scene itself is so divorced from meme it doesn't carry much resemblance (here https://youtu.be/L8H9DqkrkcY)

ziddoap · 13m ago
>Ok. Where is the proselytizing taking place in the article?

It's not? It's like you're picking random words out of my comment to quote without bothering to read what I'm writing. Nothing of what I said is about the article. It's about your misinterpretation of what fossuser meant when they said "religious element".

I can't explain the same thing for a third (fourth, I guess? since I just tried again) time, I'm running out of different ways to say it. So I'll just leave it there.

Your meta-commentary on memes is neat and all, but again, somehow, completely misses the point I was making.

johnisgood · 2h ago
So sudo is ridden with bugs and safety issues, as opposed to the Rust alternative? I came across a lot of ridiculously absurd logic bugs in the Rust version. Maybe you can still see GitHub Issues.
CooCooCaCha · 4h ago
Is there actual substance behind this comment or are you against it because of emotional/political reasons?
nailer · 4h ago
It's not religious. Memory safety is a thing. If by politics you mean the government: they only got started recommending memory safe languages once it became clear that foreign actors were going to keep exploiting C / C++ vulnerabilities.

https://www.theregister.com/2024/11/08/the_us_government_wan...

johnisgood · 3h ago
So why are we not using Ada / SPARK?
__s · 2h ago
Indeed Ada found popularity for aircraft software

Rust is part of a modernized iteration in language design this century

Nobody is calling for Ada code to be rewritten in Rust. But at this point you'd want an argument to choose Ada over Rust when it has become more widespread, especially in open source projects

Here's someone else's take on your question a few years ago: https://news.ycombinator.com/item?id=28347930

johnisgood · 2h ago
Just for the curious, Ada is used in these industries:

- Avionics

- ATM

- Space

- Rail

- Automotive

- Defense

- Security

- Medical

https://www.adacore.com/about-ada

You can find lots of resources here to learn Ada / SPARK: https://learn.adacore.com or just to see what is up. Alternatively, there are good blog posts, too.

johnisgood · 1h ago
I thought I should reply separately to your comment, but I do not see how he got to the conclusion "in other words, if your goal is to write a (say) safe implementation of the DOM that can render real-world web pages while efficiently using memory on a general-purpose computer, Ada is probably the wrong tool for the job.". My only "issue" here would be its verbosity, which is why I choose C still quite often.
__s · 1h ago
They were opining that Ada is unsuitable for fine grained data structures (like Rust being awkward with linked lists) & lacking mature graphics APIs

For years I used a C window manager I wrote which was less than 150 lines[1], it can definitely be a terse language. But I've also written pretty tight Rust code for a card game engine & its http server. I don't think Rust is particularly more verbose. Rust code can be artistic too[2]

1. https://github.com/serprex/nobox/blob/master/nobox.c

2. https://github.com/serprex/Kelxquoia/blob/master/src/main.rs

johnisgood · 1h ago
To be honest, I have not yet written Rust seriously, so I cannot comment as much on it. I mostly use C, OCaml, Lua, at times Perl, these days. I do not know how much the language would feel like it is getting in the way of "expressing" my thoughts.

https://github.com/serprex/nobox/blob/master/nobox.c is definitely terse. :D I get lost just by looking at it; a little bit of refactoring (indentation-wise) would help though.

VWWHFSfQ · 4h ago
Memory safety is strictly a good thing, regardless of motivations.

But I'm aware that some people are frightened of new languages and paradigms especially if they're 'harder' than what they're used to.

davrosthedalek · 4h ago
Only if you don't buy any downsides with it. That makes it situational dependent. For example: - less people being able to read the code, work with the code, find (security) bugs - slower I know, I know, rust is not really slower, and for sudo it probably wouldn't even matter. But safety isn't the be all and end all of software. There is a lot of software out there where memory safety doesn't matter, or matters a lot less than other aspects.
778464636 · 4h ago
Supply chain attacks is a big downside no one ever mentions. Even sudo-rs drags dependencies in from Github at build time instead of being self-contained, which is just an absurd thing to do for such an essential tool, especially in the current political climate.
estebank · 3h ago
1) every dependency comes from crates.io, not straight from GitHub

2) the dependency list is tiny

3) it uses a cargo lock, so even if it were using a GitHub dependency, that file keeps a hash of the dependency and points at the specific commit, so if the dependency were to introduce a backdoor it wouldn't be automatically picked up and a commit history rewrite would also fail

https://github.com/trifectatechfoundation/sudo-rs/blob/main/...

drtgh · 2h ago
This is not a new paradigm. It is a limitation in the design of the borrow checker, which causes you to go around until the borrowing takes on mainly a tree structure.
FpUser · 2h ago
>"But I'm aware that some people are frightened of new languages..."

I am not frightened. I program in many languages and have no problems grasping Rust concepts. However I find Rust way too opinionated and restricting for personal tastes. For business I can not see myself replacing C++ with Rust unless my paying clients specifically request it. So far not a single one had expressed any interest.

john-h-k · 5h ago
The other big thing iirc is they’re all MIT licensed rather than GPL(et variants) licensed
ndiddy · 4h ago
Sudo is permissively licensed. https://www.sudo.ws/about/license/
john-h-k · 3h ago
Ah, interesting to know. I guess it is only the coreutils stuff where that is a concern
johnklos · 1h ago
"This move is part of a broader effort by Canonical to improve the resilience and maintainability of core system components."

Somehow "maintainability" has never been something I'd ever associate with Ubuntu. Is it a reference to their source tree? That'd make a lot more sense than if they were referring to the OS itself.

bpierre · 4h ago
How does sudo-rs compare to run0? https://news.ycombinator.com/item?id=40205714
remram · 50m ago
This one is easy: run0 is not implemented in a memory-safe language, but in C. It is likely to be hit by exploitable memory-handling bugs, like the rest of systemd, as has happened multiple times before.
paulddraper · 4h ago
A trivial Google search answers that. run0 requires systemd-type OS.
ranger207 · 4h ago
Given that Ubuntu uses systemd like the vast majority of Linux systems nowadays, how does sudo-rs differ from run0?
fweimer · 4h ago
You might not have a systemd instance inside a container, but you still might want to switch user IDs there.
hedora · 4h ago
sudo-rs doesn’t gratuitously require a root privilege daemon that regularly ships filesystem destruction and remote unauthenticated arbitrary code execution bugs.

If your bar is “I’ll tolerate such crap”, you may as well run your desktop session as root.

paulddraper · 2h ago
sudo-rs uses setuid.

run0 does not (and instead relies on systemd).

---

To answer your next question: setuid, while historic, is a bit weird, and is disabled in some environments, e.g. NoNewPrivileges.

postepowanieadm · 1h ago
No one is rewriting systemd in rust?
steveklabnik · 1h ago
I'm not aware of any serious project to do so, there's been some small projects, nothing on the scale of uutils or sudo-rs.
Rotundo · 7h ago
Did sudo have memory problems? Did it ever fail because it didn't handle its memory correctly?
mid-kid · 6h ago
There's been cases[1], of particular note, the unescape overflow one[2]. This one scathed the reputation of sudo enough to get people pushing for alternatives such as doas. The track record of vulnerabilities in general leaves a bit to be desired, even outside of memory vulns.

[1]: https://www.sudo.ws/security/advisories/

[2]: https://www.sudo.ws/security/advisories/unescape_overflow/

stop50 · 6h ago
Sudo had quite a few problems with security, partially because of this doas was developed for BSD. Some problems come from the huge amount of features(ldap, easter eggs, ...). sudo-rs reduces the problems by not implementing those features.
ch_123 · 5h ago
> Some problems come from the huge amount of features(ldap, easter eggs, ...). sudo-rs reduces the problems by not implementing those features.

This makes me wonder:

1) Would a hypothetical "sudo-lite" with these features removed lead to better security without a rewrite?

2) If these features are useful in the real world, will a Rust rewrite of sudo inevitably gain these features over time and end up with similar problems?

throw0101a · 5h ago
> 1) Would a hypothetical "sudo-lite" with these features removed lead to better security without a rewrite?

OpenBSD did this with their doas utility:

* https://en.wikipedia.org/wiki/Doas

Dylan16807 · 4h ago
"without a rewrite" means cutting down the existing code. A completely different program goes into the same category as "rewrite".
0cf8612b2e1e · 1h ago
doas is 500 lines of C. Two orders is magnitude less than sudo yet still covers the core functionality. Sure you could grandfather”s axe your way into the final product, but difficult to see how a a hypothetical code base 1% of the original counted as anything but a rewrite.
steveklabnik · 2h ago
2. While a feature may be useful, the question is how useful, and to how many people. sudo-rs is removing features that aren't used very much, if at all, and doesn't plan to add them, to combat this. Those users can still use the original sudo.
literalAardvark · 4h ago
It can't end up with similar problems, due to the memory safety guarantee.

That's not to say that it won't create other ones.

XorNot · 5h ago
Removing LDAP is a huge problem for the more important sudo deployments though: centralized management of permissions is kind of a vital function.
JoshTriplett · 4h ago
Debian is currently in the process of dropping the direct LDAP support in sudo, in favor of sssd. From sudo's NEWS.Debian.gz:

> In practice, there are few installations that use sudo-ldap. Most installations that use LDAP as a directory service and sudo have now opted for sssd, sssd-ldap and libsss-sudo.

> The Debian sudo team recommends the use of libsss-sudo for new installations and the migration of existing installations from sudo-ldap to libsss-sudo and sssd.

XorNot · 4h ago
Ah that makes more sense.
rnijveld · 50m ago
The features we specifically don’t support are those related to direct LDAP support within sudo, so things like loading a sudoers file directly from LDAP. Sudo-rs will use any user retrieved via NSS, such as when configured using SSSD to load LDAP users. And from the authentication side you can use whatever PAM supports, so anything like Kerberos etc, which again can be coupled with the same LDAP database.
Filligree · 5h ago
Those people can keep using sudo; it’s not going away. The rest of us get better security.
fluidcruft · 5h ago
Is it actually removing ldap or is it offloading to pam?
dec0dedab0de · 4h ago
Could you clarify what you mean by more important sudo deployments?
Maxatar · 4h ago
xvilka · 2h ago
Next they should adopt uutils[1] as coreutils, findutils, diffutils, etc alternative.

[1] http://github.com/uutils/

steveklabnik · 2h ago
mfld · 1h ago
Related discussion from 2 months ago: https://news.ycombinator.com/item?id=43403821
zamalek · 3h ago
I have been using sudo-rs for over a year. The only issue that I've had is running into `-E` being unsupported once every few months - which is arguably a good thing because I shouldn't be naughty and allow arbitrary envs to leak into a privileged session.
dev_l1x_be · 5h ago
doas is a much simpler (and therefore better) alternative.
Foxboron · 3h ago
doas is a really bad option on Linux.

The Linux port has not been maintained for 3 years. Has unmerged rowhammer fixes and generally a yolo auth system best described as "dangerous". You are better off using a well maintained project, that includes the CVEs^Wwarts.

It's a mistake to think that `doas` on Linux is the same as `doas` on BSD.

JoshTriplett · 4h ago
doas is not a compatible drop-in replacement for existing users.
dev_l1x_be · 4h ago
I did not claim that.

Here is my doas config:

    cat /etc/doas.conf
    permit nopass jane as root
It be read and understood without prior knowledge.

Sudo: #ALL ALL = (root) NOPASSWD: C_ZFS

I have no idea what is going here, not sure what ALL means, why root is in (), etc.

778464636 · 3h ago
Neither is sudo-rs. From TFA:

> some features of the original sudo will not be implemented in sudo-rs if they serve only highly niche use cases

hedora · 4h ago
I wonder if there’s one that hardcodes a simple policy like “members of the wheel group can run any command with a password, and a 5 minute timeout”, but is also sudo command line compatible.

That’s what 99% of distros default to, and it’s simple.

badgersnake · 3h ago
For my limited use case, alias sudo=doas seems to work fine.
rbanffy · 1h ago
What are the implications of the license not being GPL?
steveklabnik · 1h ago
sudo is already (basically) MIT licensed https://www.sudo.ws/about/license/
rbanffy · 1h ago
Oh well. Completely forgot about that.
asmodeuslucifer · 4h ago
That's good to hear.