Vulnerability Note VU#897604
Sendmail address parsing buffer overflow
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.
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.
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.
A remote attacker could execute arbitrary code or cause a denial of service on a vulnerable system.
Upgrade or Patch
Systems Affected (Learn More)
|Vendor||Status||Date Notified||Date Updated|
|Apple Computer Inc.||Affected||29 Mar 2003||25 Sep 2003|
|Conectiva||Affected||29 Mar 2003||20 May 2003|
|Debian||Affected||29 Mar 2003||22 Apr 2003|
|FreeBSD||Affected||29 Mar 2003||31 Mar 2003|
|Fujitsu||Affected||29 Mar 2003||10 Apr 2003|
|Gentoo Linux||Affected||-||01 Apr 2003|
|Hewlett-Packard Company||Affected||29 Mar 2003||10 Apr 2003|
|IBM||Affected||29 Mar 2003||24 Jun 2003|
|MandrakeSoft||Affected||29 Mar 2003||01 Apr 2003|
|Mirapoint||Affected||-||22 Apr 2003|
|NetBSD||Affected||29 Mar 2003||22 Apr 2003|
|Nortel Networks||Affected||29 Mar 2003||08 Apr 2003|
|OpenBSD||Affected||29 Mar 2003||01 Apr 2003|
|OpenPKG||Affected||-||01 Apr 2003|
|Red Hat Inc.||Affected||29 Mar 2003||01 Apr 2003|
CVSS Metrics (Learn More)
This vulnerability was discovered by Michal Zalewski and reported by Sendmail Inc.
This document was written by Art Manion.
- CVE IDs: CAN-2003-0161
- CERT Advisory: CA-2003-12
- Date Public: 29 Mar 2003
- Date First Published: 29 Mar 2003
- Date Last Updated: 25 Sep 2003
- Severity Metric: 67.20
- Document Revision: 38
If you have feedback, comments, or additional information about this vulnerability, please send us email.