PHP 5.2.1 - Folded Mail Headers Email Header Injection

Author: Stefan Esser
type: remote
platform: php
port: 
date_added: 2007-11-26  
date_updated: 2013-11-22  
verified: 1  
codes: CVE-2007-1718;OSVDB-33948;CVE-2007-1717  
tags:   
aliases:   
screenshot_url:   
application_url:   

raw file: 29784.php  
source: https://www.securityfocus.com/bid/23145/info

PHP is prone to an email-header-injection vulnerability because it fails to properly sanitize user-supplied input when constructing email messages.

Exploiting this issue allows a malicious user to create arbitrary email headers, and then create and transmit spam messages from the affected computer.

The following versions are vulnerable:

PHP 4 up to and including 4.4.6
PHP 5 up to and including 5.2.1

<?php
   mail("test@domain(dot)com", "Test\r\n \nAnother-Header: Blub", "Message");
?>