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

Filename Description Type Creator Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 122310 depends on: Show dependency tree
Bug 122310 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-09 13:54 0000
from a bugtraq email by Lu

------- Comment #1 From Carsten Lohrke 2006-02-09 13:54:02 0000 -------
from a bugtraq email by Luís Miguel Silva <lms@fe.up.pt>:


At least one of the scripts that ships with this software (opcontrol) has a
security flaw which enables a user to run arbitrary commands.

The script itself isnt suid root *but*, to take full advantage of some of the
features the software has, a lot of administrators give 'sudo' privileges to
that script.

Whoever coded the script tried protecting it against executing binaries out of
a
safe PATH by defining one on line 1416:
PATH=/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin

The problem is that this script does not check where the 'which' or 'dirname'
binary is executed from on line 1413/1414.

This enables a malicious user to execute arbitrary code by using the following
pseudo'exploit':
cat > which
#!/bin/sh
/bin/cp /bin/bash /tmp/backdoor
/bin/chmod 6755 /tmp/backdoor
^C
set PATH="."
/usr/bin/sudo /usr/local/bin/opcontrol

Vulnerable: <= oprofile-0.9.1

I contacted the developer(s) and got the following response:
"Do not trust admin privileges to unaudited code" - indeed these are words of
wisdom :o)

------- Comment #2 From Stefan Cornelius (RETIRED) 2006-02-09 14:06:47 0000 -------
spock please provide fixed ebuilds, thanks

------- Comment #3 From Michal Januszewski 2006-02-12 06:43:55 0000 -------
Fixed ebuilds are now in the tree.

Please note that this whole bug is probably a non-issue for Gentoo systems
since our sudo is compiled with the '--with-secure-path' option.

------- Comment #4 From Thierry Carrez (RETIRED) 2006-02-12 09:30:06 0000 -------
Auditors please confirm taht we are not affected...

------- Comment #5 From Tavis Ormandy (RETIRED) 2006-02-12 10:41:32 0000 -------
Confirmed, Michael is correct, this is not exploitable on gentoo.

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