TUCoPS :: Unix :: General :: ciach25a.txt

Vulnerability in rlogin/term

-----BEGIN PGP SIGNED MESSAGE-----

             __________________________________________________________

                       The U.S. Department of Energy
                    Computer Incident Advisory Capability
                           ___  __ __    _     ___
                          /       |     /_\   /
                          \___  __|__  /   \  \___
             __________________________________________________________

                             INFORMATION BULLETIN

                          Vulnerability in rlogin/term

October 28, 1997 23:00 GMT                                        Number H-25a
______________________________________________________________________________
PROBLEM:       A vulnerability in many implementations of the rlogin program,
               including eklogin and klogin.
PLATFORM:      Systems using any of the listed vendors maybe vulnerable.
                  Berkeley Software Design, Inc. (BSDI) 
                  Cray Research - A Silicon Graphics Company
                  Digital Equipment Corporation
                  FreeBSD, Inc.
                  Hewlett-Packard Corporation
                  IBM Corporation
                  Linux Systems
                  NEC Corporation
                  NeXT Software, Inc.
                  The Open Group
                  The Santa Cruz Operation (SCO)
                  Sun Microsystems, Inc.
DAMAGE:        Local users may gain root privileges.
SOLUTION:      Install vendor patches for this problem as listed in (Sec.
               III.A). Until you can do so, turn off rlogin or replace it with
               a wrapper (see Sec. III.B.2).
______________________________________________________________________________
VULNERABILITY  Exploit details involving this vulnerability have been made
ASSESSMENT:    publicly available.
______________________________________________________________________________

[ Appended to H-25 on October 28, 1997 with patch release information from Sun ]

[ Start CERT Advisory ]

=============================================================================
CERT(sm) Advisory CA-97.06
Original issue date: February 6, 1997
Last revised: --
             
Topic: Vulnerability in rlogin/term
- ------------------------------------------------------------------------------

The CERT Coordination Center has received reports of a vulnerability in many
implementations of the rlogin program, including eklogin and klogin. By
exploiting this vulnerability, users with access to an account on the system
can cause a buffer overflow and execute arbitrary programs as root.

The CERT/CC staff recommends installing a vendor patch for this problem
(Sec. III.A). Until you can do so, we urge you to turn off rlogin or replace
it with a wrapper (see Sec. III.B.2).

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

- ------------------------------------------------------------------------------

I.   Description

     The rlogin program provided by many UNIX systems, as well as some non-UNIX
     systems, is described in RFC 1282. Here is an excerpt from that RFC that
     describes its elemental functionality:

        "The rlogin facility provides a remote-echoed, locally flow-
         controlled virtual terminal with proper flushing of output.
         It is widely used between Unix hosts because it provides
         transport of more of the Unix terminal environment semantics
         than does the Telnet protocol, and because on many Unix hosts
         it can be configured not to require user entry of passwords
         when connections originate from trusted hosts."

     The key point from this description is that the rlogin program passes
     the terminal type description from the local host to the remote host.
     This functionality allows terminal-aware programs such as full-screen
     text editors to operate properly across a computer-to-computer
     connection created with rlogin.

     To do this, the rlogin program uses the current terminal definition as
     identified by the TERM environment variable. The protocol described in
     RFC 1282 explains how this terminal information is transferred from the
     local machine where the rlogin client program is running to the remote
     machine where service is sought.

     Unfortunately, many implementations of the rlogin program contain a
     defect whereby the value of the TERM environment variable is copied to
     an internal buffer without due care. The buffer holding the copied value
     of TERM can be overflowed. In some implementations, the buffer is a local
     variable, meaning that the subroutine call stack can be overwritten and
     arbitrary code executed. The executed code is under the control of the
     user running the rlogin program.

     In addition, the rlogin program is set-user-id root. rlogin requires
     these increased privileges so it can allocate a port in the required
     range, as described in the in.rlogind (or rlogind) manual page:

         "The server checks the client's source port. If the port is not
          in the range 0-1023, the server aborts the connection."

     In summary, rlogin is a set-user-id root program that in many
     implementations contains a programming defect whereby an internal buffer
     can be overflowed and arbitrary code can be executed as root.

II.  Impact

     Users can become root if they have access to an account on the system.

III. Solution

     Install a patch from your vendor if one is available (Section A).
     Until you can take one of those actions, we recommend applying the
     workaround described in Section B.

     A.  Obtain and install a patch for this problem.

         Below is a list of vendors who have provided information about
         rlogin. Details are in Appendix A of this advisory; we will update
         the appendix as we receive more information. If your vendor's name is
         not on this list, the CERT/CC did not hear from that vendor. Please
         contact your vendor directly. 

              Berkeley Software Design, Inc. (BSDI)
              Cray Research - A Silicon Graphics Company
              Digital Equipment Corporation
              FreeBSD, Inc. 
              Hewlett-Packard Corporation
              IBM Corporation
              Linux Systems
              NEC Corporation
              NeXT Software, Inc. 
              The Open Group
              The Santa Cruz Operation (SCO)

     B.  Until you are able to install the appropriate patch, we recommend
         one of the following workarounds:

         1. Turn off rlogin.
            If your user community does not use rlogin, turn it off.
            As root, do the following:

                % chmod 0 /usr/bin/rlogin

            You may find the rlogin program in some other directory on
            your system. Example directories are: /bin, /usr/bin, /usr/ucb.

            Note: On some systems, rlogin is provided in different forms
            that do additional work. Examples are eklogin (kerberos
            authentication plus encryption of the data stream) and klogin
            (kerberos authentication only). These, too, need to be turned
            off.

         2. Replace the rlogin program with a wrapper.
            We have written a prototype wrapper that is available at

          URL ftp://info.cert.org/pub/tools/rlogin_wrapper/rlogin_wrapper.c

            The PGP signature for this file is available at

          URL ftp://info.cert.org/pub/tools/rlogin_wrapper/rlogin_wrapper.c.asc

            To verify that this file is correct, fetch both the
            rlogin_wrapper.c and rlogin_wrapper.c.asc files and check the
            signature with pgp as in

               % pgp rlogin_wrapper.c.asc rlogin_wrapper.c

            Notes:
               * You may have to change this program to get it to compile and
                  work correctly on your system.

               * If you have different forms of rlogin, as noted in the
                  previous section, then you will need to replace those forms
                  with the wrapper as well.

- ------------------------------------------------------------------------------

Appendix A - Vendor Information

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.


Berkeley Software Design, Inc. (BSDI)
====================================
        Unpatched BSD/OS 2.1 systems are vulnerable to this problem.  A patch
        was issued that resolved this problem in August 1996.  The patch is
        available from the <patches@BSDI.COM> mail server or via anonymous ftp
        at:

             ftp://ftp.bsdi.com/bsdi/patches/patches-2.1/U210-021


Cray Research - A Silicon Graphics Company
==========================================
        This problem has been corrected in all currently supported versions
        of Unicos.


Digital Equipment Corporation
=============================
        At the time of writing this document, patches(binary kits) are
        available from your normal Digital Support Channel.
       
        rlogin patches are available for:
            DIGITAL UNIX V3.2c, V3.2de1/de2, V3.2g, V3.2g, V4.0, V4.0a, V4.0b.
            DIGITAL ULTRIX V4.4 VAX & MIPS, V4.5 VAX and MIPS

                                DIGITAL EQUIPMENT CORPORATION  
                                -----------------------------  

FreeBSD, Inc.
=============
        This vulnerability is present in FreeBSD 2.1.5 and previous
        versions.  It was fixed in all FreeBSD source and
        binary distributions dated after 1996/07/25.

        The following source code patch may be applied to FreeBSD
        2.1.5 based distributions, and should work in previous
        distributions.  Users unable to apply this patch and
        recompile the rlogin binary are encouraged to use the
        wrapper provided by CERT.


Index: rlogin.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/rlogin/rlogin.c,v
retrieving revision 1.5.4.1
retrieving revision 1.5.4.2
diff -c -r1.5.4.1 -r1.5.4.2
*** rlogin.c    1996/06/23 13:08:27     1.5.4.1
- - --- rlogin.c  1996/07/25 18:29:35     1.5.4.2
***************
*** 102,107 ****
- - --- 102,108 ----
  char *speeds[] = {
        "0", "50", "75", "110", "134", "150", "200", "300", "600", "1200",
        "1800", "2400", "4800", "9600", "19200", "38400", "57600", "115200"
+ #define       MAX_SPEED_LENGTH        (sizeof("115200") - 1)
  };
 
  #ifdef OLDSUN
***************
*** 259,265 ****
                exit(1);
        }
 
!       (void)strcpy(term, (p = getenv("TERM")) ? p : "network");
        if (ioctl(0, TIOCGETP, &ttyb) == 0) {
                (void)strcat(term, "/");
                (void)strcat(term, speeds[(int)ttyb.sg_ospeed]);
- - --- 260,270 ----
                exit(1);
        }
 
! #define       MAX_TERM_LENGTH (sizeof(term) - 1 - MAX_SPEED_LENGTH - 1)
!
!       (void)strncpy(term, (p = getenv("TERM")) ? p : "network",
!                     MAX_TERM_LENGTH);
!       term[MAX_TERM_LENGTH] = '\0';
        if (ioctl(0, TIOCGETP, &ttyb) == 0) {
                (void)strcat(term, "/");
                (void)strcat(term, speeds[(int)ttyb.sg_ospeed]);


Hewlett-Packard Corporation
===========================
        This rlogin problem is fixed:

        PHNE_8807 10.20        s700/800
        PHNE_8806 10.10, 10.0X s700/800
        PHNE_8805 9.X          s700/800

        See Hewlett-Packard Security Bulletin HPSBUX9702-052, dated
        February 5, 1997.


IBM Corporation
===============
  See the appropriate release below to determine your action.


  AIX 3.2
  -------
    Apply the following fix to your system:

       APAR - IX57724 (PTF - U442613)

    To determine if you have this PTF on your system, run the following
    command:

       lslpp -lB U442613


  AIX 4.1
  -------
    Apply the following fix to your system:

        APAR - IX57972

    To determine if you have this APAR on your system, run the following
    command:

       instfix -ik IX57972

    Or run the following command:
   
       lslpp -h bos.net.tcp.client

    Your version of bos.net.tcp.client should be 4.1.4.13 or later.


  AIX 4.2
  -------
    No APAR required.  Fix already contained in the release.


  To Order
  --------
    APARs may be ordered using Electronic Fix Distribution (via FixDist)
    or from the IBM Support Center.  For more information on FixDist,
    reference URL:

       http://service.software.ibm.com/aixsupport/

    or send e-mail to aixserv@austin.ibm.com with a subject of "FixDist".


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


Linux Systems
=============
        Only very out of date Linux systems are vulnerable.

        Linux Netkit 0.08 has rlogin fixed. All Linux systems using older
        NetKits should upgrade to NetKit 0.09. Some vendors have shipped
        patched Netkit-0.08 releases. Check with your vendor for
        confirmation.

        NetKit 0.09 is available from:

        ftp://ftp.uk.linux.org/pub/linux/Networking/base/NetKit-0.09.tar.gz


NEC Corporation
===============
        UX/4800             Not vulnerable for all versions.
        EWS-UX/V(Rel4.2MP)  Not vulnerable for all versions.
        EWS-UX/V(Rel4.2)    Not vulnerable for all versions.
        UP-UX/V(Rel4.2MP)   Not vulnerable for all versions.


NeXT Software, Inc.
===================
   This problem is fixed in OpenStep/Mach release 4.1 and later.


The Open Group
==============
    This problem was fixed in OSF's OSF/1 R1.3.3 maintenance release.


The Santa Cruz Operation (SCO)
==============================
     SCO is investigating this problem and should a patch be necessary, SCO
     will provide updated information for this advisory. Patches for SCO
     products are listed at ftp://ftp.sco.COM/SLS/README.

- ------------------------------------------------------------------------------

[ End CERT Advisory ]

[ Start Sun Bulletin ]

______________________________________________________________________________
                   Sun Microsystems, Inc. Security Bulletin
               
Bulletin Number:        #00158
Date:                   October 28, 1997
Cross-Ref:              CERT CA-97.06
Title:                  rlogin
______________________________________________________________________________
Permission is granted for the redistribution of this Bulletin, so long as
the Bulletin is not edited and is attributed to Sun Microsystems. Portions
may also be excerpted for re-use in other security advisories so long as
proper attribution is included.

Any other use of this information without the express written consent of
Sun Microsystems is prohibited. Sun Microsystems expressly disclaims all
liability for any misuse of this information by any third party.
______________________________________________________________________________

1.  Bulletins Topics

    Sun announces the release of patches for Solaris 2.5.1, 2.5, 2.4, 2.3,  
    (SunOS 5.5.1, 5.5, 5.4, 5.3), SunOS 4.1.4 and 4.1.3_U1 which relate to a
    vulnerability in rlogin.

    Sun strongly recommends that you install the patches listed in section 4
    immediately on systems running SunOS 5.5.1, 5.5, 5.4, 5.3, 4.1.4, and
    4.1.3_U1.

2.  Who is Affected
       
    Vulnerable:  SunOS versions 5.5.1, 5.5.1_x86, 5.5, 5.5_x86,
                                5.4, 5.4_x86, 5.3, 4.1.4, 4.1.3_U1
               
    The vulnerability is fixed in Solaris 2.6.

3.  Understanding the Vulnerability

    The rlogin program establishes a remote login session. Due to insufficient
    bounds checking on arguments supplied to rlogin, it is possible to
    overwrite the internal data space of the rlogin program. As rlogin is
    setuid root, this vulnerability may be exploited to gain root access.
   
4.  List of Patches

    The vulnerability in rlogin is fixed by the following patches:

    OS version          Patch ID
    __________          ________
    SunOS 5.5.1         104650-02
    SunOS 5.5.1_x86     104651-02
    SunOS 5.5           104669-02
    SunOS 5.5_x86       104670-02
    SunOS 5.4           105254-01      
    SunOS 5.4_x86       105255-01      
    SunOS 5.3           105253-01
    SunOS 4.1.4         105260-01
    SunOS 4.1.3_U1      105259-01

5.  Checksum Table

    The checksum table below shows the BSD checksums (SunOS 4.1.x: /bin/sum;
    SunOS 5.x: /usr/ucb/sum), SVR4 checksums (SunOS 4.1.x: /usr/5bin/sum;
    SunOS 5.x: /usr/bin/sum), and the MD5 digital signatures for the
    above-mentioned patches that are available from:
    
        <URL:ftp://sunsolve1.sun.com/pub/patches/patches.html>
       
    These checksums may not apply if you obtain patches from your answer
    centers.

File Name         BSD        SVR4         MD5
_______________   _________  __________   ________________________________
104650-02.tar.Z   13535 97   28313 194    09633D56EE7957B583EA7B56868C041A
104651-02.tar.Z   63944 97   59194 194    62FC76D27F05D9088734AFB2FBA728B4
104669-02.tar.Z   50300 97   53035 194    603DBCACC7E43DB308F6191BC9FA5D69
104670-02.tar.Z   53991 97   53938 193    2AAB302E10CF860B4009E1CF873B1AE7
105254-01.tar.Z   16467 86   40933 172    6C1C5E4A63C07B69E79CFE31308703F0
105255-01.tar.Z   61095 86   58884 172    CE00AF98291E033BEE5E49C049AD6162
105253-01.tar.Z   12622 86   40936 172    382904D4F14E247D17F9E59F1424480D
105260-01.tar.Z   06896 11   12684 22     191C9F074855631D4CCCD136FA267DEE
105259-01.tar.Z   18628 11   19352 22     CCC5434C6F71AE02C5B456CE4C8BDBBE
  
______________________________________________________________________________
APPENDICES

A.  Patches listed in this bulletin are available to all Sun customers via
    World Wide Web at:
   
        <URL:ftp://sunsolve1.sun.com/pub/patches/patches.html>
       
    Customers with Sun support contracts can also obtain patches from local
    Sun answer centers and SunSITEs worldwide.

B.  Sun security bulletins are available via World Wide Web at:

        <URL:http://sunsolve1.sun.com/sunsolve/secbulletins>
       
C.  Sun Security Coordination Team's PGP key is available via World Wide Web
    at:

        <URL:http://sunsolve1.sun.com/sunsolve/secbulletins/SunSCkey.txt>
                                   
D.  To report or inquire about a security problem with Sun software, contact
    one or more of the following:
 
        - Your local Sun answer centers
        - Your representative computer security response team, such as CERT
        - Sun Security Coordination Team. Send email to:
        
                security-alert@sun.com

E.  To receive information or subscribe to our CWS (Customer Warning System)
    mailing list, send email to:
   
                security-alert@sun.com
  
    with a subject line (not body) containing one of the following commands:

        Command         Information Returned/Action Taken
        _______         _________________________________

        help            An explanation of how to get information
       
        key             Sun Security Coordination Team's PGP key
       
        list            A list of current security topics

        query [topic]   The email is treated as an inquiry and is forwarded to
                        the Security Coordination Team

        report [topic]  The email is treated as a security report and is
                        forwarded to the Security Coordinaton Team. Please
                        encrypt sensitive mail using Sun Security Coordination
                        Team's PGP key

        send topic      A short status summary or bulletin. For example, to
                        retrieve a Security Bulletin #00138, supply the
                        following in the subject line (not body):
                       
                                send #138

        subscribe       Sender is added to our mailing list.  To subscribe,
                        supply the following in the subject line (not body):

                                subscribe cws your-email-address
                       
                        Note that your-email-address should be substituted
                        by your email address.
                       
        unsubscribe     Sender is removed from the CWS mailing list.
______________________________________________________________________________

[ End Sun Bulletin ]

______________________________________________________________________________

CIAC wishes to acknowledge the contributions of CERT, AUSCERT, DFN-CERT and
Sun Microsystems, Inc. for the information contained in this bulletin.
______________________________________________________________________________

CIAC, the Computer Incident Advisory Capability, is the computer
security incident response team for the U.S. Department of Energy
(DOE) and the emergency backup response team for the National
Institutes of Health (NIH). CIAC is located at the Lawrence Livermore
National Laboratory in Livermore, California. CIAC is also a founding
member of FIRST, the Forum of Incident Response and Security Teams, a
global organization established to foster cooperation and coordination
among computer security teams worldwide.

CIAC services are available to DOE, DOE contractors, and the NIH. CIAC
can be contacted at:
    Voice:    +1 510-422-8193
    FAX:      +1 510-423-8002
    STU-III:  +1 510-423-2604
    E-mail:   ciac@llnl.gov

For emergencies and off-hour assistance, DOE, DOE contractor sites,
and the NIH may contact CIAC 24-hours a day. During off hours (5PM -
8AM PST), call the CIAC voice number 510-422-8193 and leave a message,
or call 800-759-7243 (800-SKY-PAGE) to send a Sky Page. CIAC has two
Sky Page PIN numbers, the primary PIN number, 8550070, is for the CIAC
duty person, and the secondary PIN number, 8550074 is for the CIAC
Project Leader.

Previous CIAC notices, anti-virus software, and other information are
available from the CIAC Computer Security Archive.

   World Wide Web:      http://ciac.llnl.gov/
   Anonymous FTP:       ciac.llnl.gov (128.115.19.53)
   Modem access:        +1 (510) 423-4753 (28.8K baud)
                        +1 (510) 423-3331 (28.8K baud)

CIAC has several self-subscribing mailing lists for electronic
publications:
1. CIAC-BULLETIN for Advisories, highest priority - time critical
   information and Bulletins, important computer security information;
2. SPI-ANNOUNCE for official news about Security Profile Inspector
   (SPI) software updates, new features, distribution and
   availability;
3. SPI-NOTES, for discussion of problems and solutions regarding the
   use of SPI products.

Our mailing lists are managed by a public domain software package
called ListProcessor, which ignores E-mail header subject lines. To
subscribe (add yourself) to one of our mailing lists, send the
following request as the E-mail message body, substituting
CIAC-BULLETIN, SPI-ANNOUNCE or SPI-NOTES for list-name and
valid information for LastName FirstName and PhoneNumber when sending

E-mail to       ciac-listproc@llnl.gov or majordomo@tholia.llnl.gov:
        subscribe list-name
  e.g., subscribe ciac-bulletin

You will receive an acknowledgment containing address, initial PIN,
and information on how to change either of them, cancel your
subscription, or get help.

PLEASE NOTE: Many users outside of the DOE, ESnet, and NIH computing
communities receive CIAC bulletins.  If you are not part of these
communities, please contact your agency's response team to report
incidents. Your agency's team will coordinate with CIAC. The Forum of
Incident Response and Security Teams (FIRST) is a world-wide
organization. A list of FIRST member organizations and their
constituencies can be obtained via WWW at http://www.first.org/.

This document was prepared as an account of work sponsored by an
agency of the United States Government. Neither the United States
Government nor the University of California nor any of their
employees, makes any warranty, express or implied, or assumes any
legal liability or responsibility for the accuracy, completeness, or
usefulness of any information, apparatus, product, or process
disclosed, or represents that its use would not infringe privately
owned rights. Reference herein to any specific commercial products,
process, or service by trade name, trademark, manufacturer, or
otherwise, does not necessarily constitute or imply its endorsement,
recommendation or favoring by the United States Government or the
University of California. The views and opinions of authors expressed
herein do not necessarily state or reflect those of the United States
Government or the University of California, and shall not be used for
advertising or product endorsement purposes.

LAST 10 CIAC BULLETINS ISSUED (Previous bulletins available from CIAC)

H-16: HP-UX Security Vulnerabilities (chfn, Remote Watch)
H-06a: Sun libc/libnsl vulnerabilities (Sun Bulletin #00137a)
H-17: cron/crontab Buffer Overrun Vulnerabilities
H-18: Denial-of-Service Attack via ping
H-19: HP Software Installation Programs Vulnerability
H-20: Vulnerability in IRIX csetup
H-21: HP Security Vulnerabilities (newgrp, authentication, passwor
H-22: talkd Buffer Overrun Vulnerability
H-23: Sendmail MIME Conversion Buffer Overrun Vulnerability
H-24: IBM AIX(r)  "gethostbyname()" Buffer Overrun Vulnerability



-----BEGIN PGP SIGNATURE-----
Version: 4.0 Business Edition

iQCVAwUBNFe7J7nzJzdsy3QZAQGK2AP/bV91UsSOCljbOiJ141qbL4Xfw7uSnEMH
4KqltinikxUCON6P7gDoVn1eqh0RxDXBf41R1hlasc/tuyFRe+t2UeI3vJsUFMBJ
ElzpdLyBgKXXg9mSspXI/S6bmq8bPy7xF44tqxT8XClrRK9pk7+MXKXvTuKiqJr5
az+9D/HtC+g=
=v1M2
-----END PGP SIGNATURE-----

TUCoPS is optimized to look best in Firefox® on a widescreen monitor (1440x900 or better).
Site design & layout copyright © 1986-2024 AOH