HP-UX Security Vulnerabilities (chfn, Remote Watch) Privacy and Legal Notice

CIAC INFORMATION BULLETIN

H-16: HP-UX Security Vulnerabilities (chfn, Remote Watch)

December 13, 1996 15:00 GMT
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 available. 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 privileges. 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: ftp://ftp.auscert.org.au/pub/auscert/tools/overflow_wrapper.c 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 information. =======================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 purposes. 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): /usr/remwatch/bin/removeall This runs a Remote Watch script called "unconfigure" to stop actively running programs, then proceeds to remove all files including the filesets. The administrator should also perform both of the following steps: 1. Remove or comment out the following entry in /etc/inetd.conf file: rwdaemon stream tcp nowait root /usr/remwatch/bin/rwdaemon rwdaemon 2. Have inetd re-read its configuration file by executing at the prompt: 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 Representative. 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: http://us.external.hp.com Choose "Support news", then under Support news, choose "Security Bulletins" E. To report new security vulnerabilities, send email to security-alert@hp.com 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 security-alert@hp.com. _______________________________________________________________________ ========================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.

DOE-CIRC can be contacted at:
    Voice:          +1 866-941-2472 (7 x 24)
    E-mail:          doecirc@doecirc.energy.gov
    World Wide Web:  http://www.doecirc.energy.gov/