Original issue date: July 24, 1996<BR>
Last revised: January 15, 1998<BR>
Updated information for NCR.

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

<STRONG>This advisory supersedes CA-91.20 and CA-94.04. </STRONG>

<P>The CERT Coordination Center has received reports that a new vulnerability
in rdist has been found and an exploitation script is widely available.
Current reports indicate that the script works on x86-based versions of the
UNIX Operating System; however, we believe that it would not be difficult to
write variants that work on other instruction sets and configurations.

<P>The CERT/CC Staff recommends following the steps in Section III.A. to
determine if your system is vulnerable and to disable vulnerable programs,
then following your vendor's instructions (Section III.B and Appendix A).
Until you can install a vendor patch, you may want to install a freely
available version of rdist, noted in Section III.C.

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

<H2>I. Description</H2>

The rdist program is a UNIX Operating System utility used to distribute
files from one host to another. On most systems, rdist is installed as
set-user-id root, a necessity due to its design. Unfortunately, this
setting makes it a favorite target for vulnerability investigation.

<P>A new vulnerability in rdist has been discovered and reported. The
vulnerability lies in the lookup() subroutine where the value of a
command line argument is used to overflow the subroutine call stack.
If that argument is specially crafted with native machine code,
lookup() returns control to the code added to the call stack instead of
the subroutine that called lookup(). If, for example, this added code
uses a member of the exec system call family and names /bin/sh as the
program to be executed, that shell is then run with set-user-id root
privileges. No matter what code is added, the code runs with
set-user-id root privileges.

<P>An exploitation program, which is circulating on the Internet, takes
advantage of this vulnerability. While it purports to work only on
x86-based versions of the UNIX Operating System, variants tuned to other
instruction sets and configurations are straightforward to write.

<H2>II. Impact</H2>


On unpatched systems, 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 potentially vulnerable and, if it is, to turn off rdist while you
decide how to proceed.

If you need the functionality that rdist provides, install a vendor
patch (Sec. B). Until you can do so, you may want to install 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 (Sec. C).

<H3>A. How to determine if your system is vulnerable</H3>

To determine if a system is vulnerable and to disable the programs
that are believed to be 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 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 two lines using a back-slash.
<PRE>

find FILE_SYSTEM_NAMES -xdev -type f -user root \
       -name rdist -perm -04000 -print -ok chmod u-s '{}' \;

</PRE>

<P>This command will find all files on a system that are

<LI><P>only in the file system you name (FILE_SYSTEM_NAMES -xdev)
<LI>regular files (-type f)<BR>
<LI>owned by root (-user root)<BR>
<LI>named rdist<BR>
<LI>setuid (-perm -04000)</LI>

<P>Once found, those files will

<LI><P>have their names printed (-print)
<LI>have the setuid mode removed, but only if you type `y'
in response to the prompt (-ok chmod u-s '{}' \;)

<H3>B. Obtain and install the appropriate patch</H3>

Below is a list of vendors who have provided information.
Details are in Appendix A of this advisory. We will update the
advisory as we receive more information.

<P>Berkeley Software Design, Inc.<BR>
             Data General Corporation<BR>
             Digital Equipment Corporation<BR>
             FreeBSD, Inc.<BR>
             Hewlett-Packard Company<BR>
             IBM Corporation<BR>
             Linux<BR>
             NEC Corporation<BR>
             NCR Corporation<BR>
	     The Santa Cruz Operation<BR>
             Sequent Computer Systems<BR>
             Silicon Graphics, Inc.<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:</H3> Consider installing
rdist-6.1.3, which is freely available from

<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 strongly recommend that you configure this version of rdist to use
rsh instead of rcmd. Here is the relevant text from the README:
<BLOCKQUOTE>
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 &quot;root&quot;. 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.
</BLOCKQUOTE>
For versions of rdist V6 prior to 6.1.3: If you compile rdist with
-DDIRECT_RCMD *and* you run rdist setuid to root, you are vulnerable
to the problem described in this advisory. You need to update to
rdist version 6.1.3.

<P>Note that by default, rdist V6 is distributed to compile without
-DDIRECT_RCMD and not run setuid to root. If you have previously
built version 6.X of rdist with the -DDIRECT_RCMD directive added to
the $(DEFS_LOCAL) and set &quot;RDIST_MODE = 4555&quot; in &quot;Makefile.local&quot;, we
recommend that you first disable this version with the find command
given in Section III.A above, then either rebuild rdist with its
default settings or upgrade to 6.1.3.

<P><HR>

<H2>Appendix A: Vendor Information</H2>


Below is information we have received from vendors concerning the
vulnerability described in this advisory. If you do not see your vendor's
name, please contact the vendor directly for information.


<H3>Berkeley Software Design, Inc.</H3>

BSD/OS is vulnerable to this problem.

<P>BSDI has released a patch for rdist in BSD/OS V2.1.

<P>Sites using the non-kerberized rdist should install patch
U210-018, which is available from the

<P>
	<A HREF=mailto:patches@bsdi.com>patches@bsdi.com</A> 

<P>mailback server and also from:

<P>
<A HREF=ftp://ftp.bsdi.com/bsdi/patches/patches-2.1/U210-018>ftp://ftp.bsdi.com/bsdi/patches/patches-2.1/U210-018</A>

<P>md5 checksum: 86005d8bbb67eb737120741bd254d26a U210-018

<P>Domestic licensees that are using the Kerberos package
should install patch D210-018 from: 

<P><A HREF=mailto:patches@bsdi.com>patches@bsdi.com</A> 

<P>mailback server (this patch is available only to domestic
licensees because of US export restrictions on crypto
software). Be sure to install only the appropriate patch.

<P>md5 checksum: b2060ec4eb9b18ace4e76bcb9441353f D210-018

<H3>Data General Corporation</H3>

Data General does not provide a version of rdist as part of the
standard release of DG/UX. Rdist is available as contributed
software which is not supported by Data General. This problem will
be fixed in the next release of the contributed software package.


<H3>Digital Equipment Corporation</H3>

#96.0329A

<P>SOURCE:

<P>  Digital Equipment Corporation<BR>
Software Security Response Team

<P>Copyright (c) Digital Equipment Corporation 1996. All rights reserved.</P>

<P>SUMMARY PATCH-ID INFORMATION:<BR>
The  rdist patch-id's identified in this advisory will not be
applicable to versions previous to those identified in the
         OP/SYS identified for each patch.

<P>
<STRONG>*NOTE*</STRONG>
<OL><LI>
 These patch's must be applied if an update or installation is performed thru V3.2c of Digital UNIX<BR></LI>
<LI>The solutions have been included in releases of Digital UNIX
after V3.2c</LI></OL>

<P>TITLES
<PRE>


        OSF_V2_0     (Patch ID: OSFV20-244-1&gt;<BR>
        OSF_V3_0     (Patch ID: OSF300-242)<BR>
        OSF_V3_0B    (Patch ID: OSF305-300242)<BR>
        OSF_V3_2     (Patch ID: OSF320-184)<BR>
        OSF_V3_2B    (Patch ID: OSF325-320184)<BR>
	OSF_V3_2C    (Patch ID: OSF350-061)


</PRE>

<P>PATCH AVAILABILITY:

<P>Software service contract or warranty customers may obtain
the patched rdist through normal Digital support channels, via
AES (Advanced Electronic Services). These patch's are available
from the remedial patch stream for the versions identified
above and may be found in the applicable versions readme
files.

<P>
<A HREF=ftp://ftp.service.digital.com/public/osf>ftp://ftp.service.digital.com/public/osf</A>

<P>Please refer to applicable Release Note information prior
to upgrading your installation.

<P>Note:  Non-contract/non-warranty customers should contact<BR>
         local Digital support channels for information<BR>
regarding these patch's.

<P>As always, Digital urges you to periodically review your
system management and security procedures. Digital will
continue to review and enhance the security features of its
products and work with customers to maintain and improve the
security and integrity of their systems.
<P ALIGN=RIGHT> - DIGITAL EQUIPMENT CORPORATION
<BR>
7/23/96                              
</P>

<H3>FreeBSD, Inc.</H3>

 Versions affected:<BR>
<UL>FreeBSD 2.0, 2.0.5, 2.1, 2.1-stable, and 2.2-current</UL>
        Versions corrected:
<UL>
                2.1-stable and 2.2-current as of 1996-07-11</UL>
        Workaround:

<P>As root, execute the commands:
<UL>
                        # chflags noschg /usr/bin/rdist<BR>
# chmod u-s,go-rx /usr/bin/rdist
</UL>
        Patches:

<P>
<A HREF=ftp://freebsd.org/pub/CERT/patches/SA-96:16/>ftp://freebsd.org/pub/CERT/patches/SA-96:16/</A>

<P>For more information:

<P>
<A HREF=ftp://freebsd.org/pub/CERT/advisories/SA-96:16/>ftp://freebsd.org/pub/CERT/advisories/SA-96:16/</A>

<H3>Hewlett-Packard Company</H3>

The rdist vulnerability can be eliminated from releases 10.0,
10.01, 10.10, and 10.20 of HP-UX by applying the patches mentioned
below.  HP-UX releases prior to 10.X and after 10.20 (i.e., 10.30)
are not vulnerable.  HP/UX 9.X is not vulnerable.

<P>
<TABLE BORDER="0">
<TR>
<TD>
Apply patches PHNE_8107</TD><TD> (series 700/800, HP-UX 10.00 &amp; 10.01)</TD></TR>
<TR><TD>and PHCO_7798</TD><TD> (series 700/800, HP_UX 10.00 &amp; 10.01)</TD></TR>
       <TR><TD> or patch PHNE_7919</TD><TD> (series 700/800, HP-UX 10.10)</TD></TR>
<TR><TD>PHNE_7920</TD><TD> (series 700/800, HP-UX 10.20)</TD></TR></TABLE>

<P>   All patches are available now, except PHNE_7920 which
will be available after 8 August.

<P>See HEWLETT-PACKARD SECURITY BULLETIN: HPSBUX9608-036, 08 Aug 96
for more details.
<H3>IBM Corporation</H3>

AIX is vulnerable to this problem. Fixes are in process but are
not yet available. The APAR numbers for the fixes are given below.
In the meantime, we recommend removing the setuid bit from the
/usr/bin/rdist program.
<BR>
To remove the setuid bit, follow these instructions.

<P>As the root user, type:
<UL>
chmod u-s /usr/bin/rdist
</UL>
<H4>AIX 3.2</H4>

<P>Apply the following fix to your system:
<UL>
APAR - IX59741
</UL>
<H4>AIX 4.1</H4>

<P>Apply the following fix to your system:
<UL>
APAR - IX59742
</UL>
To determine if you have this APAR on your system, run the following
command:
<UL>
instfix -ik IX59742
</UL>
<H4>AIX 4.2</H4>

<P>Apply the following fix to your system:
<UL>
APAR - IX59743
</UL>
To determine if you have this APAR on your system, run the following
command:
<UL>
instfix -ik IX59743
</UL>
<H4>To Order</H4>
APARs may be ordered using 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 <BR>
	<A HREF=mailto:aixserv@austin.ibm.com>aixserv@austin.ibm.com</A> 
with a subject of &quot;FixDist&quot;.

<P>IBM and AIX are registered trademarks of International Business Machines
Corporation.

<H3>Linux</H3>

Almost all Linux distributions ship with rdist non setuid.
If you have changed your rdist to run setuid you are probably
vulnerable.

<H3>NEC Corporation</H3>

<P>
<TABLE BORDER="0">
<TR>
<TD>
EWS-UX/V(Rel4.2)</TD><TD>  not vulnerable</TD></TR>
<TR>
<TD>
EWS-UX/V(Rel4.2MP)</TD><TD>   not vulnerable</TD></TR>
<TR>
<TD>
UP-UX/V(Rel4.2MP)</TD><TD>    not vulnerable</TD></TR>

<TR>
<TD>UX/4800    </TD><TD>          not vulnerable</TD></TR>
</TABLE>

<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: <BR>
 
Apply one of the following patches depending on the revision of the
inet package installed on your system. To check its version execute:

<P>pkginfo -x inet

<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>The Santa Cruz Operation</H3>

The following releases of SCO Software are known to contain a version of
rdist that is vulnerable:

<P>SCO OpenServer 5.0.2, 5.0.0<BR>
SCO Internet FastStart 1.0

<P>SCO Open Server Enterprise/Network System 2.0, 3.0<BR>
    SCO Open Desktop 2.0, 3.0<BR>
SCO Open Desktop Lite 3.0

<P>SCO UnixWare 2.0, 2.1

<P>SCO TCP/IP 1.2.0, 1.2.1

<P>Patches are being developed for the following releases:

<P>SCO OpenServer 5.0.2, 5.0.0<BR>
    SCO Internet FastStart 1.0<BR>
SCO UnixWare 2.1
<H3>Sequent Computer Systems</H3>

Sequent systems do not ship with rdist.

<H3>Silicon Graphics, Inc.</H3>

    All SGI IRIX versions of rdist are not vulnerable.<BR>
No action is required.

<P>(When using the find command on SGI IRIX systems, use -mount
instead of - -xdev. The latter is not supported on SGI IRIX
systems.)

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

The following patches correct the rdist vulnerability (Sun bug id 1258139),
described in this advisory, on systems running Solaris 1.x or 2.x.
<PRE>

Architecture   SunOS    Solaris   Patch     MD5 checksum for rdist binary
- ---------------------------------------------------------------------------
SPARC          4.1.3     1.1    100383-07  5F2C2B782881FE18D2737B5FA0AEC489
               4.1.3_U1  1.1.1  103823-01  B330358F4E66CD544B9B60AF453C5F2B
               4.1.4     1.1.2  103824-02  419369cc4b3514a9c12b4cdac207fde7
               5.3       2.3    101494-02  1DD34E9E7C50B2C863E30D67DFD1A905
               5.4       2.4    103813-01  90DD81A4C32F7D583737F171B821386B
               5.5       2.5    103815-01  C3BBE3F6758B0BBA7D45CB05009ED80E
               5.5.1     2.5.1  103817-01  89735351119896FEB7469DCA76788561

X86            5.4       2.4    103814-01  EE4509D9CF87DBD29ABB7A72C8330F89
               5.5       2.5    103816-01  3363670F316A06803ECCDD9FFAE95126
               5.5.1     2.5.1  103818-01  8C2E8CFDE7A2AE6D5EC89139D592E71C

PowerPC        5.5.1     2.5.1  103819-01  C3FC0E54B23E4209496A4735D09DFFEF


</PRE>

<P>These patches will be available through your local SunService and SunSoft
Support Services organizations by 9:00 PDT Wednesday, July 24. They will
also be available at the same time from SunSolve Online, via the URL

<P>
<A HREF=http://sunsolve1.sun.com>http://sunsolve1.sun.com</A>.

<HR>

<P>The CERT Coordination Center staff thanks Michael Cooper<BR>
<A HREF=mailto:(Michael.Cooper@Sun.Com>(Michael.Cooper@Sun.Com</A> 
) for his work on resolving this problem. He is the
maintainer of the publicly available version of rdist.

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

<HR>

Revision History
<PRE>
Jan. 15, 1998  Updated vendor information for NCR.
Sep. 24, 1997  Updated copyright statement
Nov. 27, 1996  Appendix A, Sun - updated patch information for
	       Solaris 1.1.2, SunOS 4.1.4.
Aug. 30, 1996  Information previously in the README was inserted into the
               advisory.
Aug. 22, 1996  Appendix A, SGI - added note about using the find command.
Aug. 12, 1996  Appendix A, Hewlett-Packard - modified the entry.
July 30, 1996  Solution Section III.A - corrected two misprints in the
	       results of the find command.
July 24, 1996  Appendix A, Digital - added information.
               IBM - put a new URL in the &quot;To Order&quot; section.


</PRE>