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.

Sudo: Heap-based overflow with small passwords

279 pointsby thewavelengthover 2 years ago

15 comments

yakubinover 2 years ago
Sudo must be the program with the largest number of buffer overflows I’ve heard about. That news is repeating itself ever since I remember.<p>Maybe a good time to plug doas, a simpler alternative to sudo from OpenBSD folks[1], developed partly due to security fears about sudo. It’s also been ported to Linux and is available in e.g. Alpine and Debian.<p>[1]: &lt;<a href="https:&#x2F;&#x2F;flak.tedunangst.com&#x2F;post&#x2F;doas" rel="nofollow">https:&#x2F;&#x2F;flak.tedunangst.com&#x2F;post&#x2F;doas</a>&gt;
评论 #33468518 未加载
评论 #33468136 未加载
评论 #33467833 未加载
评论 #33467763 未加载
评论 #33468970 未加载
评论 #33471425 未加载
评论 #33477518 未加载
评论 #33467114 未加载
评论 #33467740 未加载
评论 #33478509 未加载
评论 #33469840 未加载
评论 #33467983 未加载
phoe-krkover 2 years ago
A fun one. Buffer overflows tend to usually get associated with providing <i>too much</i> data; here&#x27;s a nice case in which an overflow is triggered by providing <i>too little</i>. Seems like the buffer for storing the password was changed to be dynamically allocated, but only in some parts of the code; other parts still treated it as something that is at least nine bytes long (including the null terminator).<p>In practice, this means that if your password is only one char, then the actual buffer is two bytes long, and the seventh byte past the buffer is then zeroed&#x2F;set to the null terminator. I wonder if and how this is exploitable.
评论 #33466754 未加载
评论 #33468179 未加载
评论 #33466421 未加载
评论 #33466240 未加载
评论 #33467006 未加载
评论 #33472629 未加载
singronover 2 years ago
It looks like this only affects DES passwords. Glibc has supported other hashing algorithms for a very long time and most Linux distros have used them by default for years. I don&#x27;t think there is a way for an unprivileged user to choose DES if it&#x27;s not the default, so it&#x27;s very unlikely this can actually be triggered.
评论 #33470651 未加载
erk__over 2 years ago
Fixed upstream here: <a href="https:&#x2F;&#x2F;github.com&#x2F;sudo-project&#x2F;sudo&#x2F;commit&#x2F;bd209b9f16fcd1270c13db27ae3329c677d48050" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;sudo-project&#x2F;sudo&#x2F;commit&#x2F;bd209b9f16fcd127...</a>
hardware2winover 2 years ago
Another day, another CVE in tool that we rely on everyday<p>The first question that we all want to ask<p>Could it be mitigated by safer, modern tech?
评论 #33466351 未加载
评论 #33466408 未加载
评论 #33466813 未加载
评论 #33467001 未加载
评论 #33466951 未加载
评论 #33466718 未加载
评论 #33466337 未加载
评论 #33473465 未加载
评论 #33470278 未加载
评论 #33466977 未加载
stabblesover 2 years ago
sudo feels like a broken concept to me in general.<p>sudo make install, ok, great, <i>some</i> of the many operations you need to do requires privileges? Better give elevated privileges to all operations!<p>Even worse with GUI: enter your password to install. Now I have absolutely no clue what the scope of sudo is.<p>Of course I don&#x27;t want to enter my password for all individual cp and mv operations, but if sudo had a better&#x2F;smaller scope that&#x27;d be great.
评论 #33466734 未加载
评论 #33466541 未加载
评论 #33466649 未加载
评论 #33471826 未加载
评论 #33471512 未加载
评论 #33468685 未加载
评论 #33468566 未加载
alibobover 2 years ago
Why is &quot;sudo 1.8.0 through 1.9.12&quot; affected, but rhel8 shipping sudo 1.8.29 and rhel9 shipping sudo 1.9.5, are not affected?<p>&lt;<a href="https:&#x2F;&#x2F;access.redhat.com&#x2F;security&#x2F;cve&#x2F;CVE-2022-43995" rel="nofollow">https:&#x2F;&#x2F;access.redhat.com&#x2F;security&#x2F;cve&#x2F;CVE-2022-43995</a>&gt;<p><pre><code> Description: ... Sudo 1.8.0 through 1.9.12 ... Statement: The sudo package as distributed with Red Hat Enterprise Linux 7, 8 and 9 is not affected by this issue as it currently doesn&#x27;t ship the affected code. </code></pre> &lt;<a href="https:&#x2F;&#x2F;access.redhat.com&#x2F;downloads&#x2F;content&#x2F;sudo&#x2F;x86_64&#x2F;package-latest" rel="nofollow">https:&#x2F;&#x2F;access.redhat.com&#x2F;downloads&#x2F;content&#x2F;sudo&#x2F;x86_64&#x2F;pack...</a>&gt;<p><pre><code> 1.9.5p2-7.el9 1.8.29-8.el8</code></pre>
评论 #33558333 未加载
pdimitarover 2 years ago
Alright, this is getting tiring.<p>Zig, Nim, Rust, D, V, whatever -- can&#x27;t we just move on from C&#x2F;C++ already? It&#x27;s obvious they are not up for the job.
评论 #33477970 未加载
评论 #33475349 未加载
teddyhover 2 years ago
<a href="https:&#x2F;&#x2F;www.cve.org&#x2F;CVERecord?id=CVE-2022-43995" rel="nofollow">https:&#x2F;&#x2F;www.cve.org&#x2F;CVERecord?id=CVE-2022-43995</a>
millertover 2 years ago
As far as I can tell this is a non-issue. A single byte is written potentially outside a dynamically allocated buffer but the original contents is restored before the function returns (sudo is single-threaded). At best it could be a crash, but even that is unlikely unless using address sanitizer or valgrind.
Flocularover 2 years ago
Come on :D CVSS of 7.1, Complexity Low, Availability and Confidentiality High. sure...
评论 #33471831 未加载
TheBrokenRailover 2 years ago
Seriously, why is sudo so complicated? Most of the time, all sudo has to do is hash a password, check that hash against a file, and if successful, run a program as root.<p>Why can&#x27;t we just have a minimal version of sudo that does just that and only that so the majority of smaller servers and home users can run sudo without fear of a security bug ever other month? Preferably using the same executable path so that everything else doesn&#x27;t break.<p>It just seems like most of sudo&#x27;s security bugs come from weird obscure features almost no one uses. Like that time sudoedit had a security issue. I didn&#x27;t even know that command existed until it broke things, and it still seems pointless when you can just run &quot;sudo nano&quot; or &quot;sudo vi&quot;.
评论 #33471225 未加载
评论 #33471058 未加载
effieover 2 years ago
This sort of fail isn&#x27;t new to sudo, migrate to doas if you can - a much simpler(immensely) and less error-prone program.
v3ss0nover 2 years ago
Time to write sudo alternative in rust
评论 #33471557 未加载
评论 #33471340 未加载
zitterbewegungover 2 years ago
Overflow should be named hunter2 or sudoer2