CERT home
vulnerabilities & fixesevaluations & practicesresearch & analysistraining & education
homesearchFAQsite indexcontact
Vulnerability
Notes
Database

Search Vulnerability Notes

Vulnerability Notes Help Information
 

 View Notes By
Name

ID Number

CVE Name

Date Public

Date Published

Date Updated

Severity Metric

Vulnerability Note VU#897604

Sendmail address parsing buffer overflow

Overview

Sendmail contains a buffer overflow in code that parses email addresses. A remote attacker could execute arbitrary code or cause a denial of service on a vulnerable system.

I. Description

Sendmail is a widely used mail transfer agent (MTA). There is a stack overflow vulnerability in code that parses email addresses. A remote attacker could exploit this vulnerability with a message containing a specially crafted email address.

When processing email messages, sendmail creates tokens from address elements (user, host, domain). The code that performs this function (prescan() in parseaddr.c) contains logic to check that the tokens are not malformed or overly long. In certain cases, a variable in prescan() is set to the special control value -1, which may alter the program logic to skip the length checks. On little-endian platforms that treat the char type as signed int, the char value 0xFF sets the high-order bit, which in terms of a signed int indicates a negative value. When prescan() treats a char with the value 0xFF as an int, the value is interpreted as -1, which can cause the length checks to be skipped. Using an email message with a specially crafted address containing 0xFF, an attacker could cause the length checks to be skipped and overwrite the saved instruction pointer on the stack.

Further information is available in a message posted by Michal Zalewski.

In sendmail 8.9.12 and 8.11.7 (and possibly other versions), additional modifications have been made to protect other vulnerable sendmail MTAs. From the release notes for sendmail 8.9.12:

8.12.9/8.12.9   2003/03/29
        SECURITY: Fix a buffer overflow in address parsing due to
                a char to int conversion problem which is potentially
                remotely exploitable.  Problem found by Michal Zalewski.
                Note: an MTA that is not patched might be vulnerable to
                data that it receives from untrusted sources, which
                includes DNS.
        To provide partial protection to internal, unpatched sendmail MTAs,
                8.12.9 changes by default (char)0xff to (char)0x7f in
                headers etc.  To turn off this conversion compile with
                -DALLOW_255 or use the command line option -d82.101.
        To provide partial protection for internal, unpatched MTAs that may be
                performing 7->8 or 8->7 bit MIME conversions, the default
                for MaxMimeHeaderLength has been changed to 2048/1024.
                Note: this does have a performance impact, and it only
                protects against frontal attacks from the outside.
                To disable the checks and return to pre-8.12.9 defaults,
                set MaxMimeHeaderLength to 0/0.

Note that DNS could also be used as an attack vector.

II. Impact

A remote attacker could execute arbitrary code or cause a denial of service on a vulnerable system.

III. Solution

Upgrade or Patch

Upgrade or apply a patch as specified by your vendor. In addition to addressing the vulnerability, upgraded versions of sendmail (8.9.12 and 8.11.7) include modifications to help protect other vulnerable sendmail MTAs.

Enable RunAsUser

Consider setting the RunAsUser option to reduce the impact of this vulnerability. The CERT/CC recommends limiting the privileges of applications and services whenever possible.

Systems Affected

VendorStatusDate Updated
AlcatelUnknown29-Mar-2003
Apple Computer Inc.Vulnerable25-Sep-2003
AT&TUnknown29-Mar-2003
AvayaUnknown29-Mar-2003
Check PointUnknown29-Mar-2003
Cisco Systems Inc.Unknown29-Mar-2003
Computer AssociatesUnknown29-Mar-2003
ConectivaVulnerable20-May-2003
Cray Inc.Unknown31-Mar-2003
Data GeneralUnknown29-Mar-2003
DebianVulnerable22-Apr-2003
FreeBSDVulnerable31-Mar-2003
FujitsuVulnerable10-Apr-2003
Gentoo LinuxVulnerable1-Apr-2003
Guardian Digital Inc. Unknown29-Mar-2003
Hewlett-Packard CompanyVulnerable10-Apr-2003
HitachiNot Vulnerable20-May-2003
IBMVulnerable24-Jun-2003
Juniper NetworksUnknown29-Mar-2003
Lotus SoftwareNot Vulnerable1-Apr-2003
Lucent TechnologiesUnknown29-Mar-2003
MandrakeSoftVulnerable1-Apr-2003
Microsoft CorporationUnknown29-Mar-2003
MirapointVulnerable22-Apr-2003
MontaVista SoftwareUnknown29-Mar-2003
NEC CorporationUnknown29-Mar-2003
NetBSDVulnerable22-Apr-2003
NokiaUnknown29-Mar-2003
Nortel NetworksVulnerable8-Apr-2003
NovellUnknown29-Mar-2003
OpenBSDVulnerable1-Apr-2003
OpenPKGVulnerable1-Apr-2003
Red Hat Inc.Vulnerable1-Apr-2003
SCOVulnerable7-Apr-2003
Secure Computing CorporationUnknown29-Mar-2003
Sendmail Inc.Vulnerable29-Mar-2003
Sequent (IBM)Vulnerable29-Apr-2003
SGIVulnerable7-Apr-2003
SlackwareVulnerable1-Apr-2003
Sony CorporationUnknown29-Mar-2003
Sun Microsystems Inc.Vulnerable31-Mar-2003
SuSE Inc.Vulnerable1-Apr-2003
The Sendmail ConsortiumVulnerable29-Mar-2003
UnisysUnknown29-Mar-2003
Wind River Systems Inc.Vulnerable30-Mar-2003
WirexVulnerable2-Apr-2003

References


http://www.securityfocus.com/archive/1/316773/2003-03-28/2003-04-03/0
http://www.iss.net/issEn/delivery/xforce/alertdetail.jsp?oid=22127
http://www.sendmail.org/secure-install.html
http://www.sendmail.org/ftp/RELEASE_NOTES
http://www.ietf.org/rfc/rfc2047.txt

Credit

This vulnerability was discovered by Michal Zalewski and reported by Sendmail Inc.

This document was written by Art Manion.

Other Information

Date Public03/29/2003
Date First Published03/29/2003 05:07:25 PM
Date Last Updated09/25/2003
CERT AdvisoryCA-2003-12
CVE NameCAN-2003-0161
Metric67.20
Document Revision38

If you have feedback, comments, or additional information about this vulnerability, please send us email.
 

Copyright 2003 Carnegie Mellon University