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.

The poisoned NUL byte, 2014 edition

231 pointsby tshtfover 10 years ago

6 comments

deathanatosover 10 years ago
Can someone explain this a bit? While I can understand how these bugs arise, I&#x27;m not the best at exploiting them.<p>The summary states,<p>&gt; disclosed a glibc NUL byte off-by-one overwrite into the heap.<p>&gt; a full exploit (with comments) for a local Linux privilege escalation.<p>Normally, I wouldn&#x27;t see how such a bug could lead to privilege escalation. (glibc runs in userspace, after all.) But it is glibc, and glibc is everywhere.<p>I <i>think</i> the key is in the source code, where they state,<p><pre><code> &#x2F;&#x2F; It actually relies on a pkexec bug: a memory leak when multiple -u arguments are specified. </code></pre> pkexec is setuid, so if it has a bug, then it&#x27;s a great target for privilege escalation. Is the exploit the fact that they&#x27;re passing bogus arguments to pkexec in such a way as to trigger this bug, corrupt the heap, and cause pkexec to either execute a binary of their choice or execute arbitrary code?
评论 #8226093 未加载
tptacekover 10 years ago
This is one of the all-time great exploit writeups.
评论 #8225834 未加载
评论 #8228511 未加载
jfindleyover 10 years ago
I was interested to learn that the kernel actually allows you to pass 15 <i>million</i> arguments via execve(), with each one allowed to be enormous.<p>It seems very much like asking for trouble - I can&#x27;t offhand think of a good reason why this would be required.<p>I&#x27;m sure there are plenty of programs that have similar memory leaks with commandline args, as many authors might, not unreasonably, think that abuse would be prevented by the shell ARG_MAX, which is 2621440 bytes on many systems. Perhaps some sort of adjustable lower limit might be appropriate here.
评论 #8227040 未加载
评论 #8226352 未加载
JonnieCacheover 10 years ago
geohot hunts bugs for google now. I did not know that. Nice to see a happy ending there.
muppetmanover 10 years ago
That&#x27;s very impressive. It&#x27;s also why you should be running a pax&#x2F;grsecurity enabled kernel.
评论 #8228594 未加载
crazypyroover 10 years ago
I just want to join the choir and thank the author&#x2F;poster. Really great article. I managed to learn quite a few things and there was just enough detail given to go and look up any background information necessary to complete understanding.