Sudo-rs make me a sandwich, hold the buffer overflows
- Reference: 1746686288
- News link: https://www.theregister.co.uk/2025/05/08/ubuntu_2510_makes_rusk_sudo_default/
- Source link:
When it arrives [1]on October 9, 2025 , those interacting with Ubuntu Linux software should enjoy a reduced attack surface and perhaps a bit more peace of mind about system security.
Sudo is a command-line utility on Unix-like systems that allows authorized users to run commands with elevated privileges, typically as root. Its reincarnation using the Rust programming language aims to make the utility memory-safe.
[2]
Memory-safe code precludes the possibility of bugs like buffer overflows and use-after-free, which represent [3]the majority of serious software vulnerabilities. As a result, security watchdogs like the US govt's [4]CISA , and Microsoft's Mark Russinovich, have spent the past few years urging developers to write new projects in programming languages that support memory safety guarantees (such as Rust, Go, and C#), and in some cases to rewrite existing projects.
[5]
[6]
The Internet Security Research Group's [7]Prossimo project jumpstarted these Rust rewrite efforts back in 2020. In response, we've seen efforts like [8]sudo-rs , which has been supported by [9]funding from AWS .
The adoration of Rust, [10]still controversial in the Linux maintainer community, has [11]created a crisis for the stewards of C and C++, programming languages that don't offer comparable memory safety guarantees. If the C and C++ communities cannot come up with foolproof ways to meet memory safety mandates – and there are projects underway that aspire to do that – developers using those languages are destined to spend less time developing and more time maintaining and phasing out.
[12]
Sudo has indeed had serious memory safety vulnerabilities, said Marc Schoolderman, lead engineer on the sudo-rs rewrite, pointing to [13]a list maintained by Todd Miller, developer of C-based sudo.
"The first page lists several memory safety vulnerabilities (anything that says buffer overflow, heap overflow or double free)," Schoolderman told The Register . "One of the oldest ones we know of is from 2001, published in [14]Phrack under the whimsical name 'Vudo,' which quite dramatically showed an attacker gaining full access on a system that it only had limited access to."
He continued, "A good recent example is the 'Baron Samedit' bug that was discovered by security firm Qualys in 2021, which like 'Vudo' would cause an uncontrolled privilege escalation. There are many websites and YouTube videos that illustrate it; it has [15]CVE-2021-3156 ."
[16]
"The decision to adopt sudo-rs is in line with Canonical’s commitment to [17]Carefully But Purposefully increase the resilience of critical system software, by adopting Rust," said the Trifecta Tech Foundation in a [18]blog post . "Rust is a programming language with strong memory safety guarantees that eliminates many of the vulnerabilities that have historically plagued traditional C-based software."
"There are, of course, other critical utilities, but sudo is among the most critical; it mediates a critical privilege boundary on just about every open-source operating system that powers the Internet," Erik Jonkers, chair of the Trifecta Tech Foundation, told The Register .
"That fact, plus AWS's willingness to fund the work, is the reason ISRG's Prossimo selected it. For AWS, moving to memory-safe code as much as possible, for e.g., Amazon Linux, is very valuable. This is clear from the support AWS provided and now Canonical, who are interested in making their products more secure. Also, the response from the open source community shows people care about sudo."
[19]Malware in Lisp? Now you're just being cruel
[20]Panic averted: It was just a bug in Atop after all
[21]Asahi Linux loses another prominent dev as GPU guru calls it quits
[22]Ubuntu 25.10 plans to swap GNU coreutils for Rust
Jonkers noted that other key building blocks like [23]zlib-rs and [24]ntpd-rs have been adopted by Firefox and Let's Encrypt, respectively.
The first stable release of sudo-rs appeared [25]in late August 2023 , and the utility has since been adopted in Chainguard's container-oriented Linux distribution Wolfi Linux OS, and other security-focused distributions like NixOS and AerynOS. It has also been packaged with [26]Debian , Fedora and Ubuntu.
As The Register [27]reported two months ago, Canonical VP of engineering Jon Seager [28]sees value in adopting sudo-rs as a default. "While performance is high on my list of priorities, it’s not the primary driver behind this change," he explained. "These utilities are at the heart of the distribution – and it’s the enhanced resilience and safety that is more easily achieved with Rust ports that are most attractive to me."
In an effort to assess these new Rust-based utilities, Seager helped to create a project called [29]oxidizr that simplifies the process of replacing traditional Unix utilities with modern Rust-based alternatives on Ubuntu systems. Presently, oxidizr works with [30]uutils coreutils , [31]findutils , and [32]diffutils , plus [33]sudo-rs .
"It will take time to move the needle significantly," said Jonkers. "There is a focus on defensive security, network security, etc., in the market.
"What we have seen with the [34]reports by Google on Android transition, is that the impact, including cost savings, is huge. CISA marking memory unsafe languages as a bad practice is surely a step in the right direction. In Europe, we are working similarly towards including Memory Safety in Secure by Design policy, together with the [35]Sovereign Tech Agency . The transition will take time, but I'm convinced the needle is moving." ®
Get our [36]Tech Resources
[1] https://wiki.ubuntu.com/Releases
[2] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=2&c=2aByAv0J5ZU5Lj5W_81QzGQAAANc&t=ct%3Dns%26unitnum%3D2%26raptor%3Dcondor%26pos%3Dtop%26test%3D0
[3] https://www.memorysafety.org/docs/memory-safety/
[4] https://www.theregister.com/2025/04/22/top_cisa_officials_jump_ship/
[5] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44aByAv0J5ZU5Lj5W_81QzGQAAANc&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[6] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33aByAv0J5ZU5Lj5W_81QzGQAAANc&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0
[7] https://www.memorysafety.org/
[8] https://github.com/trifectatechfoundation/sudo-rs
[9] https://www.abetterinternet.org/post/aws-support-for-memory-safety/
[10] https://www.theregister.com/2025/02/21/linux_c_rust_debate_continues/
[11] https://www.theregister.com/2025/03/02/c_creator_calls_for_action/
[12] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44aByAv0J5ZU5Lj5W_81QzGQAAANc&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[13] https://www.sudo.ws/security/advisories/
[14] https://phrack.org/issues/57/8
[15] https://www.sudo.ws/security/advisories/unescape_overflow/
[16] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33aByAv0J5ZU5Lj5W_81QzGQAAANc&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0
[17] https://discourse.ubuntu.com/t/carefully-but-purposefully-oxidising-ubuntu/56995
[18] https://trifectatech.org/blog/memory-safe-sudo-to-become-the-default-in-ubuntu/
[19] https://www.theregister.com/2025/03/29/malware_obscure_languages/
[20] https://www.theregister.com/2025/03/27/atop_panic_averted/
[21] https://www.theregister.com/2025/03/20/asahi_linux_asahi_lina/
[22] https://www.theregister.com/2025/03/19/ubuntu_2510_rust/
[23] https://github.com/trifectatechfoundation/zlib-rs
[24] https://github.com/pendulum-project/ntpd-rs
[25] https://www.theregister.com/2023/09/02/isrg_prossimo_sudo_rs/
[26] https://packages.debian.org/sid/sudo-rs
[27] https://www.theregister.com/2025/03/19/ubuntu_2510_rust/
[28] https://discourse.ubuntu.com/t/carefully-but-purposefully-oxidising-ubuntu/56995
[29] https://github.com/jnsgruk/oxidizr
[30] https://github.com/uutils/coreutils
[31] https://github.com/uutils/findutils
[32] https://github.com/uutils/diffutils
[33] https://github.com/trifectatechfoundation/sudo-rs
[34] https://security.googleblog.com/2024/09/eliminating-memory-safety-vulnerabilities-Android.html
[35] https://mastodon.social/@sovtechfund/114455926110863496
[36] https://whitepapers.theregister.com/
Re: Another day, another attempt to force this on us
Your argument is that a good programmer can write memory-safe code in C++. In theory, you are correct. In practice, there is many years of evidence of memory safety bugs being found in C++ code. And lots of programmers are not good.
So large programs written in C++ are highly likely to have memory safety bugs. For applications where those bugs are security vulnerabilities, that is not acceptable. The other advantages of C++ are irrelevant if it's impossible to write secure code.
Any Rust code that does not use the "unsafe" keyword is memory safe. This is enforced by the language and compiler.
There has been talk of having a memory-safe subset of C++, and making the compiler enforce it. Right now, that does not exist. There is some early development work on how C++ could be extended to allow that. If/when it does exist, then existing libraries will need to be ported to it or wrapped in bindings. It's basically a new language based on C++, with all the work needed to establish a new language - which Rust has already spent years on, so Rust has a big head start.
Re: Another day, another attempt to force this on us
Rust is not a serious competitor for C++. It will never compete in that space - ever. It will take margin away from Golang and Python then fall-back into single digits of interest.
It's not 1980 - you are a thin front-end to a C++ universe, LLVM is written in C++ - so your advantage has corroded before we hit code generation.
There is nothing that Rust offers over valgrind / asan / ubsan - so essentially you're pretending that a language which lacks any credible examples has an advantage due to checks which are ultimately implemented in a C++ codebase.
LLVM's entire purpose was to allow people to write custom syntax checks for C++ code as it was more difficult to use the GCC tooling - It's not magic, if you can detected it from the AST then you can warn or even fix it automatically.
So Rust is not offering anything new, it does offer a great deal of friction and a lot of security issues - It's a tire fire of dependencies, the code is not readable to many people compared to the community of C and C++ literate people. The Compilers are single source, and the people pushing it are utterly untrustworthy.
So mate, not convinced - C and C++ have known issues, which testing, design, architecture and proficiency render trivial, in return we get clarity, performance, portability, multiple compilers, easy onboarding, continuity of source, an entire global population of developers with decades of experience.
Re: Another day, another attempt to force this on us
Rust is fairly new. We don't have the many decades of experience & training with Rust that we have with C++.
But that argument is basically "we should never do anything new. We should never try new approaches to fix the issues with our current approach".
When cars came out, we didn't have the centuries of experience with them that we had with horses. There was a big community of people who could use horses but not cars. People understood horses but not cars. The supply chain for the first cars probably included horse drawn wagons. There were a limited number of car suppliers compared to lots of horse breeders and sellers. But ultimately, the advantages of cars meant that, over a period of many years, all that changed.
But there have also been many other attempts at major changes that haven't worked out.
It's too soon to know if Rust will succeed or not. Maybe in 50 years a few enthusiasts will be going "remember Rust, shame that didn't take off". Or maybe people will use Rust and look at C/C++ as legacy languages like Fortran and COBOL.
Re: Another day, another attempt to force this on us
The argument is that Rust is different in meaningless ways offering nothing new. Reflection in C++26 is new, but functional languages are not new. There is no new idea as yet articulated other than "don't use C++ or C" which is not a new idea.
It's not an advancement to use a different programming language, it's either an aid or an impediement to the task, but to ditch the C++ ecosystem requires you provide something compelling, Rust doesn't offer it.
It offers advocacy absent evidence, it's grounded in idealism not measurable advantage. Find a Unicode conversion library in rust which has a sane API and allow you to determine what proportion of the input was successfully converted - https://thephd.dev/the-c-c++-rust-string-text-encoding-api-landscape
Ultimately ICU written in C++ is the winner. So being in Language X conveys no advantage over experts in the domain doing decent design, which is not new.
Re: Another day, another attempt to force this on us
> if you can detected it from the AST then you can
But what if you can't detect it from the AST (passing pointers, type casting, mmap a file and type-cast memory to a structure)? How about if Rust prohibits the things that can't be represented from the AST, ensuring that you can detect the things that you can do?
There's been lots of back-and-forth, and potential fixes for C++ to obtain more guaranteed behavior. The rust-cult still exists, and the C++ crowd is still telling us that it *can* be done if we _really want to_ (with standards proposed but not yet, at least, popular). Neither has won the war.
Re: Another day, another attempt to force this on us
The bottom line is that stuff is useful, which is why people do it. It's like saying you want to take the sharp knives from my kitchen and make me cook with a spork.
Sure it might be "safer" but I'm not convinced it's an actual problem compared to say input validation for sql injection or supply chain poisoning which rust makes much easier.
Re: Another day, another attempt to force this on us
This is enforced by the language and compiler.
Assuming that there are no bugs in the compiler and underlying runtime system.
Re: Another day, another attempt to force this on us
Correct. But let's be fair here: that risk is not specific to Rust. Bugs in the C compiler or C standard library can have the same effect. And they have caused security issues in the past.
Re: Another day, another attempt to force this on us
https://godbolt.org/z/PsMr1xdfd
As a C++ programmer for 30 years and a Rust programmer for 4 years, I find it way more difficult to review for correctness your simple bit of code than the equivalent in Rust. There's the advantage, even if you're one of the very few who can write sound C++ every time .
Re: Another day, another attempt to force this on us
I'd argue you're incompetent if you can't review that example comfortably in under ten minutes for the most pedantic review possible.
It computes a dot product, it uses the STL.
How on earth are we expected to take your opinion seriously if that level of complexity is considered to difficult to review for a thirty year veteran.
Why not bite the bullet and do a libc6-rs?
I don't see the niche for Rust. I either want higher level so a scripting language with a decent repl like ruby, or I care about the lifetime of my systems and being stuck on a single source llvm-frontend is troubling.
Nobody has answered the matter of "Fully Countering Trusting Trust through Diverse Double-Compiling" https://arxiv.org/abs/1004.5534
It's based on saying C has an issue which is addressed with destructors and scoped resource management, either in extensions or pre-processing, or with language support in C++. Therefore Rust, no linkage is offered, just a conclusion.
I don't see why a functional language with horrid syntax and glacial compilation is offered as some advancement over modern C++ or even modern C with the standard extensions.
It seems that Rust appeals to a more axiom focused developer who feels the grubby business of computation is rather beneath them, and would rather something else handle it.
C and C++ are for software that has to last, and be upgraded for a decent length of time, perhaps longer than one's internship rewriting decades old tooling might afford.
"It seems that Rust appeals to a more axiom focused developer who feels the grubby business of computation is rather beneath them, and would rather something else handle it."
Rust might appeal to companies who think they can shorten or even skip some bits of the software development process because Rust will take care of stuff they used to have to manage with reviews, testing and, you know, good SW engineers. I can imagine some of the people I've worked for coming back from a conference jolly all fired up with "this new language that's going to take 20% off our development costs because you can't write bad code with it" speeches.
I agree, there is a literal quote from the last time this came up,
Because Rust guarantees that you'll do it without introducing undefined behavior, even if you don't fully understand it, which carries a side effect of making it much easier to learn. The compiler also tells you exactly why what you're doing is wrong and even suggests how you might fix it. This may be hard for you to believe, but you literally can not screw this up if you're using Rust. Really. The language honestly delivers on what it promises.
But it compiled how can it be buggy as fuck.
> "this new language that's going to take 20% off our development costs because [it] [will take care of stuff they used to have to manage with reviews, testing and, you know, good SW engineers.]"
Wasn't this basically the argument for all the scripted, and even type-free languages? Python? Ruby on Rails? PHP? at least / to start with. Even, "Semantic Code."
Then maintaining and using them becomes nightmare-ish, unless you're a True Believer. They're relegated to small projects, because they're not suited for large applications. See also, Microsoft designing Typescript; Python's developer acknowledging that type-free languages are great for getting things done -- but not so great in large applications where you need to interact with other people's creations (in the same language).
Only if
'sudo' is a symlink to sudo-rs, so the former sudo with said vulnerabilities is not used - not even by accident or on purpose.
Re: Only if
Why complicate matters with a symlink? Just call the sudo-rs executable "sudo".
This is how the situation is dealt with everywhere else . . .
Training wheels
Not sure the blinkered focus on 'memory safety' is worth the rest of the compromises of this current obsession with Rust.
Your inability to design, implement and test adequately to produce robust code to eliminate a subset of non-inherent issues is not a solid justification, any more than your inability to ride a bike would be reason to force training wheels on everyone.
And I especially hate it when people try to mandate their current favorite solution as the One True Answer rather than properly defining the problem and leaving it open how to reduce it.
It's not like Rust is exactly perfectly robust (or even viable) in all scenarios either.
Before any one complains about sudo-rs being MIT
and that this will destroy the GNU-GPL-Linux concept, please be aware that the GNU crowd crowd are FREE (as in FREEDOM) to fork and re-license this code as GPL whenever they want.
Meanwhile, one is NOT FREE to fork GPL code and re-license as something else.
Therefore, if the GNU crowd is worried about rs-sudo, or toybox, or uutils being in certain linux distros, better get forking, re-licensing and mantaining...
My toughts, licenses are just tools, there are right tools for the right job. The only ones who have a say on the license of a project are the people/entities who start said projects. If you do not like the license either fork and re-license (if possible) or re-implement.
The best example is Toybox. Busybox was created as GPL. One of the original implementers of Busybox tought a BSD type license woud be more amenable for the main use case of busybox (embeded systems) so they re-implemented from scratch with a permissive licence. No language change, no nothing.
In my youth I learned many languages
BASIC, COBOL*, RPG-II, PASCAL and C** (not bad for an electronics engineer)
Got decent enoogh in C to become a teacher's assistant.
Languages are tools, there is not a "true tool". One should do an excersice:
If Mr. Torvads were starting the Linux Kernel today ¿would he use rust? ¿Zig? ¿C? ¿Erlang?
IMHO, rustifying the Kernel Loadable Modules (drivers) and userland is not that bad.
* The big advantage of COBOL in that era was that, if you showed your program to a non-techie (say, an accountant or a lawyer), the language was verbose and close to natural english enough, that the person could understand it enough to validate that the business processes/logic/rules and legal issues were correctly represented. They could not write it themselves from scratch, they could not maintain it, the could not detect sublte errors, but understand enough to give you the A-OK that the relevant lawer/accounting things were done correctly.
** ¿Does AWK and shell scripting count as languages?
sudo
Now there's a command you want to experiment with.
"Sudo is a command-line utility on Unix-like systems that allows authorized users to run commands with elevated privileges, typically as root" without the safeguard of an additional password. It fails Saltzer and Schroeder's separation of privilege criterion: https://en.wikipedia.org/wiki/Saltzer_and_Schroeder's_design_principles
Another day, another attempt to force this on us
If you use simple code, and the STL, C++ is very easy to write correct memory safe code, threadsafe code, portable clean code.
Lock-Free, Concurrent code, doing fork-join parallelism memory safe, trivial in C++.
C++ gets better over time, your C code can become C++, can slowly migrate to later standards by deleting code. This example over the years has seen me discard threads(c++11), wrappers(c++20), smart pointers(C++11) the core of this is unchanged from C++98, but the undifferentiated heavy lifting just keeps leaving my code for the standard library, and I'm very happy with that.
If you use std::array over plain array, from GCC 12+ onwards, you get free SIMD.
Please show me this in rust and tell me where my opportunities for performance, clarity, portability, memory or thread safety are being neglected and how the Rust code improves on this.
https://godbolt.org/z/PsMr1xdfd