Email Injection
Attack Pattern ID: 134 (Standard Attack Pattern Completeness: Stub)Typical Severity: MediumStatus: Draft
+ Description

Summary

An attacker manipulates the headers and content of an email message by injecting data via the use of delimeter characters native to the protocol. Many applications allow users to send email messages by filling in fields. For example, a web site may have a link to "share this site with a friend" where the user provides the recipient's email address and the web application fills out all the other fields, such as the subject and body. In this pattern, an attacker adds header and body information to an email message by injecting additional content in an input field used to construct a header of the mail message. This attack takes advantage of the fact that RFC 822 requires that headers in a mail message be separated by a carriage return. As a result, an attacker can inject new headers or content simply by adding a delimiting carriage return and then supplying the new heading and body information. This attack will not work if the user can only supply the message body since a carriage return in the body is treated as a normal character.

+ Attack Prerequisites

The target application must allow users to send email to some recipient, must allow the user to specify the content at least one header field in the message, and must fail to sanitize against the injection of command separators.

+ Resources Required

No special resources are required beyond access to the target mail application.

+ Related Attack Patterns
NatureTypeIDNameDescriptionView(s) this relationship pertains toView\(s\)
ChildOfCategoryCategory152Injection (Injecting Control Plane content through the Data Plane) 
Mechanism of Attack (primary)1000
ChildOfCategoryCategory363WASC Threat Classification 2.0 - WASC-30 - Mail Command Injection 
WASC Threat Classification 2.0333
ParentOfAttack PatternAttack Pattern41Using Meta-characters in E-mail Headers to SecurityDatabase\Alert\Inject Malicious Payloads 
Mechanism of Attack (primary)1000