Skip to content
This repository was archived by the owner on Mar 27, 2019. It is now read-only.

Commit 7b7f98e

Browse files
author
Aleksey Razbakov
authored
Merge pull request #55 from muhkuh2005/v1.9.3.1-patch1
PATCH_SUPEE-9652_v2-2017-02-07-01-18-38
2 parents 93562d3 + 7afb254 commit 7b7f98e

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

app/etc/applied.patches.list

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-e 2017-02-08 08:27:48 UTC | SUPEE-9652 | EE_1.14.3.1 | v1 | 4038f0785d828794083f53f10c01aaa6af403523 | Tue Jan 24 15:03:12 2017 +0200 | 9586981e6ca8b255014b242d50b68b88525b0754..4038f0785d828794083f53f10c01aaa6af403523
2+
patching file lib/Zend/Mail/Transport/Sendmail.php
3+
4+

lib/Zend/Mail/Transport/Sendmail.php

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,19 @@ public function _sendMail()
119119
);
120120
}
121121

122-
set_error_handler(array($this, '_handleMailErrors'));
123-
$result = mail(
124-
$this->recipients,
125-
$this->_mail->getSubject(),
126-
$this->body,
127-
$this->header,
128-
$this->parameters);
129-
restore_error_handler();
122+
// Sanitize the From header
123+
if (!Zend_Validate::is(str_replace(' ', '', $this->parameters), 'EmailAddress')) {
124+
throw new Zend_Mail_Transport_Exception('Potential code injection in From header');
125+
} else {
126+
set_error_handler(array($this, '_handleMailErrors'));
127+
$result = mail(
128+
$this->recipients,
129+
$this->_mail->getSubject(),
130+
$this->body,
131+
$this->header,
132+
$this->parameters);
133+
restore_error_handler();
134+
}
130135
}
131136

132137
if ($this->_errstr !== null || !$result) {

0 commit comments

Comments
 (0)