First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 122951
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Gentoo Security <security@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Joshua Pettett <bugs.gentoo.devel@homelinkcs.com>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:
Flags: Requestee:
 
 
  ()

Filename Description Type Creator Created Size Actions
coreutils test vulnerability exploit.pl Automated exploit of privilege escalation vulnerability text/plain Joshua Pettett 2006-02-15 12:23 0000 5.91 KB Details
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 122951 depends on: Show dependency tree
Bug 122951 blocks:

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2006-02-15 12:13 0000
Compile tests for coreutils are world editable but run by root, allowing for
local privilege escalation during test phase of emerge.  While exposure is
limited, I think the implications are serious.  Will attach example exploit.

------- Comment #1 From Joshua Pettett 2006-02-15 12:23:18 0000 -------
Created an attachment (id=79866) [edit]
Automated exploit of privilege escalation vulnerability

This perl script is designed to automatically exploit the coreutils emerge
operation (assuming it's run with FEATURES="maketest") and present an
unprivileged user with a root shell.

WARNING: THIS SCRIPT *WILL* DAMAGE YOUR SYSTEM'S SECURITY AND MAY WREAK HAVOC.

------- Comment #2 From SpanKY 2006-02-15 19:39:09 0000 -------
i dont get it

portage marks $WORKDIR as 700

how are non-root users supposed to get into that ?

------- Comment #3 From Joshua Pettett 2006-02-15 20:24:22 0000 -------
(In reply to comment #2)
> i dont get it
> 
> portage marks $WORKDIR as 700
> 
> how are non-root users supposed to get into that ?
> 

Perhaps this?

coreutils-5.93.ebuild, line 98: chmod a+rx "${WORKDIR}"

------- Comment #4 From Tavis Ormandy (RETIRED) 2006-02-16 02:14:40 0000 -------
base-system, please comment

------- Comment #5 From SpanKY 2006-02-16 06:06:06 0000 -------
that would do it

simply adding a `chmod -R go-w ${WORKDIR}` should fix it

------- Comment #6 From Thierry Carrez (RETIRED) 2006-02-16 12:42:15 0000 -------
adjusting severity.

------- Comment #7 From SpanKY 2006-02-17 04:29:32 0000 -------
fixed in cvs now

------- Comment #8 From Thierry Carrez (RETIRED) 2006-02-18 03:28:58 0000 -------
In fact this doesn't need a GLSA...

The idea being, this happens only when you emerge the thing. Now, next time
people upgrade coreutils, the vulnerability won't be there. There is no point
in forcing people to do that (now safe) upgrade now. Those that have already a
"vulnerable" coreutils installed are not vulnerable to anything now that it has
been installed... And will be safe next time they upgrade.

We call this the "python-updater" precedent.
If everyone agrees we'll open this bug and close it without GLSA.

Joshua, many thanks for bringing this to our attention.

------- Comment #9 From Stefan Cornelius (RETIRED) 2006-02-18 03:31:32 0000 -------
Sounds reasonable, I agree.

------- Comment #10 From Tavis Ormandy (RETIRED) 2006-02-18 03:44:00 0000 -------
Makes sense, I agree.

------- Comment #11 From Joshua Pettett 2006-02-18 13:16:39 0000 -------
(In reply to comment #8)
> Joshua, many thanks for bringing this to our attention.

Glad to be of service.  Thanks to all devs for working on this.

Some follow-up thoughts:

In the unlikely event that someone reemerges coreutils before resyncing (e.g.
change in USE flags, or revdep-rebuild?), their system will still be
vulnerable.  In not saying this warrants a GLSA, but I think it's something to
keep in mind.

While I believe that the current fix to this bug is sufficient, I find it
disconcerting that there were world-writable directories in the first place,
especially since these didn't occur when I played with compiling the unpatched
source straight from GNU.  This raises a few questions in my mind: What makes
the tests' directories world-writable, and could whatever that is still
introduce a race condition or another vulnerability, either now or in the
future?  Are there other similar packages with the same or similar
vulnerabilities?

Finally, it looks the current fix for this bug makes bug 122149 obsolete.

------- Comment #12 From SpanKY 2006-02-18 13:36:13 0000 -------
> While I believe that the current fix to this bug is sufficient, I find it
> disconcerting that there were world-writable directories in the first place,
> especially since these didn't occur when I played with compiling the unpatched
> source straight from GNU.

that's because you probably extracted the tarball as a non-root user ... the
permissions arent fully restored as a non-root user, just as root

look at the output of `tar vvvtf coreutils-5.94.tar.bz2`

------- Comment #13 From Thierry Carrez (RETIRED) 2006-02-20 09:44:50 0000 -------
OK then, closing and opening.

First Last Prev Next    No search results available      Search page      Enter new bug