Disabling mail header injections via extra(additional) headers.

From: Date: Sun, 07 Aug 2016 23:33:26 +0000
Subject: Disabling mail header injections via extra(additional) headers.
Groups: php.internals 
Request: Send a blank email to internals+get-94907@lists.php.net to get a copy of this message
Hi all, I disabled \r\n injections, that could override hole contents of mail, by checking string extra headers for mail/mb_send_mail already. Extra mail headers could be checked more by having array extra headers. https://bugs.php.net/bug.php?id=69791 https://github.com/php/php-src/pull/2060 This patch accepts both "string"(current) and "array"(new) extra headers. It does a lot more checks than string version. I spend only few hours including research for this, so it might contain mistakes. Please review. I'll merge this to master within a week or so. Thank you. P.S. Even with array extra headers, it cannot prevent unwanted mail header injections. e.g. Attackers may inject unwanted 'bcc' headers with bad code. However, it does better job than string only extra headers. -- Yasuo Ohgaki yohgaki@ohgaki.net

« previous php.internals (#94907) next »