Original issue date: August 15, 1996<BR>
Last revised: September 24, 1997<BR>
Updated copyright statement

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

<STRONG>This advisory supersedes CA-93.09 and CA-93.09a.</STRONG>

<P>The CERT Coordination Center has received reports of a
vulnerability in expreserve. Though this is not a new vulnerability,
it is one that is widely known and that many users have not yet
patched. The CERT/CC team recommends that you patch your system as
soon as possible, as exploitation scripts are publicly
available. Appendix A contains the information we have received from
vendors. Until you can install a patch, you should apply the
workaround in Section III below.

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

<P><HR>

<H2>I. Description</H2>

<P>Expreserve is a utility that preserves the state of a file being
edited by <I>vi(1)</I> or <I>ex(1)</I> when an edit session terminates
abnormally or when the system crashes. Expreserve has a vulnerability
that allows users to overwrite any file on the system. Exploitation
scripts are publicly

<H2>II. Impact</H2>

<P>By exploiting this vulnerability, users with access to an account
on the system can readily gain root privileges.

<H2>III. Solution</H2>

<H3>A.  Apply a patch or workaround provided by your vendor.</H3>

<P>Below is a summary list of the vendors who have provided
information, which we have placed in Appendix A of this advisory. If
your vendor's name is not on this list, please contact the vendor
directly.

<UL>
            Berkeley Software Design, Inc.<BR>
            Cray Research<BR>
            Data General Corporation<BR>
            Digital Equipment Corporation<BR>
            Hewlett-Packard Company<BR>
            IBM Corporation<BR>
            NeXT Software, Inc.<BR>
            Open Software Foundation<BR>
            The Santa Cruz Operation, Inc.<BR>
Sun Microsystems, Inc.
</UL>
<H3>B.  Until you are able to apply a patch or workaround, we recommend that you remove the execute permissions on the existing /usr/lib/expreserve program.</H3>
  Do this as root:
<UL>
% /usr/bin/chmod  a-x  /usr/lib/expreserve
</UL>
This workaround disables expreserve functionality. The result of this
workaround is that if <I>vi(1)</I> or <I>ex(1)</I> is running, and the
sessions are interrupted, the files being edited will not be preserved and all
edits not explicitly saved by the users will be lost. Encourage users
to save their files often.

<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.

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

BSD/OS is not vulnerable to this problem.  We ship the
current Keith Bostic nvi which does not use the old expreserve
scheme to save files (it uses the 4.4BSD-style 1777 tmp
directories to store user tmp files in /var/tmp owned by
the user and therefore doesn't require a setuid scheme to
recover them).

<H3>Cray Research</H3>

We have fixed this problem at Cray Research in Unicos version 7.0.

<H3>Data General Corporation</H3>

The binary /usr/lib/expreserve is not a setuid program on DG/UX,
any flavor.  We are not, therefore, vulnerable to the exploitation
described.  Nevertheless, the suggested change has been made and
will be included in subsequent releases of DG/UX.

<H3>Digital Equipment Corporation</H3>

This reported problem is not present for Digital's ULTRIX or
Digital UNIX Operating Systems Software.

<P>SOURCE:

<P>Digital Equipment Corporation<BR>
                Software Security Response Team<BR>
Copyright (c) Digital Equipment Corporation 1996.
All rights reserved.

<P>8/13/96 - DIGITAL EQUIPMENT CORPORATION
<H3>Hewlett-Packard Company</H3>
  
<PRE>
   PROBLEM:  **REVISED 01**  Vulnerability in /usr/lib/expreserve in HP-UX
	     9.X and 10.X
   PLATFORM: HP 9000 series 300/400s and 700/800s
   DAMAGE:   The default permissions of file expreserve(1) are in error,
	     thereby allowing users to potentially gain root privileges
	     on the host.
   SOLUTION: Apply patch PHCO_6363 (series 700/800, HP-UX 9.x), or
			 PHCO_7833 (series 300/400, HP-UX 9.x), or
			 PHCO_8652 (series 700/800, HP-UX 10.0X), or
			 PHCO_8653 (series 700/800, HP-UX 10.10), or
			 PHCO_8654 (series 700/800, HP-UX 10.20).

    Perform the actions described below in releases of HP-UX prior
	   to 9.X.)

   AVAILABILITY:  All patches are available now.
   CHANGE SUMMARY:  New patches available for releases of HP-UX 10.XX.

</PRE>

<H3>A. Additional patches for HP-UX have been released to address the  vulnerability originally appearing in the 18 July 1996 version of
the Hewlett-Packard bulletin.</H3>

A private communication to HP described a vulnerability that allows
ordinary users to potentially gain super-user privileges.
The default permission for the file /usr/lib/expreserve (or on HP-UX
10.X /usr/lbin/expreserve) needs only minimal privileges.  If the
patches mentioned above are applied the vulnerability cannot be
exploited.

<P>In case no patches is available for your host HP-UX release, system
administrators are asked to perform the following action to achieve
the same result.

<P>Fixing the problem
<P
The vulnerability can be eliminated from releases 9.X of HP-UX
by applying a patch.  Since some patches will not be made available
on some releases of HP-UX (e.g., prior to 9.X), affected systems can
    be protected by system administrators.<BR>
They should:
<UL>
	       $ su root<BR>
# chmod 0555 /usr/lib/expreserve
</UL>
For HP-UX 10.X systems applying the patches specified above is now in
order.

<P>Hewlett-Packard recommends that all customers concerned with the
security of their HP-UX systems either apply the appropriate
patch or perform the actions described above as soon as possible.

<P>How to Install the Patch

<P>
<H4>1.  Determine which patch is appropriate for your hardware platform and operating system:</H4>
<UL>
		       PHCO_6363 (series 700/800, HP-UX 9.x)<BR>
		       PHCO_7833 (series 300/400, HP-UX 9.x)<BR>
		       PHCO_8652 (series 700/800, HP-UX 10.0X)<BR>
		       PHCO_8653 (series 700/800, HP-UX 10.10)<BR>
PHCO_8654 (series 700/800, HP-UX 10.20)
</UL>

<H4>2.  Hewlett Packard's HP-UX patches are available via email and World Wide Web</H4>
To obtain a copy of the HP SupportLine email service user's
guide, send the following in the TEXT PORTION OF THE MESSAGE
to 
	<A HREF=mailto:support@us.external.hp.com>support@us.external.hp.com</A> 
(no Subject is required):<BR>

send guide

<P>The users guide explains the HP-UX patch downloading process
via email and other services available.

<P>World Wide Web service for downloading of patches<BR>
	  is available via our URL:<BR>
(<A HREF=http://us.external.hp.com>http://us.external.hp.com</A>).


<H4>3.  Apply the patch to your HP-UX system.</H4>

<H4>4.  Examine /tmp/update.log (in 9.X) or /var/adm/sw/swinstall.log (in 10.X), for any relevant WARNINGs or ERRORs.</H4>

Impact:<BR>
These patches for HP-UX releases 9.X and 10.X provide a proper
permissions /usr/lib/expreserve which fixes the vulnerability.  No
patches will be available for versions of HP-UX older than 9.X.
Instead, the workaround is described above.

<P>
<H4>IBM Corporation</H4>

AIX versions 3.2.5, 4.1, and 4.2 are not vulnerable to this
particular problem.

<P>IBM and AIX are registered trademarks of International Business
Machines Corporation.
<H4>NeXT Software, Inc.</H4>
This problem was fixed in or before release 3.3 of NeXTstep.
<H4>Open Software Foundation</H4>

OSF's OSF/1 R1.3 is not effected by this vulnerability.
<H4>The Santa Cruz Operation, Inc.</H4>

SCO Operating Systems are not vulnerable to this problem.
<H4>Silicon Graphics, Inc.</H4>

The Silicon Graphics implementation of expreserv is setgid sys and
not setuid root as reported in the CERT* advisory.   As such this
redefines the exposure to a setgid sys issue.  Exploit would have to
occur on group sys writable files, however, on a default configured
IRIX system there are no system critical files that are group sys
writable and therefore exposure and exploit does not exist.

<P>Silicon Graphics will not be releasing a patch for this issue,
however, the issue will be corrected in future releases of IRIX.

<P>If desired, the setgid permission of the expreserv could be removed
however, this will disable the recovery functions of the <I>vi(1)</I> and
<I>ex(1)</I> editors.   This functionality could be fixed by manually
creating directories for each user in /var/preserve directory.
<H4>Sun Microsystems, Inc.</H4>

<PRE>
System          Patch ID    Filename           MD5 Checksum
 ------          --------    ---------------    -----------
 SunOS 4.1.1     101080-01   101080-01.tar.Z    53c8a5c4eee770924560c5fc100542a3
 SunOS 4.1.2     101080-01   101080-01.tar.Z    53c8a5c4eee770924560c5fc100542a3
 SunOS 4.1.3     101080-01   101080-01.tar.Z    53c8a5c4eee770924560c5fc100542a3
 SunOS 4.1.3C    101080-01   101080-01.tar.Z    53c8a5c4eee770924560c5fc100542a3
 SunOS 4.1.3_U1  101579-01   101579-01.tar.Z    327b89942b02c4cb15bb80bf61b2df94
 SunOS 4.1.4     Not vulnerable

 Solaris 2.0     101119-01   101119-01.tar.Z    No longer available
 Solaris 2.1     101089-01   101089-01.tar.Z    No longer available
 Solaris 2.2     101090-01   101090-01.tar.Z    e9ff98823abbc75d95410a0cb7856644
 Solaris 2.3     Vulnerable; no patch made
 Solaris 2.4     102756-01   102756-01.tar.Z    61f4a48ddba41ae1c27e70b84f4c8d87
 Solaris 2.4_x86 102757-01   102757-01.tar.Z    1f2b7f3824565ef849eb3c4677567399
 Solaris 2.5     Not vulnerable
 Solaris 2.5.1   Not vulnerable

</PRE>

<P><HR>

<P>The CERT Coordination Center thanks all the vendors who provided input
for this advisory.

<P><HR>

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

<HR>

Revision History
<PRE>
Sep. 24, 1997  Updated copyright statement
Dec. 20, 1996  Appendix A, HP - revised information from vendor has been
	       included.
Aug. 30, 1996  Information previously in the README was inserted into the
               advisory.
Aug. 28, 1996  Appendix A, SGI - added an entry for this vendor.
Aug. 21, 1996  Appendix A, Sun - added more patch information.
</PRE>