TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Bringing Memory Safety to sudo and su

94 pointsby mritzmannabout 2 years ago

14 comments

sc68calabout 2 years ago
My concern is that while re-implementing sudo in rust would solve bugs due to memory safety and off by one errors, it is a complex piece of software where logic errors can create serious security issues.<p><a href="https:&#x2F;&#x2F;cve.mitre.org&#x2F;cgi-bin&#x2F;cvename.cgi?name=CVE-2023-22809" rel="nofollow">https:&#x2F;&#x2F;cve.mitre.org&#x2F;cgi-bin&#x2F;cvename.cgi?name=CVE-2023-2280...</a>
评论 #35718557 未加载
评论 #35720729 未加载
评论 #35720431 未加载
评论 #35718778 未加载
评论 #35718523 未加载
nhellmanabout 2 years ago
There is also &#x27;doas&#x27; from the OpenBSD project. It&#x27;s a replacement for &#x27;sudo&#x27; with fewer features and a smaller codebase, with the aim of a smaller attack surface.<p><a href="https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Doas" rel="nofollow">https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Doas</a>
评论 #35718810 未加载
评论 #35720863 未加载
评论 #35718750 未加载
stephc_int13about 2 years ago
This so-called memory safety is looking like a buzzword engineered to be extremely appealing to a type of mildly technical but mostly illiterate about computer security kind of people.<p>This has been said before, this has been tried before, OOP was also seen as silver bullet at some point, like several others.<p>Computer security is a deeply complex and dirty field, switching programming language won’t help much if programmers are expecting the work to be done for them by the compiler.<p>If you want robust code : hire experts in the field and pay the price.<p>Rewriting sudo is almost certainly going to be painful and to increase the vulnerabilities potential.
评论 #35721174 未加载
评论 #35722997 未加载
评论 #35720818 未加载
hannobabout 2 years ago
This sounds good, however, I hope they don&#x27;t try to replicate all of sudo.<p>sudo fails a basic security principle on Unix systems, and that is that suid binaries should be simple. Their developers have a tendency to add all kinds of stuff that barely anyone ever uses, but that bloats its size.
评论 #35719110 未加载
评论 #35720897 未加载
PeterWhittakerabout 2 years ago
Good plan. Reimplementing in Rust using a carefully planned milestone-based approach should result in feature parity with fewer security vulnerabilities.
评论 #35720362 未加载
pyuser583about 2 years ago
This just isn’t necessary. There’s excellent C tooling that identifies memory safety issues.<p>It seems any program that meets the four criteria would better served by rigorous analysis of the existing code.
评论 #35756081 未加载
评论 #35749947 未加载
vermadenabout 2 years ago
Why not just use doas(1) instead?<p><i>doas(1)</i><p>- doas(1) - portable version has about 500 lines of code<p>- doas(1) man pages - 157 lines long<p>- doas(1) had 2 CVEs<p><i>sudo(8)</i><p>- sudo(8) - about 120,000 lines of code (100x more)<p>- sudo(8) man pages - 10 000 lines long<p>- sudo(8) had 140 CVEs<p>The CVEs comparison is from &#x27;all time&#x27; and as sudo(8) has longer history then doas(1) - it will (at least statistically) have more of these ... I expect doas(1) to have about 5-10 CVEs when they would have the same life span.<p>Regards,<p>vermaden
musicaleabout 2 years ago
A few years back I was annoyed that sudo would consistently crash with a memory error.
jacooperabout 2 years ago
Another tool getting reimplemented in Rust under a weak license.<p>Do people want to ruin the Linux Eco system or what? It only takes on distro to close its modified source(backports, bugfixes etc) for the entire Eco system to start to crack.
评论 #35749953 未加载
johnisgoodabout 2 years ago
Rewrite it in an actually &quot;safe&quot; language, like Ada.
评论 #35756096 未加载
notoranditabout 2 years ago
&gt; But because it&#x27;s written in C, sudo has experienced many vulnerabilities related to memory safety issues.<p>Or because it&#x27;s not been developed with enough care?<p>I for one think that there is no unsafe language, only careless programmers.
评论 #35720888 未加载
评论 #35720960 未加载
评论 #35720813 未加载
Dolamifaabout 2 years ago
Can&#x27;t be more excited for that!
jmclnxabout 2 years ago
Will this replace the current sudo ?
评论 #35718192 未加载
评论 #35717751 未加载
rurbanabout 2 years ago
Memory safety would be good, but why then use a memory unsafe language?
评论 #35718986 未加载