Original issue date: January 15, 1998<BR>
Last revised: December 9, 1998<BR>
&nbsp;            Updated vendor information for Sun Microsystems, Inc.

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

<P>The CERT Coordination Center has received reports of a vulnerability
in rdist that enables anyone with access to a local account to gain root
privileges. This is not the same vulnerability as the one discussed in
<A HREF="http://www.cert.org/advisories/CA-96.14.rdist_vul.html">CA-96.14</A>.

<P>Section III.A contains instructions on how to determine if your site
is vulnerable. If your implementation of rdist is vulnerable, the CERT/CC
team encourages you to follow your vendor's instructions (Sec. III.B and
Appendix A) or install a freely available version of the rdist program
that is not installed as set-user-id root and is, therefore, not susceptible
to the exploitation described in this advisory (Sec. III.C).

<P>For information on the earlier problem with rdist, see

<P><A
 HREF="http://www.cert.org/advisories/CA-96.14.rdist_vul.html">http://www.cert.org/advisories/CA-96.14.rdist_vul.html</A>.

<P>We will update this advisory as we receive additional information. Please
check our advisory files regularly for updates that relate to your site.

<P><HR>
<H2>I. Description</H2>
The rdist program is a UNIX Operating System utility used to distribute
files from one host to another. On some systems, rdist opens network connections
using a privileged port as the source port. This requires root privileges,
and to attain these privileges rdist on such systems is installed set-user-id
root.

<P>A new vulnerability has been found in some set-user-id root implementations
of rdist. The vulnerability lies in the function expstr(), where macros
supplied as arguments are expanded using sprintf(). It is possible to overwrite
stack frames and call specially pre-crafted native machine code. If the
appropriate machine code is supplied, an attacker can execute arbitrary
programs (such as the shell) with set-user-id root privileges.

<P>Note that this vulnerability is distinct from that discussed in CERT
advisory<A
 HREF="http://www.cert.org/advisories/CA-96.14.rdist_vul.html">CA-96.14</A>.
<H2>II. Impact</H2>
On systems with a vulnerable copy of rdist, anyone with access to a local
account can gain root access.
<H2>III. Solution</H2>
We urge you to follow the steps in Section A to determine if your system
is vulnerable and, if it is, to turn off rdist while you decide how to
proceed.

<P>If your system is vulnerable and you need the functionality that rdist
provides, you should install a vendor patch (Section B). Until you can
do so, you may want to use a freely available version of rdist that does
not need to be installed as set-user-id root and is, therefore, not susceptible
to the exploitation described in this advisory (Section C).
<H3>A. How to check for set-user-id root versions of rdist</H3>
To find set-user-id root versions of rdist and to disable the programs
that are possibly vulnerable, use the following find command or a variant.
Consult your local system documentation to determine how to tailor the
find program on your system.

<P>You will need to run the find command on each system you maintain because
the command examines files on the local disk only. Substitute the names
of your local file systems for
<BR>FILE_SYSTEM_NAMES in the example. Example local file system names are
/, /usr, and /var. You must do this as root.

<P>Note that this is one long command, though we have separated it onto
three lines using backslashes.
<PRE>find FILE_SYSTEM_NAMES -xdev -type f -user root \
 -name '*rdist*' -perm -04000 -exec ls -l '{}' \; \
 -ok chmod 0500 '{}' \;</PRE>
This command will find all files on a system that
<BR>- are only in the file system you name (FILE_SYSTEM_NAMES -xdev) -
are regular files (-type f)
<BR>- are owned by root (-user root)
<BR>- have "rdist" as a component of the name (-name '*rdist*') - are setuid
(-perm -04000)

<P>Once found, those files will
<BR>- have their names and details printed (-exec ls -l '{}')
<BR>- have the setuid mode removed (making the file available only to root)
but only if you type `y' in response to the prompt (-ok chmod 0500 '{}'
\;)
<H3>B. Obtain and install the appropriate patch</H3>
Below is a list of vendors who have provided information for this advisory.
Details are in Appendix A, and we will update the appendix as we receive
more information.

<P>Berkeley Software Design, Inc. (BSDI)
<BR>Caldera
<BR>Digital Equipment Corp.
<BR>FreeBSD, Inc.
<BR>Hewlett-Packard Company
<BR>IBM Corporation
<BR>NEC Corporation
<BR>NCR Corporation
<BR>The Santa Cruz Operation, Inc. (SCO)
<BR>Siemens-Nixdorf
<BR>Silicon Graphics Inc. (SGI)
<BR>Sun Microsystems, Inc.

<P>If your vendor's name is not on this list, please contact the vendor
directly.
<H3>C. If you need the functionality that rdist provides but a patched version is not yet available from your vendor, consider installing rdist-6.1.3,</H3>
which is freely available from<A HREF="ftp://usc.edu/pub/rdist/rdist-6.1.3.tar.gz"></A>

<P><A HREF="ftp://usc.edu/pub/rdist/rdist-6.1.3.tar.gz">ftp://usc.edu/pub/rdist/rdist-6.1.3.tar.gz</A>

<P>MD5 (rdist-6.1.3.tar.gz) = 8a76b880b023c5e648b7cb77b9608b9f

<P>The README file in the distribution explains how to configure and install
this version of rdist.

<P>We recommend that you configure this version of rdist to use rsh instead
of rcmd. Here is the relevant text from the README:

<P>"By default rdist uses <I>rsh(1c)</I> to make connections to remote
hosts. This has the advantage that rdist does not need to be setuid to
"root". This eliminates most potential security holes. It has the disadvantage
that it takes slightly more time for rdist to connect to a remote host
due to the added overhead of doing a fork() and then running the <I>rsh(1c)</I>
command."

<P>Some sites with sufficient expertise use the ssh program in conjunction
with rdist, instead of using rcmd or rsh. If you have the expertise, you
may want to implement this configuration.

<P>For further details on this option see "Ssh (Secure Shell) FAQ - Frequently
asked questions," Section 4.4, "Can I use rdist with ssh?" It is available
from

<P><A HREF="http://www.uni-karlsruhe.de/~ig25/ssh-faq/ssh-faq-4.html">http://www.uni-karlsruhe.de/~ig25/ssh-faq/ssh-faq-4.html</A>

<P>For details on how to obtain ssh, see FAQ Section 3.4, "Where can I
obtain ssh?" This section can be found in

<P><A HREF="http://www.uni-karlsruhe.de/~ig25/ssh-faq/ssh-faq-3.html">http://www.uni-karlsruhe.de/~ig25/ssh-faq/ssh-faq-3.html</A>
<BR>

<P><HR>
<H2>Appendix A - Vendor Information</H2>
Below is a list of the vendors who have provided information for this advisory.
We will update this appendix as we receive additional information. If you
do not see your vendor's name, the CERT/CC did not hear from that vendor.
Please contact the vendor directly.
<BR>
<H3>Berkeley Software Design, Inc. (BSDI)</H3>
BSDI shipped a patch for this for our 2.1 release (U210-018) when the original
Bugtraq advisory was released. The 3.0 version of rdist is not vulnerable
and in fact is no longer even setuid.
<H3>Caldera</H3>
This message is to inform CERT that neither Caldera Network Desktop nor
Caldera OpenLinux ship rdist SUID and are thus not vulnerable. See our
advisory on this subject at: <A HREF="http://www.caldera.com/tech-ref/security/SA-1997.23.txt">http://www.caldera.com/tech-ref/security/SA-1997.23.txt</A>
<BR>
<H3>Digital Equipment Corp.</H3>
This reported problem is not present for Digital's ULTRIX or Digital UNIX
Operating Systems Software.
<DIV ALIGN=right>DIGITAL EQUIPMENT CORPORATION</DIV>

<H3>FreeBSD, Inc.</H3>
2.1.0 is vulnerable.
<BR>2.1.5, 2.1.6 and 2.1.7 are and 2.1-stable are not. In any case, upgrading
to 2.1.7 or even better, 2.1-stable should be considered.
<BR>If there is demand, we'll release a patch for 2.1.0

<P>All 2.2 releases, 2.2-stable and FreeBSD-current are not vulnerable.
<BR>
<H3>Hewlett-Packard Company</H3>
HP is -not- vulnerable; the problem didn't exist in 9.X, and has been fixed
in 10.X with Security Bulletin #36 (HPSBUX9608-036) last year. Patch numbers
change frequently because of cumulative patching, so please check current
patch ID information either by bulletin or by platform/release at our HP
Electronic Support Center in the "Security Patch Matrix," which is updated
every 24 hours.

<P>1) From your Web browser, access the URL:
<BR><A HREF="http://us-support.external.hp.com">http://us-support.external.hp.com</A>
<BR>(US,Canada,Asia-Pacific, and Latin-America)

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

<P>2) On the HP Electronic Support Center main screen, select the hyperlink
"Support Information Digests".
<BR>
<BR>3) On the "Welcome to HP's Support Information Digests" screen, under
the heading "Register Now", select the appropriate hyperlink "Americas
and Asia-Pacific", or "Europe".

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

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

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

<P>6) You should now be on the "HP Support Information Digests Main" 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:

<P>Technical Knowledge Database
<BR>Browse the HP Security Bulletins Archive
<BR>HP-UX Security Patch Matrix
<H3>IBM Corporation</H3>
All versions of AIX are vulnerable to this buffer overflow. There is no
3.2 fix. It is recommended that 3.2 customers upgrade to a higher level.
The following APARs will be available for AIX version 4 soon.

<P>AIX 3.2: upgrade to 4.1.5 or higher
<BR>AIX 4.1: IX70876
<BR>AIX 4.2: IX70875
<H4>To Order</H4>
APARs may be ordered using Electronic Fix Distribution (via FixDist) or
from the IBM Support Center. For more information on FixDist, reference
URL:

<P><A HREF="http://service.software.ibm.com/aixsupport/">http://service.software.ibm.com/aixsupport/</A>

<P>or send e-mail to <A HREF="mailto:aixserv@austin.ibm.com">aixserv@austin.ibm.com</A>
with a subject of "FixDist".

<P>IBM and AIX are registered trademarks of International Business Machines
Corporation.
<H3>NEC Corporation</H3>
The following systems are NOT affected by this vulnerability:

<P>UX/4800
<BR>UX/4800(64)
<BR>EWS-UX/V(Rel4.2MP)
<BR>EWS-UX/V(Rel4.2)

<P>UP-UX/V(Rel4.2MP)
<BR>To report a new vulnerability, contact <A HREF="mailto:UX48-security-support@nec.co.jp">&lt;UX48-security-support@nec.co.jp></A>.

<H3>NCR Corporation</H3>

<P> 
NCR is delivering a set of operating system dependent patches which
contain an update for this problem .  Accompanying each patch is a
README file which discusses the general purpose of the patch and
describes how to apply it to your system.

<P> 
Recommended solution:

<P>Apply one of the following patches depending on the revision of the
inet package installed on your system. To check its version execute:
<BLOCKQUOTE> 
        pkginfo -x inet
</BLOCKQUOTE> 

<P> 
For inet 5.01.xx.xx: - PINET501 (Version later than 05.01.01.59)
<BR>
For inet 6.01.xx.xx: - PINET601 (Version later than 06.01.00.19)
<BR>
For inet 6.01.xx.xx: - PINET601 (Version later than 06.02.00.01)

<P>
<H3>OpenBSD</H3>
OpenBSD does not have this problem. None of the versions of rdist distributed
are setuid or setgid.
<BR>
<H3>The Santa Cruz Operation, Inc. (SCO)</H3>
SCO has determined that the following SCO operating systems are not vulnerable:

<P>- SCO CMW+ 3.0
<BR>- SCO Open Desktop/Open Server 3.0
<BR>- SCO OpenServer 5.0
<BR>- SCO UnixWare 2.1
<H3>Siemens-Nixdorf Informationssysteme AG</H3>


 Rdist has not been shipped with ReliantUNIX versions prior to 5.43C.
 The latest ReliantUNIX-Y/N version 5.43C contains a vulnerable rdist.

<P>For this version we recommend to remove the set-user-id root bit from 
 /usr/ucb/rdist following the instructions given in section III.A.

<P>ReliantUNIX-Y/N 5.44A will be shipped with rdist 6.1.3. 
 Patches for ReliantUNIX-N/Y 5.43C are available on requirement.
 Please ask SNI's customers service for details."
 
<H3>Silicon Graphics Inc. (SGI)</H3>
Silicon Graphics Inc. issued Security Advisory, "IRIX ordist Buffer Overrun
Vulnerability," 19970509-02-PX, August 5, 1997.

<P>Patches are available via anonymous FTP and your service/support provider.

<P>The SGI anonymous FTP site is sgigate.sgi.com (204.94.209.1) or its
mirror, ftp.sgi.com. Security information and patches can be found in the
~ftp/security and ~ftp/patches directories, respectfully.

<P>For subscribing to the wiretap mailing list and other SGI security related
information, please refer to the Silicon Graphics Security Headquarters
website located at:

<P><A HREF="http://www.sgi.com/Support/security/security.html">http://www.sgi.com/Support/security/security.html</A>

<H3>Sun Microsystems, Inc.</H3>

<P>Please refer to Sun Microsystems, Inc. Security Bulletin, "rdist," Number:
#00179, distributed November 18, 1998 for additional information relating to
this vulnerability.

<P>Patches and Checksums are available to all Sun customers via World Wide Web at:
        <A HREF="http://sunsolve.sun.com/sunsolve/pubpatches/patches.html">http://sunsolve.sun.com/sunsolve/pubpatches/patches.html</A>

<P>Sun security bulletins are available via World Wide Web at:
        <A HREF="http://sunsolve.sun.com/pub-cgi/secbul.pl">http://sunsolve.sun.com/pub-cgi/secbul.pl</A>

<P><HR>

<P>The CERT Coordination Center thanks Hiroshi Nakano of Ryukoku University,
Japan for reporting this problem. We also thank Wolfgang Ley of DFN-CERT
for his assistance with the Solutions section of the advisory.

<P><HR>

<P><HR>

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

<HR>

Revision History
<PRE>
Dec.  9, 1998   Updated vendor information for Sun Microsystems, Inc.
May 27, 1998    Updated vendor information for Sun Microsystems.
Jan. 15, 1998   Updated vendor information for NCR.
Nov. 14, 1997   Updated vendor information for Siemens-Nixdorf.
Oct. 3, 1997    Appendix A - added information for Caldera.
Sept. 30, 1997  Updated copyright statement
Sept. 15, 1997  Appendix A - added information for OpenBSD and Silicon Graphics, Inc.
</PRE>