AUSCERT External Security Bulletin Redistribution

            ESB-2001.371 -- FreeBSD-SA-01:57.sendmail [REVISED]
                sendmail contains local root vulnerability
                              31 August 2001


        AusCERT Security Bulletin Summary

Product:                sendmail
Operating System:       FreeBSD
Impact:                 Root Compromise
Access Required:        Local

Ref:                    ESB-2001.365

- --------------------------BEGIN INCLUDED TEXT--------------------


FreeBSD-SA-01:57                                           Security Advisory
                                                                FreeBSD, Inc.

Topic:          sendmail contains local root vulnerability [REVISED]

Category:       core
Module:         sendmail
Announced:      2001-08-27
Revised:        2001-08-30
Credits:        Cade Cairnss <cairnsc@securityfocus.com>
Affects:        FreeBSD 4-STABLE after August 27, 2000 and prior to
                the correction date, FreeBSD 4.1.1-RELEASE,
                4.2-RELEASE, 4.3-RELEASE
Corrected:      2001-08-21 01:36:37 UTC (FreeBSD 4.3-STABLE)
                2001-08-22 05:34:11 UTC (RELENG_4_3)
FreeBSD only:   NO

0.   Revision History

v1.0  2001-08-27  Initial release
v1.1  2001-08-30  Update package to remove setuid bit from saved file;
                  add non-openssl package; correct typo in package
                  instructions; note that $Id$ not updated in

I.   Background

sendmail is a mail transfer agent.

II.  Problem Description

Sendmail contains an input validation error which may lead to the
execution of arbitrary code with elevated privileges by local users.
Due to the improper use of signed integers in code responsible for the
processing of debugging arguments, a local user may be able to supply
the signed integer equivalent of a negative value supplied to
sendmail's "trace vector".  This may allow a local user to write data
anywhere within a certain range of locations in process memory.
Because the '-d' command-line switch is processed before the program
drops its elevated privileges, the attacker may be able to cause
arbitrary code to be executed with root privileges. 

III. Impact

Local users may be able to execute arbitrary code with root privileges.

IV.  Workaround

Do not allow untrusted users to execute the sendmail binary.

V.   Solution

One of the following:

1) Upgrade your vulnerable FreeBSD system to 4.3-STABLE or the
RELENG_4_3 security branch after the respective correction dates.

2) FreeBSD 4.x systems after August 27, 2000 and prior to the
correction date:

The following patch has been verified to apply to FreeBSD
4.1.1-RELEASE, 4.2-RELEASE, 4.3-RELEASE and 4-STABLE dated prior to
the correction date.

Download the patch and the detached PGP signature from the following
locations, and verify the signature using your PGP utility.

# fetch ftp://ftp.freebsd.org/pub/FreeBSD/CERT/patches/SA-01:57/sendmail.patch
# fetch ftp://ftp.freebsd.org/pub/FreeBSD/CERT/patches/SA-01:57/sendmail.patch.asc

Execute the following commands as root:

# cd /usr/src
# patch -p < /path/to/patch
# cd /usr/src/lib/libsmutil
# make depend && make all
# cd /usr/src/usr.sbin/sendmail
# make depend && make all install

3) FreeBSD 4.3-RELEASE systems:

** NOTE: The initial version of the upgrade package did not remove
** setuid root privileges from the saved copy of the sendmail binary.
** To correct this, deinstall the old package using the pkg_delete(1)
** command and install the corrected package as described below.

An experimental upgrade package is available for users who wish to
provide testing and feedback on the binary upgrade process.  This
package may be installed on FreeBSD 4.3-RELEASE systems only, and is
intended for use on systems for which source patching is not practical
or convenient.

If you use the upgrade package, feedback (positive or negative) to
security-officer@FreeBSD.org is requested so we can improve the
process for future advisories.

During the installation procedure, backup copies are made of the
files which are replaced by the package.  These backup copies will
be reinstalled if the package is removed, reverting the system to a
pre-patched state.

Two versions of the package are available, depending on whether or not
OpenSSL is installed.  If the file /usr/lib/libcrypto.so exists on the
local system, follow the directions in section 1a) below, otherwise
follow the directions in section 1b).  After adding the package,
proceed with the instructions in section 2).

1a) If crypto is installed:

# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/packages/SA-01:57/security-patch-sendmail-crypto-01.57.tgz
# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/packages/SA-01:57/security-patch-sendmail-crypto-01.57.tgz.asc

Verify the detached PGP signature using your PGP utility.

# pkg_add security-patch-sendmail-crypto-01.57.tgz

1b) If crypto is not installed:

# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/packages/SA-01:57/security-patch-sendmail-nocrypto-01.57.tgz
# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/packages/SA-01:57/security-patch-sendmail-nocrypto-01.57.tgz.asc

Verify the detached PGP signature using your PGP utility.

# pkg_add security-patch-sendmail-nocrypto-01.57.tgz

2) Restart sendmail after applying the patch by executing the following
commands as root:

# killall sendmail
# /usr/sbin/sendmail -bd -q30m

The flags to sendmail may need to be adjusted as required for the
local system configuration.

VI.   Correction details

The following is the sendmail $Id$ revision number of the file that
was corrected for the supported branches of FreeBSD.  The $Id$
revision number of the installed source can be examined using the
ident(1) command.  Note that the $Id$ tag was not updated on the
RELENG_4_3 branch because a newer vendor release of sendmail was not
imported, instead only this vulnerability was patched.

  Revision   Path  src/contrib/sendmail/src/trace.c

VII.  References


Version: GnuPG v1.0.6 (FreeBSD)
Comment: For info see http://www.gnupg.org


- --------------------------END INCLUDED TEXT--------------------

You have received this e-mail bulletin as a result of your organisation's
registration with AusCERT. The mailing list you are subscribed to is
maintained within your organisation, so if you do not wish to continue
receiving these bulletins you should contact your local IT manager. If
you do not know who that is, please send an email to auscert@auscert.org.au
and we will forward your request to the appropriate person.

This security bulletin is provided as a service to AusCERT's members.  As
AusCERT did not write the document quoted above, AusCERT has had no control
over its content.  The decision to use any or all of this information is
the responsibility of each user or organisation, and should be done so in
accordance with site policies and procedures.

NOTE: This is only the original release of the security bulletin.  It may
not be updated when updates to the original are made.  If downloading at
a later date, it is recommended that the bulletin is retrieved directly
from the original authors to ensure that the information is still current.

Contact information for the authors of the original document is included
in the Security Bulletin above.  If you have any questions or need further
information, please contact them directly.

Previous advisories and external security bulletins can be retrieved from:


If you believe that your system has been compromised, contact AusCERT or
your representative in FIRST (Forum of Incident Response and Security

Internet Email: auscert@auscert.org.au
Facsimile:	(07) 3365 7031
Telephone:	(07) 3365 4417 (International: +61 7 3365 4417)
		AusCERT personnel answer during Queensland business hours
		which are GMT+10:00 (AEST).
		On call after hours for emergencies.

Version: 2.6.3i
Charset: noconv
Comment: ftp://ftp.auscert.org.au/pub/auscert/AUSCERT_PGP.key