Original issue date: December 19, 1996<BR>
Last revised: September 24, 1997<BR>
Updated copyright statement

<P>A complete revision history is at the end of this file.

<P>The text of this advisory was originally released on October 11, 1996, as
AA-96.04.Vulnerability.in.HP.Software.Installation.Programs, developed by
AUSCERT. Because of the seriousness of the problem, we are reprinting the
AUSCERT advisory here with their permission. Only the contact information
at the end has changed: AUSCERT contact information has been replaced with
CERT/CC contact information.

<P>We will update this advisory as we receive additional information.
Look for it in an &quot;Updates&quot; section at the end of the advisory.
<HR>

<P>AA-96.04<BR>                        
AUSCERT Advisory

<P>Vulnerability in HP Software Installation Programs<BR>
11 October 1996
<HR>
<BR>
AUSCERT has received information that there is a vulnerability in the
Hewlett Packard Software Distributor product, SD-UX, used to install,
update, remove and package HP-UX software and patches.  This software is
installed by default under HP-UX 10.x and may have been specifically
installed as additional software under HP-UX 9.x.  Any system with the
SD-UX package installed is vulnerable.

<P>This vulnerability may allow local users to gain root privileges.

<P>Exploit details involving this vulnerability have been made publicly
available.

<P>Vendor patches are being developed, but until they are made available,
AUSCERT recommends that sites take the actions suggested in Section 3.

<HR>
<H2>1.  Description</H2>
The HP Software Distributor (SD-UX) is a package that provides a user
interface which can be used to install, update, remove, and package HP-UX
software and patches.

<P>The programs supplied with this package create files in an insecure
manner.  As these programs execute with root privileges, it is possible
to create or over-write arbitrary files on the system.  The default
location of the programs supplied by the package is /usr/sbin.

<P>To determine if you have SD-UX installed on your system, check for
the presence of the swinstall (and related) files using the
following command:
<PRE>
          % ls -l /usr/sbin/sw*
</PRE>
Individual sites are encouraged to check their systems for the SD-UX
package, and if installed, take the actions recommended in Section 3.
<H2>2.  Impact</H2>
Local users may be able to create or over-write arbitrary files on
the system.  This can be leveraged to gain root privileges.
<H2>3.  Workarounds/Solution</H2>
AUSCERT recommends that sites prevent possible exploitation of this
vulnerability by taking the measures stated in Section 3.1 immediately.

<P>If software maintenance is required, AUSCERT advises that sites
use one of the workarounds given in 3.2, preferably that described in
Section 3.2.1.

<P>Vendor patches may also address this vulnerability in the
future (Section 3.3).
<H3>3.1 Remove permissions</H3>
Until official patches are available sites are encouraged to completely
prevent the execution of all vulnerable SD-UX programs by any user
(including root).
<UL>
	 # chmod 400 /usr/sbin/swinstall<BR>
# chmod 400 /usr/sbin/swmodify
</UL>
Note that if only the setuid permissions are removed, it is still
possible for users to gain the privileges of any user executing
the SD-UX programs (including root).
<H3>3.2 Workarounds</H3>
AUSCERT recommends that if software maintenance is required, sites
implement one of the following workarounds until official vendor
patches are made available.

<P>The workaround described in 3.2.1 is the preferred method of doing
software maintenance.  If sites are unable to bring their machines
into single user mode, the workaround given in Section 3.2.2 may be
more applicable.
<H3>3.2.1  Run in single user mode</H3>
If packages must be installed, the machine should be brought into
     single-user mode, execute permissions re-enabled on
/usr/sbin/swinstall,
<UL>
	 # chmod 700 /usr/sbin/swinstall<BR>
# chmod 700 /usr/sbin/swmodify
</UL>
and all symbolic links in /var/tmp and /tmp removed.  The following
command can be used to remove the symbolic links:
<PRE>
          # find /tmp /var/tmp -type l -ok rm {} \;
</PRE>
Once this has been completed, any software package maintenance may be
safely performed.

<P>The execute permissions on the vulnerable programs must be removed
before the machine is brought back into multi-user mode.
<UL>
	 # chmod 400 /usr/sbin/swinstall<BR>
# chmod 400 /usr/sbin/swmodify
</UL>
<H3>3.2.2 Change temporary file environment variable</H3>
This workaround should only be used if the SD-UX programs must be used
while the machine is in multi-user mode.

<P>The SD-UX programs use a number of temporary files.  The location of
these files can be configured using the environment variable TMPDIR.
It is possible to set the environment variable TMPDIR to a non-world
writable directory.  Having the temporary files created in a non-world
writable directory prevents the exploitation of the vulnerability
described in this advisory.

<P>NOTE:  The environment variable must be set in each login
session BEFORE any SD-UX programs are used.

<P>To use this method, the following steps must be taken:
<OL>
<LI>As root, create a non-world writable temporary directory for the
temporary files used by the SD-UX programs.  The location of these
temporary files can be configured with the TMPDIR environment variable.
In this workaround, we have chosen to use the directory
/var/tmp/SD_tmp.
<UL><BR>
	 # mkdir /var/tmp/SD_tmp<BR>
         # chmod 700 /var/tmp/SD_tmp
</UL><BR>
For this workaround to be effective, sites should ensure that the
parent directory of $TMPDIR has the sticky bit set if the parent
directory is world writable.  In this workaround, /var/tmp is the
directory concerned.  The sticky bit on /var/tmp can be set with the
command:
<UL><BR>
# chmod 1777 /var/tmp
</UL>
<BR>

In all sessions where software maintenance is performed:
</LI>

<LI><P>Change permissions on the vulnerable programs:
<UL><BR>
	 # chmod 700 /usr/sbin/swinstall<BR>
# chmod 700 /usr/sbin/swmodify

</UL></LI>

<LI><P>Set the environment variable TMPDIR:
<UL><BR>
	 (under csh)<BR>
# setenv TMPDIR /var/tmp/SD_tmp

<P>(under sh)<BR>
# TMPDIR=/var/tmp/SD_tmp; export TMPDIR
</UL><BR>
and verify that the directory exists and is writable by root.
<UL><BR>
# ls -ld $TMPDIR
</UL></LI>

<LI><P>Perform any software package maintenance.
</LI>

<LI><P> Remove the execute permissions on the vulnerable programs:
<UL>	 # chmod 400 /usr/sbin/swinstall<BR>
# chmod 400 /usr/sbin/swmodify
</UL></LI>

<LI><P>The environment variable TMPDIR is used by many other programs.
You should either exit this interactive session, or reset the
TMPDIR environment variables before continuing.

<P>NOTE:  Steps 2) through 6) must be repeated each time software
maintenance is performed.
</LI></OL>
<H3>3.3 Install vendor patches</H3>

Official vendor patches are currently being developed to address the
vulnerability described in this advisory.  When vendor patches are
made available, AUSCERT suggests that they be installed.

<P><HR>
AUSCERT thanks Information Technology Services of the University of Southern
Queensland, Viviani Paz (The University of Queensland) and Hewlett Packard
for their assistance in this matter.

<P><HR>

<P>
<H2>UPDATES</H2>

<H3>Hewlett-Packard</H3>

Information concerning patches for the vulnerability described in this
advisory can be found in HEWLETT-PACKARD SECURITY BULLETIN,
&quot;Security Vulnerability in swinstall command,&quot; Document ID: HPSBUX9707-064

<P>1)  From your Web browser, access the URL:

<P>
<A HREF=http://us-support.external.hp.com>http://us-support.external.hp.com</A>
<BR>
(for US,Canada, Asia-Pacific, and Latin-America)

<P>
<A HREF="http://europe-support.external.hp.com">
http://europe-support.external.hp.com</A><BR>
 (for Europe)

<P>2)  On the HP Electronic Support Center main screen, select
the hyperlink &quot;Support Information Digests&quot;.

<P>3)  On the &quot;Welcome to HP's Support Information Digests&quot; screen,
under the heading &quot;Register Now&quot;, select the appropriate
hyperlink &quot;Americas and Asia-Pacific&quot;, or &quot;Europe&quot;.

<P>4)  On the &quot;New User Registration&quot; screen, fill in the fields for
the User Information and Password and then select the button
labeled &quot;Submit New User&quot;.

<P>5)  On the &quot;User ID Assigned&quot; screen, select the hyperlink
&quot;Support Information Digests&quot;.

<P>Note what your assigned user ID and password are for
future reference.

<P>6)  You should now be on the &quot;HP Support Information Digests Main&quot;
screen.  You might want to verify that your email address is
correct as displayed on the screen.  From this screen, you may
also view/subscribe to the digests, including the security
bulletins digest.

<P>To get a patch matrix of current HP-UX and BLS security patches
referenced by either Security Bulletin or Platform/OS, click on
      following screens in order:<BR>
  <UL>       Technical Knowledge Database<BR>
         Browse Security Bulletins<BR>
         Security Bulletins Archive<BR>
HP-UX Security Patch Matrix
</UL>

<!--#include virtual="/include/footer_nocopyright.html" -->
<P>Copyright 1996 Carnegie Mellon University.</P>

<HR>

Revision History
<PRE>
Sep. 24, 1997  Updated copyright statement
July 28, 1997 Updates section - added information from Hewlett-Packard.
</PRE>