CERT-SEI

Buffer Overflow in Sendmail

Original release date: March 29, 2003
Last revised: May 29, 2003
Source: CERT/CC

A complete revision history can be found at the end of this file.


Systems Affected

  • Sendmail Pro (all versions)
  • Sendmail Switch 2.1 prior to 2.1.6
  • Sendmail Switch 2.2 prior to 2.2.6
  • Sendmail Switch 3.0 prior to 3.0.4
  • Sendmail for NT 2.X prior to 2.6.3
  • Sendmail for NT 3.0 prior to 3.0.4
  • Systems running open-source sendmail versions prior to 8.12.9, including UNIX and Linux systems

Overview

There is a vulnerability in sendmail that can be exploited to cause a denial-of-service condition and could allow a remote attacker to execute arbitrary code with the privileges of the sendmail daemon, typically root.


I. Description

There is a remotely exploitable vulnerability in sendmail that could allow an attacker to gain control of a vulnerable sendmail server. Due to a variable type conversion problem (char to signed int), sendmail may not adequately check the length of address tokens.  A specially crafted email message could trigger a stack overflow. This vulnerability was discovered by Michal Zalewski.

This vulnerability is different than the one described in CA-2003-07.

Most organizations have a variety of mail transfer agents (MTAs) at various locations within their network, with at least one exposed to the Internet. Since sendmail is the most popular MTA, most medium-sized to large organizations are likely to have at least one vulnerable sendmail server. In addition, many UNIX and Linux workstations provide a sendmail implementation that is enabled and running by default.

This vulnerability is message-oriented as opposed to connection-oriented. That means that the vulnerability is triggered by the contents of a specially-crafted email message rather than by lower-level network traffic. This is important because an MTA that does not contain the vulnerability will pass the malicious message along to other MTAs that may be protected at the network level. In other words, vulnerable sendmail servers on the interior of a network are still at risk, even if the site's border MTA uses software other than sendmail. Also, messages capable of exploiting this vulnerability may pass undetected through many common packet filters or firewalls.

This vulnerability has been successfully exploited to cause a denial-of-service condition in a laboratory environment. It is possible that this vulnerability could be used to execute arbitrary code on some vulnerable systems.

The CERT/CC is tracking this issue as VU#897604. This reference number corresponds to CVE candidate CAN-2003-0161.

For more information, please see

http://www.sendmail.org
http://www.sendmail.org/8.12.9.html
http://www.sendmail.com/security/

For the latest information about this vulnerability, including the most recent vendor information, please see

http://www.kb.cert.org/vuls/id/897604
This vulnerability is distinct from VU#398025.

II. Impact

Successful exploitation of this vulnerability may cause a denial-of-service condition or allow an attacker to gain the privileges of the sendmail daemon, typically root. Even vulnerable sendmail servers on the interior of a given network may be at risk since the vulnerability is triggered by the contents of a malicious email message.

III. Solution

Apply a patch from Sendmail Inc.

Sendmail has produced patches for versions 8.9, 8.10, 8.11, and 8.12. However, the vulnerability also exists in earlier versions of the code; therefore, site administrators using an earlier version are encouraged to upgrade to 8.12.9. These patches, and a signature file, are located at

ftp://ftp.sendmail.org/pub/sendmail/prescan.tar.gz.uu
ftp://ftp.sendmail.org/pub/sendmail/prescan.tar.gz.uu.asc

Apply a patch from your vendor

Many vendors include vulnerable sendmail servers as part of their software distributions. We have notified vendors of this vulnerability and recorded the statements they provided in Appendix A of this advisory. The most recent vendor information can be found in the systems affected section of VU#897604. 

Enable the RunAsUser option

There is no known workaround for this vulnerability. Until a patch can be applied, you may wish to set the RunAsUser option to reduce the impact of this vulnerability. As a good general practice, the CERT/CC recommends limiting the privileges of an application or service whenever possible.

Appendix A. - Vendor Information

This appendix contains information provided by vendors for this advisory. As vendors report new information to the CERT/CC, we will update this section and note the changes in our revision history. If a particular vendor is not listed below, we have not received their comments.

Apple Computer Inc.

Apple has released Mac OS X 10.2.5 which includes the patch from the sendmail team for this vulnerability.

Conectiva

Conectiva Linux 6.0, 7.0 and 8 contain sendmail and are vulnerable to this issue, even though sendmail is no longer the default MTA in our distribution.  Updated packages will be announced to our mailing lists when ready.

Cray

Cray Inc. may be vulnerable and has opened sprs 725085 and 725086 to investigate.

Hewlett-Packard

SOURCE: Hewlett-Packard Company HP Services Software Security Response Team

x-ref: SSRT3531 [HPSBUX0304-253, HPSBMP0304-018]

At the time of writing this document, Hewlett Packard is currently investigating the potential impact to HP's released Operating System software products.

As further information becomes available HP will provide notice of the availability of any necessary patches through standard security bulletin announcements and be available from your normal HP Services support channel.

Hitachi

HI-UX/WE2's sendmail is NOT Vulnerable to this issue.

IBM

The AIX operating system is vulnerable to sendmail buffer overflow attack mentioned in CERT Advisory CA-2003-12 and CERT Vulnerability Note VU# 897604.

An efix is available from:

ftp://ftp.software.ibm.com/aix/efixes/security/sendmail_2_efix.tar.Z

The APAR numbers and availability dated for this issue are as follows:
APAR number for AIX 4.3.3: IY42629 (available approx. 05/07/2003)
APAR number for AIX 5.1.0: IY42630 (available approx. 04/28/2003)
APAR number for AIX 5.2.0: IY42631 (available approx. 04/28/2003)
The APARs can be downloaded using the URL below and then following the links for your AIX release level.

http://techsupport.services.ibm.com/server/fixes?view=pSeries

For more information please contact your AIX Support Center.

Lotus

Lotus products are not vulnerable to this problem.

Mirapoint

Mirapoint has corrected this problem.  Details of the update (D3_SMTP_CERT_2003_12) can be found on the Mirapoint secure support center.

Nortel Networks

The following Nortel Networks Wireless products are potentially affected by the vulnerabilities identified in CERT Advisory CA-2003-12:
  • SS7 IP Gateway.
    Nortel Networks recommends disabling Sendmail as it is not used.
  • Wireless Preside OAM&P Main Server.
    Sendmail should not be disabled on these products.
The following Nortel Networks Enterprise Voice IVR products are potentially affected by the vulnerabilities identified in CERT Advisory CA-2003-12:
  • MPS1000
  • MPS500
  • VPS
  • CTX
All the above products deploy Sendmail; it should not be disabled on these products.

For all of the above products Nortel Networks recommends applying the latest Sun Microsystems patches in accordance with that vendor's recommendations.  To avoid applying patches twice, please ensure that the Sun Microsystems patch applied also addresses the vulnerability identified in CERT Advisory CA-2003-07.

The following Nortel Networks Succession products are potentially affected by the vulnerability identified in CERT Advisory CA-2003-12:

  • SSPFS-based CS2000 Management Tools
  • GWC Element Manager and QoS Collector Application (QCA)
  • SAM21 Element Manager
  • Audio Provisioning Server (APS) and APS client GUI
  • UAS Element Manager
  • Succession Media Gateway 9000 Element Manager (Mid-Tier and Server)
  • Network Patch Manager (NPM)
  • Nodes Configuration, Trunk Configuration, Carrier Endpoint Configuration, Lines Configuration (Servord+), Trunk Maintenance Manager, Lines Maintenance Manager, Line Test Manager, V5.2 Configuration and Maintenance, PM Poller, EMS Proxy Services, and Common Application Launch Point
A product bulletin will be issued shortly.

Sendmail has been disabled in SN06 and therefore SN06 is not vulnerable.  A patch for SN05 is currently under development that will disable Sendmail in SN05 so that it will not be affected by the vulnerability identified in CERT Advisory CA-2003-12.  The availability date for the SN05 patch is still to be determined.

For more information please contact Nortel at:

North America: 1-800-4NORTEL or 1-800-466-7835
Europe, Middle East and Africa: 00800 8008 9009, or +44 (0) 870 907 9009
Contacts for other regions are available at
<http://www.nortelnetworks.com/help/contact/global/>

Red Hat Inc.

Red Hat distributes sendmail in all Red Hat Linux distributions.  Updated sendmail packages that contain patches to correct this vulnerability are available along with our advisory at the URLs below.  Users of the Red Hat Network can update their systems using the 'up2date' tool.

Red Hat Linux:

        http://rhn.redhat.com/errata/RHSA-2003-120.html

Red Hat Enterprise Linux:

http://rhn.redhat.com/errata/RHSA-2003-121.html

The Sendmail Consortium

The Sendmail Consortium recommends that sites upgrade to 8.12.9 whenever possible.  Alternatively, patches are available for 8.9, 8.10, 8.11, and 8.12 on http://www.sendmail.org/.

Sendmail Inc.

All commercial releases including Sendmail Switch, Sendmail Advanced Message Server (which includes the Sendmail Switch MTA), Sendmail for NT, and Sendmail Pro are affected by this issue.  Patch information is available at http://www.sendmail.com/security/.

Sequent (IBM)

For information please contact IBM Service at 1-800-IBM-SERV.

SGI

SGI acknowledges receiving CERT VU#897604 and is currently investigating. This is being tracked as SGI Bug# 886104. No further information is available at this time.

For the protection of all our customers, SGI does not disclose, discuss or confirm vulnerabilities until a full investigation has occurred and any necessary patch(es) or release streams are available for all vulnerable and supported SGI operating systems.  Until SGI has more definitive information to provide, customers are encouraged to assume all security vulnerabilities as exploitable and take appropriate steps according to local site security policies and requirements.  As further information becomes available, additional advisories will be issued via the normal SGI security information distribution methods including the wiretap mailing list on http://www.sgi.com/support/security/
[20030401-01-P]

Sun Microsystems Inc.

Solaris 2.6, 7, 8 and 9 are vulnerable to VU#897604.

Sun will be publishing a Sun Alert for the issue at the following location shortly:

http://sunsolve.Sun.COM/pub-cgi/retrieve.pl?doc=fsalert/52620

The Sun Alert will be updated with the patch information as soon as the patches are available.

At that time, the patches listed in the Sun Alert will be available from:

http://sunsolve.sun.com/securitypatch

Wind River Systems Inc.

This vulnerability is addressed by the M500-008 patch for Platform for Server Appliances 1.0 or BSD/OS 5.0 based systems.  The M31--005 patch addresses this problem for BSD/OS 4.3.1 or 4.3 systems, and the M420-034 addresses this problem for BSD/OS 4.2 based systems.


Our thanks to Eric Allman, Claus Assmann, Greg Shapiro, and Dave Anderson of Sendmail for reporting this problem and for their assistance in coordinating the response to this problem. We also thank Michal Zalewski for discovering this vulnerability.


Authors: Art Manion, Shawn V. Hernan, and Jeffery P. Lanza.

Copyright 2003 Carnegie Mellon University.

Revision History

March 29, 2003:  Initial release
March 29, 2003:  Added Conectiva statement, reformated vendor statements
March 30, 2003:  Added Wind River Systems and HP vendor statements
March 31, 2003:  Added Sun, IBM, SGI, and Cray vendor statements
April 1, 2003:  Added Apple and Lotus vendor statements, updated Red Hat and IBM statements
April 7, 2003:  Updated SGI and HP statements
April 8, 2003:  Added Nortel statement
April 11, 2003:  Updated Apple statement
April 15, 2003:  Updated HP statement
April 22, 2003:  Added Mirapoint statement
April 29, 2003:  Added Sequent (IBM) statement
May 20, 2003:  Added Hitachi statement
May 29, 2003:  Updated description