| Home > CAPEC List > CAPEC-42: MIME Conversion (Version 3.9) |
|
High
High
| Nature | Type | ID | Name |
|---|---|---|---|
| ChildOf | Standard Attack PatternStandard Attack Pattern - A standard level attack pattern in CAPEC is focused on a specific methodology or technique used in an attack. It is often seen as a singular piece of a fully executed attack. A standard attack pattern is meant to provide sufficient details to understand the specific technique and how it attempts to accomplish a desired goal. A standard level attack pattern is a specific type of a more abstract meta level attack pattern. | 100 | Overflow Buffers |
| View Name | Top Level Categories |
|---|---|
| Domains of Attack | Software |
| Mechanisms of Attack | Manipulate Data Structures |
Identify target mail server: The adversary identifies a target mail server that they wish to attack.
| Techniques |
|---|
| Use Nmap on a system to identify a mail server service. |
Determine viability of attack: Determine whether the mail server is unpatched and is potentially vulnerable to one of the known MIME conversion buffer overflows (e.g. Sendmail 8.8.3 and 8.8.4).
Find injection vector: Identify places in the system where vulnerable MIME conversion routines may be used.
Craft overflow content: The adversary crafts e-mail messages with special headers that will cause a buffer overflow for the vulnerable MIME conversion routine. The intent of this attack is to leverage the overflow for execution of arbitrary code and gain access to the mail server machine, so the adversary will craft an email that not only overflows the targeted buffer but does so in such a way that the overwritten return address is replaced with one of the adversary's choosing.
| Techniques |
|---|
| Create malicious shellcode that will execute when the program execution is returned to it. |
| Use a NOP-sled in the overflow content to more easily "slide" into the malicious code. This is done so that the exact return address need not be correct, only in the range of all of the NOPs |
Overflow the buffer: Send e-mail messages to the target system with specially crafted headers that trigger the buffer overflow and execute the shell code.
| Scope | Impact | Likelihood |
|---|---|---|
Confidentiality Integrity Availability | Execute Unauthorized Commands | |
Integrity | Modify Data | |
Availability | Unreliable Execution | |
Confidentiality Access Control Authorization | Gain Privileges |
Disable the 7 to 8 bit conversion. This can be done by removing the F=9 flag from all Mailer specifications in the sendmail.cf file.
For example, a sendmail.cf file with these changes applied should look similar to (depending on your system and configuration):
This can be achieved for the "Mlocal" and "Mprog" Mailers by modifying the ".mc" file to include the following lines:
and then rebuilding the sendmail.cf file using m4(1).
From "Exploiting Software", please see reference below.
A MIME conversion buffer overflow exists in Sendmail versions 8.8.3 and 8.8.4. Sendmail versions 8.8.3 and 8.8.4 are vulnerable to a buffer overflow in the MIME handling code. By sending a message with specially-crafted headers to the server, a remote attacker can overflow a buffer and execute arbitrary commands on the system with root privileges.
Sendmail performs a 7 bit to 8 bit conversion on email messages. This vulnerability is due to the fact that insufficient bounds checking was performed while performing these conversions. This gave attacker an opportunity to overwrite the internal stack of sendmail while it is executing with root privileges. An attacker first probes the target system to figure out what mail server is used on the system and what version. An attacker could then test out the exploit at their leisure on their own machine running the same version of the mail server before using it in the wild.
See also: CVE-1999-0047| CWE-ID | Weakness Name |
|---|---|
| 120 | Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') |
| 119 | Improper Restriction of Operations within the Bounds of a Memory Buffer |
| 74 | Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') |
| 20 | Improper Input Validation |
| Submissions | ||
|---|---|---|
| Submission Date | Submitter | Organization |
| 2014年06月23日 (Version 2.6) | CAPEC Content Team | The MITRE Corporation |
| Modifications | ||
| Modification Date | Modifier | Organization |
| 2021年10月21日 (Version 3.6) | CAPEC Content Team | The MITRE Corporation |
| Updated Execution_Flow | ||
| 2022年09月29日 (Version 3.8) | CAPEC Content Team | The MITRE Corporation |
| Updated Example_Instances, Mitigations | ||
|
Use of the Common Attack Pattern Enumeration and Classification (CAPEC), and the associated references from this website are subject to the Terms of Use. Copyright © 2007–2025, The MITRE Corporation. CAPEC and the CAPEC logo are trademarks of The MITRE Corporation. |
||