Subject: iDEFENSE Security Advisory 10.10.05: SGI IRIX runpriv Design Error Vulnerability
Date: Mon, 10 Oct 2005 16:53:27 -0400
Message-ID: <FB24803D1DF2A34FA59FC157B77C9705049FED70@IDSERV04.idef.com.>
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
Thread-Topic: iDEFENSE Security Advisory 10.10.05: SGI IRIX runpriv Design Error Vulnerability
Thread-Index: AcXN3Mds8FxuAVKtTiqEMkjE+QuXAQ==
From: "iDEFENSE Labs" <labs-no-reply@idefense.com.>
To: <bugtraq@securityfocus.com.>, <vulnwatch@vulnwatch.org.>,
<full-disclosure@lists.grok.org.uk.>
X-Virus-Scanned: antivirus-gw at tyumen.ru
SGI IRIX runpriv Design Error Vulnerability=20
iDEFENSE Security Advisory 10.10.05
www.idefense.com/application/poi/display?id=3D312&type=3Dvulnerabilities
October 10, 2005
I. BACKGROUND
The runpriv program is a setuid root application that checks to see if a
regular user has been granted privileges to execute a certain predefined
command, and if so it runs the command found in the directory=20
/usr/sysadm/privbin with root privileges. It is installed by default=20
under multiple versions of IRIX 6.=20
II. DESCRIPTION
Local exploitation of a design error vulnerability in the runpriv=20
command included in multiple versions of Silicon Graphics Inc.'s IRIX=20
could allow for arbitrary code execution as the root user.
The runpriv program is a setuid root application that checks to see if a
regular user has been granted privileges to execute a certain predefined
command, and if so it runs the command found in the directory=20
/usr/sysadm/privbin with root privileges.=20
The vulnerability specifically exists because runpriv unsafely executes=20
commands after it has verified a user's privileges. This allows an=20
attacker who has been given privileged access to one binary in=20
/usr/sysadm/privbin to effectively execute any command as root. To=20
exploit this vulnerability, all that is required is appending a string=20
of the form "command to execute" to the end of an otherwise authorized=20
and legitimate command. For example, if a user has been authorized to=20
run the mountfs utility, they can exploit this vulnerability in the=20
following way:=20
/usr/sysadm/bin/runpriv mountfs -s test -d / -o \|
"ksh -c 'echo r00t::0:0:r00t:/tmp:/bin/sh >> /etc/passwd'"
su r00t -c "chown root:sys /tmp/passwd123 ;
mv /tmp/passwd123 /etc/passwd ;
chmod 644 /etc/passwd ; su"=20
This will have the effect of adding an administrative user "r00t" to the
system with no password, which allows for trivial privilege escalation.
III. ANALYSIS
Exploitation requires an attacker to have access to an account which has
been granted usage of a binary in the /usr/sysadm/privbin directory. As=20
root must explicitly allow such privileges, the impact of this=20
vulnerability is lessened significantly. Exploitation does not require=20
any knowledge of application internals, making exploitation trivial,=20
even for unskilled attackers.=20
IV. DETECTION
iDEFENSE has confirmed the existence of this vulnerability in SGI IRIX=20
version 6.5.22 (maintenance). It is suspected that previous and later=20
versions of both the feature and maintenance revisions of IRIX 6.5 are=20
also vulnerable.
V. WORKAROUND
Only grant runpriv privileges to trusted users with secure accounts.=20
Alternately, remove the setuid and setgid bits from runpriv:=20
chmod ug-s /usr/sysadm/bin/runpriv=20
VI. VENDOR RESPONSE
A vendor advisory for this vulnerability is to be posted at:
http://www.sgi.com/support/security/advisories.html
Vendor patch 7004 for IRIX 6.5.27 and 6.5.28 is available at:
http://support.sgi.com/
VII. CVE INFORMATION
The Common Vulnerabilities and Exposures (CVE) project has assigned the
name CAN-2005-2925 to this issue. This is a candidate for inclusion in
the CVE list (http://cve.mitre.org), which standardizes names for
security problems.
VIII. DISCLOSURE TIMELINE
09/08/2005 Initial vendor notification
09/09/2005 Initial vendor response
10/05/2005 Coordinated public disclosure
IX. CREDIT
The discoverer of this vulnerability wishes to remain anonymous.
Get paid for vulnerability research
http://www.idefense.com/poi/teams/vcp.jsp
Free tools, research and upcoming events
http://labs.idefense.com
X. LEGAL NOTICES
Copyright (c) 2005 iDEFENSE, Inc.
Permission is granted for the redistribution of this alert
electronically. It may not be edited in any way without the express
written consent of iDEFENSE. If you wish to reprint the whole or any
part of this alert in any other medium other than electronically, please
email [email protected] for permission.
Disclaimer: The information in the advisory is believed to be accurate
at the time of publishing based on currently available information. Use
of the information constitutes acceptance for use in an AS IS condition.
There are no warranties with regard to this information. Neither the
author nor the publisher accepts any liability for any direct, indirect,
or consequential loss or damage arising from use of, or reliance on,
this information.