Update Swiftmailer to avoid potential security risk

This commit is contained in:
Frederic Guillot
2017-01-05 20:45:33 -05:00
parent f2a24fb3bf
commit febb9ade5b
4 changed files with 66 additions and 54 deletions

View File

@@ -33,8 +33,8 @@ class Mail extends Base implements ClientInterface
$message = Swift_Message::newInstance() $message = Swift_Message::newInstance()
->setSubject($subject) ->setSubject($subject)
->setFrom(array($this->helper->mail->getMailSenderAddress() => $author)) ->setFrom(array($this->helper->mail->getMailSenderAddress() => $author))
->setBody($html, 'text/html') ->setTo(array($email => $name))
->setTo(array($email => $name)); ->setBody($html, 'text/html');
Swift_Mailer::newInstance($this->getTransport())->send($message); Swift_Mailer::newInstance($this->getTransport())->send($message);
} catch (Swift_TransportException $e) { } catch (Swift_TransportException $e) {

View File

@@ -24,6 +24,7 @@ class Smtp extends Mail
$transport->setUsername(MAIL_SMTP_USERNAME); $transport->setUsername(MAIL_SMTP_USERNAME);
$transport->setPassword(MAIL_SMTP_PASSWORD); $transport->setPassword(MAIL_SMTP_PASSWORD);
$transport->setEncryption(MAIL_SMTP_ENCRYPTION); $transport->setEncryption(MAIL_SMTP_ENCRYPTION);
if (HTTP_VERIFY_SSL_CERTIFICATE === false) { if (HTTP_VERIFY_SSL_CERTIFICATE === false) {
$transport->setStreamOptions(array( $transport->setStreamOptions(array(
'ssl' => array( 'ssl' => array(

View File

@@ -35,7 +35,7 @@
"paragonie/random_compat": "2.0.2", "paragonie/random_compat": "2.0.2",
"pimple/pimple" : "3.0.2", "pimple/pimple" : "3.0.2",
"ramsey/array_column": "1.1.3", "ramsey/array_column": "1.1.3",
"swiftmailer/swiftmailer" : "5.4.2", "swiftmailer/swiftmailer" : "5.4.5",
"symfony/console" : "2.8.7", "symfony/console" : "2.8.7",
"symfony/event-dispatcher" : "2.7.14", "symfony/event-dispatcher" : "2.7.14",
"gregwar/captcha": "1.1.1" "gregwar/captcha": "1.1.1"

113
composer.lock generated
View File

@@ -4,8 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"hash": "5111a8477b4462a68a9a93af931fbfeb", "hash": "3d24ad1182c0460eda5791bd7fc68984",
"content-hash": "8609029c4ce32c3b3aec0778320a729a", "content-hash": "67d44f262438806c115a362c9912b669",
"packages": [ "packages": [
{ {
"name": "christian-riesen/base32", "name": "christian-riesen/base32",
@@ -597,22 +597,30 @@
}, },
{ {
"name": "psr/log", "name": "psr/log",
"version": "1.0.0", "version": "1.0.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/php-fig/log.git", "url": "https://github.com/php-fig/log.git",
"reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
"reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
"shasum": "" "shasum": ""
}, },
"require": {
"php": ">=5.3.0"
},
"type": "library", "type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": { "autoload": {
"psr-0": { "psr-4": {
"Psr\\Log\\": "" "Psr\\Log\\": "Psr/Log/"
} }
}, },
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
@@ -626,12 +634,13 @@
} }
], ],
"description": "Common interface for logging libraries", "description": "Common interface for logging libraries",
"homepage": "https://github.com/php-fig/log",
"keywords": [ "keywords": [
"log", "log",
"psr", "psr",
"psr-3" "psr-3"
], ],
"time": "2012-12-21 11:40:51" "time": "2016-10-10 12:19:37"
}, },
{ {
"name": "ramsey/array_column", "name": "ramsey/array_column",
@@ -680,23 +689,24 @@
}, },
{ {
"name": "swiftmailer/swiftmailer", "name": "swiftmailer/swiftmailer",
"version": "v5.4.2", "version": "v5.4.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/swiftmailer/swiftmailer.git", "url": "https://github.com/swiftmailer/swiftmailer.git",
"reference": "d8db871a54619458a805229a057ea2af33c753e8" "reference": "cd142238a339459b10da3d8234220963f392540c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/d8db871a54619458a805229a057ea2af33c753e8", "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/cd142238a339459b10da3d8234220963f392540c",
"reference": "d8db871a54619458a805229a057ea2af33c753e8", "reference": "cd142238a339459b10da3d8234220963f392540c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.3" "php": ">=5.3.3"
}, },
"require-dev": { "require-dev": {
"mockery/mockery": "~0.9.1,<0.9.4" "mockery/mockery": "~0.9.1",
"symfony/phpunit-bridge": "~3.2"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@@ -729,7 +739,7 @@
"mail", "mail",
"mailer" "mailer"
], ],
"time": "2016-05-01 08:45:47" "time": "2016-12-29 10:02:40"
}, },
{ {
"name": "symfony/console", "name": "symfony/console",
@@ -853,16 +863,16 @@
}, },
{ {
"name": "symfony/polyfill-mbstring", "name": "symfony/polyfill-mbstring",
"version": "v1.2.0", "version": "v1.3.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git", "url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "dff51f72b0706335131b00a7f49606168c582594" "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/dff51f72b0706335131b00a7f49606168c582594", "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4",
"reference": "dff51f72b0706335131b00a7f49606168c582594", "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -874,7 +884,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.2-dev" "dev-master": "1.3-dev"
} }
}, },
"autoload": { "autoload": {
@@ -908,7 +918,7 @@
"portable", "portable",
"shim" "shim"
], ],
"time": "2016-05-18 14:26:46" "time": "2016-11-14 01:06:16"
}, },
{ {
"name": "zendframework/zendxml", "name": "zendframework/zendxml",
@@ -1062,16 +1072,16 @@
}, },
{ {
"name": "phpspec/prophecy", "name": "phpspec/prophecy",
"version": "v1.6.1", "version": "v1.6.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpspec/prophecy.git", "url": "https://github.com/phpspec/prophecy.git",
"reference": "58a8137754bc24b25740d4281399a4a3596058e0" "reference": "6c52c2722f8460122f96f86346600e1077ce22cb"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/58a8137754bc24b25740d4281399a4a3596058e0", "url": "https://api.github.com/repos/phpspec/prophecy/zipball/6c52c2722f8460122f96f86346600e1077ce22cb",
"reference": "58a8137754bc24b25740d4281399a4a3596058e0", "reference": "6c52c2722f8460122f96f86346600e1077ce22cb",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1079,10 +1089,11 @@
"php": "^5.3|^7.0", "php": "^5.3|^7.0",
"phpdocumentor/reflection-docblock": "^2.0|^3.0.2", "phpdocumentor/reflection-docblock": "^2.0|^3.0.2",
"sebastian/comparator": "^1.1", "sebastian/comparator": "^1.1",
"sebastian/recursion-context": "^1.0" "sebastian/recursion-context": "^1.0|^2.0"
}, },
"require-dev": { "require-dev": {
"phpspec/phpspec": "^2.0" "phpspec/phpspec": "^2.0",
"phpunit/phpunit": "^4.8 || ^5.6.5"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@@ -1120,7 +1131,7 @@
"spy", "spy",
"stub" "stub"
], ],
"time": "2016-06-07 08:13:47" "time": "2016-11-21 14:58:47"
}, },
{ {
"name": "phpunit/php-code-coverage", "name": "phpunit/php-code-coverage",
@@ -1186,16 +1197,16 @@
}, },
{ {
"name": "phpunit/php-file-iterator", "name": "phpunit/php-file-iterator",
"version": "1.4.1", "version": "1.4.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/php-file-iterator.git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
"reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5",
"reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1229,7 +1240,7 @@
"filesystem", "filesystem",
"iterator" "iterator"
], ],
"time": "2015-06-21 13:08:43" "time": "2016-10-03 07:40:28"
}, },
{ {
"name": "phpunit/php-text-template", "name": "phpunit/php-text-template",
@@ -1318,16 +1329,16 @@
}, },
{ {
"name": "phpunit/php-token-stream", "name": "phpunit/php-token-stream",
"version": "1.4.8", "version": "1.4.9",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/php-token-stream.git", "url": "https://github.com/sebastianbergmann/php-token-stream.git",
"reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" "reference": "3b402f65a4cc90abf6e1104e388b896ce209631b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3b402f65a4cc90abf6e1104e388b896ce209631b",
"reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", "reference": "3b402f65a4cc90abf6e1104e388b896ce209631b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1363,7 +1374,7 @@
"keywords": [ "keywords": [
"tokenizer" "tokenizer"
], ],
"time": "2015-09-15 10:49:45" "time": "2016-11-15 14:06:22"
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",
@@ -1559,22 +1570,22 @@
}, },
{ {
"name": "sebastian/comparator", "name": "sebastian/comparator",
"version": "1.2.0", "version": "1.2.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/comparator.git", "url": "https://github.com/sebastianbergmann/comparator.git",
"reference": "937efb279bd37a375bcadf584dec0726f84dbf22" "reference": "6a1ed12e8b2409076ab22e3897126211ff8b1f7f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/6a1ed12e8b2409076ab22e3897126211ff8b1f7f",
"reference": "937efb279bd37a375bcadf584dec0726f84dbf22", "reference": "6a1ed12e8b2409076ab22e3897126211ff8b1f7f",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.3", "php": ">=5.3.3",
"sebastian/diff": "~1.2", "sebastian/diff": "~1.2",
"sebastian/exporter": "~1.2" "sebastian/exporter": "~1.2 || ~2.0"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "~4.4" "phpunit/phpunit": "~4.4"
@@ -1619,7 +1630,7 @@
"compare", "compare",
"equality" "equality"
], ],
"time": "2015-07-26 15:48:44" "time": "2016-11-19 09:18:40"
}, },
{ {
"name": "sebastian/diff", "name": "sebastian/diff",
@@ -1675,23 +1686,23 @@
}, },
{ {
"name": "sebastian/environment", "name": "sebastian/environment",
"version": "1.3.7", "version": "1.3.8",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/environment.git", "url": "https://github.com/sebastianbergmann/environment.git",
"reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716" "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/4e8f0da10ac5802913afc151413bc8c53b6c2716", "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea",
"reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716", "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.3" "php": "^5.3.3 || ^7.0"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "~4.4" "phpunit/phpunit": "^4.8 || ^5.0"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@@ -1721,7 +1732,7 @@
"environment", "environment",
"hhvm" "hhvm"
], ],
"time": "2016-05-17 03:18:57" "time": "2016-08-18 05:49:44"
}, },
{ {
"name": "sebastian/exporter", "name": "sebastian/exporter",