TUCoPS :: HP/UX :: ciach016.txt

HP-UX Chfn Watch Vulnerabilities


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

                             INFORMATION BULLETIN

              HP-UX Security Vulnerabilities (chfn, Remote Watch)

December 13, 1996 15:00 GMT                                        Number H-16
PROBLEM:       Two problems have been identified in the HP-UX operating
               system: 1) chfn buffer overrun, and 2) HP Remote Watch.
PLATFORM:      1) All platforms running HP-UX 9.x and 10.x, 2) HP 9000 series
               300/400/700/800s running HP-UX 9.x.
DAMAGE:        1) chfn vulnerability may allow local users to gain root
               privileges. 2) HP Remote Watch vulnerabilities may allow users
               unauthorized root access.
SOLUTION:      Apply the workarounds or solutions provided below.
VULNERABILITY  Exploit information involving these vulnerabilities have been
ASSESSMENT:    made publicly available.

[ Start AUSCERT Advisory ]

1. chfn Buffer Overrun Vulnerability

AA-96.18                        AUSCERT Advisory
                      HP-UX chfn Buffer Overrun Vulnerability
                                9 December 1996

Last Revised: --

AUSCERT has received information that a vulnerability exists in the
chfn(1) program under HP-UX 9.x and 10.x.

This vulnerability may allow local users to gain root privileges.

Exploit information involving this vulnerability has been made publicly

Currently there are no vendor patches available that address this
vulnerability.  AUSCERT recommends that sites take the steps outlined in
section 3 as soon as possible.

This advisory will be updated as more information becomes available.

1.  Description

    AUSCERT has received information that a vulnerability exists in the
    HP-UX chfn(1) program.  The chfn command is used to change user
    information in the password file, and is installed by default.

    Due to insufficient bounds checking on arguments which are supplied
    by users, it is possible to overwrite the internal stack space of the
    chfn program while it is executing.  By supplying a carefully
    designed argument to the chfn program, intruders may be able to
    force chfn to execute arbitrary commands.  As chfn is setuid
    root, this may allow intruders to run arbitrary commands with root

    This vulnerability is known to affect both HP-UX 9.x and 10.x.

    By default, chfn is located in /usr/bin under both HP-UX 9.x and 10.x.

    Exploit information involving this vulnerability has been made
    publicly available.

2.  Impact

    Local users may gain root privileges.

3.  Workarounds/Solution

    AUSCERT recommends that sites limit the possible exploitation of this
    vulnerability by immediately removing the setuid permissions as stated
    in Section 3.1.  If the chfn command is required, AUSCERT recommends
    the chfn wrapper program given in Section 3.2 be installed.

    Currently there are no vendor patches available that address this
    vulnerability.  AUSCERT recommends that official vendor patches be
    installed when they are made available.

3.1 Remove setuid and non-root execute permissions

    To prevent the exploitation of the vulnerability described in the
    advisory, AUSCERT recommends that the setuid permissions be removed
    from the chfn program immediately.  As the chfn program will no
    longer work for non-root users, it is recommended that the execute
    permissions also be removed.  Before doing so, the original permissions
    for chfn should be noted as they will be needed if sites choose to
    install the chfn wrapper program (Section 3.2).

    For example:

        # ls -l /usr/bin/chfn
        -r-sr-xr-x   1 root     bin        20480 Jun 10  1996 /usr/bin/chfn

        # chmod 500 /usr/bin/chfn
        # ls -l /usr/bin/chfn
        -r-x------   1 root     bin        20480 Jun 10  1996 /usr/bin/chfn

    Note that this will remove the ability for any non-root user to run the
    chfn program.

3.2 Install chfn wrapper

    AUSCERT has developed a wrapper program to help prevent programs from
    being exploited using the vulnerability described in this advisory.
    This wrapper, including installation instructions, can be found at:


    This replaces the chfn program with a wrapper which checks the
    length of the command line arguments passed to it.  If an argument
    exceeds a certain predefined value (MAXARGLEN), the wrapper exits
    without executing the chfn command.  The wrapper program can also
    be configured to syslog any failed attempts to execute chfn with
    arguments exceeding MAXARGLEN.  For further instructions on using
    this wrapper, please read the comments at the top of overflow_wrapper.c.

    When compiling overflow_wrapper.c for use with HP-UX chfn, AUSCERT
    recommends defining MAXARGLEN to be 16.

    The MD5 checksum for Version 1.0 of overflow_wrapper.c is:

        MD5 (overflow_wrapper.c) = f7f83af7f3f0ec1188ed26cf9280f6db

    AUSCERT recommends that until vendor patches can be installed, sites
    requiring the chfn functionality apply this workaround.

4.  Additional measures

    Most Unix systems ship numerous programs which have setuid or
    setgid privileges.  Often the functionality supplied by these
    privileged programs is not required by many sites.  The large number
    of privileged programs that are shipped by default are to cater for
    all possible uses of the system.

    AUSCERT encourages sites to examine all the setuid/setgid programs
    and determine the necessity of each program.  If a program does not
    absolutely require the setuid/setgid privileges to operate (for
    example, it is only run by the root user),  the setuid/setgid
    privileges should be removed.  Furthermore, if a program is not
    required at your site, then all execute permissions should be removed.

    A sample command to find all setuid/setgid programs is (run as root):

       # find / \( -perm -4000 -o -perm -2000 \) -exec ls -ld {} \;

    It is AUSCERT's experience that many vulnerabilities are being
    discovered in setuid/setgid programs which are not necessary for the
    correct operation of most systems.  Sites can increase their security
    by removing unnecessary setuid/setgid programs.

    For example, the functionality provided by the chfn program is not
    needed by many sites since the user information stored in the password
    file, which chfn is used to change, is typically static.  If sites
    had previously disabled the chfn program, they would not have been
    vulnerable to this latest exploit.

AUSCERT thanks Hewlett-Packard for their continued assistance and technical
expertise essential for the production of this advisory.

[ End AUSCERT Advisory ]


[ Start CERT Advisory ]

2. HP Remote Watch Vulnerabilities

CERT(sm) Vendor-Initiated Bulletin VB-96.20
December 12, 1996

Topic: Security Vulnerabilities in HP Remote Watch
Source: Hewlett-Packard Company

To aid in the wide distribution of essential security information, the CERT
Coordination Center is forwarding the following information from
Hewlett-Packard Company. Hewlett-Packard urges you to act on this information
as soon as possible. Their contact information is included in the forwarded
text below; please contact them if you have any questions or need further

=======================FORWARDED TEXT STARTS HERE============================

Document Id: [HPSBUX9610-039]
Date Loaded: [10-24-96]

Description: Security Vulnerabilities in HP Remote Watch

      HEWLETT-PACKARD SECURITY ADVISORY: #000039, 24 October 1996

Hewlett-Packard recommends that the information in the following
Security Advisory should be acted upon as soon as possible. Hewlett-
Packard will not be liable for any consequences to any customer
resulting from customer's failure to fully implement instructions in this
Security Advisory as soon as possible.

Permission is granted for copying and circulating this advisory to
Hewlett-Packard (HP) customers (or the Internet community) for the
purpose of alerting them to problems, if and only if, the advisory is
not edited or changed in any way, is attributed to HP, and provided such
reproduction and/or distribution is performed for non-commercial

Any other use of this information is prohibited. HP is not liable
for any misuse of this information by any third party.

PROBLEM:  Vulnerability in HP Remote Watch in 9.X releases of HP-UX
PLATFORM: HP 9000 series 300/400/700/800s
DAMAGE:   Vulnerabilities in HP Remote Watch exists allowing users to
          gain additional privileges.
SOLUTION: Do not use Remote Watch.

I. Remote Watch Update

   A. Problem description

   A recent mailing list disclosure described two vulnerabilities in
   which HP Remote Watch allows unauthorized root access. The first was
   via a socket connection on port 5556.  The second was as a result of
   using the showdisk utility, which is part of the Remote Watch product.
   It has been found that HP9000 Series 300, 400, 700, and 800 systems
   running only HP-UX Release 9.X have this vulnerability.

   B. Fixing the problem

   This vulnerability can only be eliminated from releases 9.X of HP-UX
   which are using Remote Watch by disabling the entire product.  The
   default location for this product is /usr/remwatch/   .
   Removal can be accomplished (as root) with the following:

   NOTE: Do not run the standard rmfn command as HP has discovered
   problems with its inability to handle programs with active executables.

   Instead, run (with no options):


   This runs a Remote Watch script called "unconfigure" to stop actively
   running programs, then proceeds to remove all files including the

   The administrator should also perform both of the following steps:

     1.  Remove or comment out the following entry in /etc/inetd.conf

    rwdaemon stream tcp nowait root /usr/remwatch/bin/rwdaemon rwdaemon

     2.  Have inetd re-read its configuration file by executing at the

    inetd -c

   This is the official recommendation from Hewlett-Packard Company.

   C. Current product status

   Remote Watch was last released from the labs in August of 1993.
   In December 1994 customers were informed of pending product
   obsolescence.   Hewlett-Packard recommends that all customers
   concerned with the security of their HP-UX systems with Remote
   Watch configured on it perform the actions described herein as
   soon as possible.  Again, no patches will be available for any
   versions of HP-UX.

   Since the functionality of HP Remote Watch software has now been
   replicated in other tools that handle system management more
   effectively there is no longer a sufficient need for HP Remote
   Watch.  Most of the functionality is now provided by the Systems
   Administration Manager (SAM) tool, available at no charge as part
   of the HP-UX operating system, or by the HP OpenView
   OperationsCenter application.

   If further assistance is desired please contact your HP Support

   D. HP SupportLine

   To subscribe to automatically receive future NEW HP Security
   Bulletins from the HP SupportLine mail service via electronic mail,
   send an email message to:

          support@us.external.hp.com   (no Subject is required)

   Multiple instructions are allowed in the TEXT PORTION OF THE MESSAGE,
   here are some basic instructions you may want to use:

   To add your name to the subscription list for new security bulletins,
   send the following in the TEXT PORTION OF THE MESSAGE:

          subscribe security_info

   To retrieve the index of all HP Security Bulletins issued to date,
   send the following in the TEXT PORTION OF THE MESSAGE:

          send security_info_list

   To get a patch matrix of current HP-UX and BLS security patches
   referenced by either Security Bulletin or Platform/OS, put the
   following in the text portion of your message:

          send hp-ux_patch_matrix

   World Wide Web service for browsing of bulletins is available via
   our URL:

          Choose "Support news", then under Support news,
          choose "Security Bulletins"

   E. To report new security vulnerabilities, send email to


   Please encrypt exploit information using the security-alert PGP
   key, available from your local key server, or by sending a
   message with a -subject- (not body) of 'get key' (no quotes) to

========================FORWARDED TEXT ENDS HERE=============================

[ End CERT Advisory ]


CIAC wishes to acknowledge the contributions of AUSCERT, CERT, and HP 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 (
   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
1. CIAC-BULLETIN for Advisories, highest priority - time critical
   information and Bulletins, important computer security information;
2. CIAC-NOTES for Notes, a collection of computer security articles;
3. SPI-ANNOUNCE for official news about Security Profile Inspector
   (SPI) software updates, new features, distribution and
4. 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
valid information for LastName FirstName and PhoneNumber when sending

E-mail to       ciac-listproc@llnl.gov:
        subscribe list-name LastName, FirstName PhoneNumber
  e.g., subscribe ciac-notes OHara, Scarlett W. 404-555-1212 x36

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-05: Internet Hoaxes
H-07: Sendmail SIGHUP-smtpd Vulnerability
H-08: lpr Buffer Overrun Vulnerability
H-09: HP 9000 Access Vulnerability
H-10: HP-UX Security Vulnerabilities (passwd, fpkg2swpkg, newgrp)
H-11: sendmail Group Permissions Vulnerability
H-12: IBM AIX(r) 'SYN Flood' and 'Ping o' Death' Vulnerabilities
H-13: IBM AIX(r) Security Vulnerabilities (gethostbyname, lquerypv)
H-14: SGI IRIX Vulnerabilities (systour, OutOfBox, cdplayer, datman)
H-15: Korn Shell (ksh) suid_exec Vulnerability

RECENT CIAC NOTES ISSUED (Previous Notes available from CIAC)

Notes 07 - 3/29/95     A comprehensive review of SATAN

Notes 08 - 4/4/95      A Courtney update

Notes 09 - 4/24/95     More on the "Good Times" virus urban legend

Notes 10 - 6/16/95     PKZ300B Trojan, Logdaemon/FreeBSD, vulnerability
                       in S/Key, EBOLA Virus Hoax, and Caibua Virus

Notes 11 - 7/31/95     Virus Update, Hats Off to Administrators,
                       America On-Line Virus Scare, SPI 3.2.2 Released,
                       The Die_Hard Virus

Notes 12 - 9/12/95     Securely configuring Public Telnet Services, X
                       Windows, beta release of Merlin, Microsoft Word
                       Macro Viruses, Allegations of Inappropriate Data
                       Collection in Win95

Notes 96-01 - 3/18/96  Java and JavaScript Vulnerabilities, FIRST
                       Conference Announcement, Security and Web Search
                       Engines, Microsoft Word Macro Virus Update

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