Skip to content

Commit

Permalink
upgrade phpmailer/phpmailer to 6.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
causefx committed Jul 23, 2021
1 parent 414dc4c commit 686e9ee
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 38 deletions.
12 changes: 6 additions & 6 deletions api/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions api/vendor/composer/InstalledVersions.php
Expand Up @@ -29,7 +29,7 @@ class InstalledVersions
'aliases' =>
array (
),
'reference' => 'd116a5555c0c9912ce0b22091539443ff3a9711a',
'reference' => '414dc4c37d9f1ea1739e52365c87922321a4f984',
'name' => '__root__',
),
'versions' =>
Expand All @@ -41,7 +41,7 @@ class InstalledVersions
'aliases' =>
array (
),
'reference' => 'd116a5555c0c9912ce0b22091539443ff3a9711a',
'reference' => '414dc4c37d9f1ea1739e52365c87922321a4f984',
),
'adldap2/adldap2' =>
array (
Expand Down Expand Up @@ -277,12 +277,12 @@ class InstalledVersions
),
'phpmailer/phpmailer' =>
array (
'pretty_version' => 'v6.4.1',
'version' => '6.4.1.0',
'pretty_version' => 'v6.5.0',
'version' => '6.5.0.0',
'aliases' =>
array (
),
'reference' => '9256f12d8fb0cd0500f93b19e18c356906cbed3d',
'reference' => 'a5b5c43e50b7fba655f793ad27303cd74c57363c',
),
'pragmarx/google2fa' =>
array (
Expand Down
14 changes: 7 additions & 7 deletions api/vendor/composer/installed.json
Expand Up @@ -1578,17 +1578,17 @@
},
{
"name": "phpmailer/phpmailer",
"version": "v6.4.1",
"version_normalized": "6.4.1.0",
"version": "v6.5.0",
"version_normalized": "6.5.0.0",
"source": {
"type": "git",
"url": "https://github.com/PHPMailer/PHPMailer.git",
"reference": "9256f12d8fb0cd0500f93b19e18c356906cbed3d"
"reference": "a5b5c43e50b7fba655f793ad27303cd74c57363c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/9256f12d8fb0cd0500f93b19e18c356906cbed3d",
"reference": "9256f12d8fb0cd0500f93b19e18c356906cbed3d",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a5b5c43e50b7fba655f793ad27303cd74c57363c",
"reference": "a5b5c43e50b7fba655f793ad27303cd74c57363c",
"shasum": ""
},
"require": {
Expand All @@ -1613,7 +1613,7 @@
"stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication",
"symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)"
},
"time": "2021-04-29T12:25:04+00:00",
"time": "2021-06-16T14:33:43+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
Expand Down Expand Up @@ -1645,7 +1645,7 @@
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
"support": {
"issues": "https://github.com/PHPMailer/PHPMailer/issues",
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.4.1"
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.5.0"
},
"funding": [
{
Expand Down
10 changes: 5 additions & 5 deletions api/vendor/composer/installed.php
Expand Up @@ -6,7 +6,7 @@
'aliases' =>
array (
),
'reference' => 'd116a5555c0c9912ce0b22091539443ff3a9711a',
'reference' => '414dc4c37d9f1ea1739e52365c87922321a4f984',
'name' => '__root__',
),
'versions' =>
Expand All @@ -18,7 +18,7 @@
'aliases' =>
array (
),
'reference' => 'd116a5555c0c9912ce0b22091539443ff3a9711a',
'reference' => '414dc4c37d9f1ea1739e52365c87922321a4f984',
),
'adldap2/adldap2' =>
array (
Expand Down Expand Up @@ -254,12 +254,12 @@
),
'phpmailer/phpmailer' =>
array (
'pretty_version' => 'v6.4.1',
'version' => '6.4.1.0',
'pretty_version' => 'v6.5.0',
'version' => '6.5.0.0',
'aliases' =>
array (
),
'reference' => '9256f12d8fb0cd0500f93b19e18c356906cbed3d',
'reference' => 'a5b5c43e50b7fba655f793ad27303cd74c57363c',
),
'pragmarx/google2fa' =>
array (
Expand Down
5 changes: 5 additions & 0 deletions api/vendor/phpmailer/phpmailer/SECURITY.md
Expand Up @@ -2,6 +2,11 @@

Please disclose any security issues or vulnerabilities found through [Tidelift's coordinated disclosure system](https://tidelift.com/security) or to the maintainers privately.

PHPMailer 6.4.1 and earlier contain a vulnerability that can result in untrusted code being called (if such code is injected into the host project's scope by other means). If the `$patternselect` parameter to `validateAddress()` is set to `'php'` (the default, defined by `PHPMailer::$validator`), and the global namespace contains a function called `php`, it will be called in preference to the built-in validator of the same name. Mitigated in PHPMailer 6.5.0 by denying the use of simple strings as validator function names. Recorded as [CVE-2021-3603](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2021-3603). Reported by [Vikrant Singh Chauhan](mailto:vi@hackberry.xyz) via [huntr.dev](https://www.huntr.dev/).

PHPMailer versions 6.4.1 and earlier contain a possible remote code execution vulnerability through the `$lang_path` parameter of the `setLanguage()` method. If the `$lang_path` parameter is passed unfiltered from user input, it can be set to [a UNC path](https://docs.microsoft.com/en-us/dotnet/standard/io/file-path-formats#unc-paths), and if an attacker is also able to persuade the server to load a file from that UNC path, a script file under their control may be executed. This vulnerability only applies to systems that resolve UNC paths, typically only Microsoft Windows.
PHPMailer 6.5.0 mitigates this by no longer treating translation files as PHP code, but by parsing their text content directly. This approach avoids the possibility of executing unknown code while retaining backward compatibility. This isn't ideal, so the current translation format is deprecated and will be replaced in the next major release. Recorded as [CVE-2021-34551](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2021-34551). Reported by [Jilin Diting Information Technology Co., Ltd](https://listensec.com) via Tidelift.

PHPMailer versions between 6.1.8 and 6.4.0 contain a regression of the earlier CVE-2018-19296 object injection vulnerability as a result of [a fix for Windows UNC paths in 6.1.8](https://github.com/PHPMailer/PHPMailer/commit/e2e07a355ee8ff36aba21d0242c5950c56e4c6f9). Recorded as [CVE-2020-36326](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2020-36326). Reported by Fariskhi Vidyan via Tidelift. 6.4.1 fixes this issue, and also enforces stricter checks for URL schemes in local path contexts.

PHPMailer versions 6.1.5 and earlier contain an output escaping bug that occurs in `Content-Type` and `Content-Disposition` when filenames passed into `addAttachment` and other methods that accept attachment names contain double quote characters, in contravention of RFC822 3.4.1. No specific vulnerability has been found relating to this, but it could allow file attachments to bypass attachment filters that are based on matching filename extensions. Recorded as [CVE-2020-13625](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2020-13625). Reported by Elar Lang of Clarified Security.
Expand Down
2 changes: 1 addition & 1 deletion api/vendor/phpmailer/phpmailer/VERSION
@@ -1 +1 @@
6.4.1
6.5.0
Expand Up @@ -19,8 +19,7 @@
$PHPMAILER_LANG['invalid_address'] = 'الإرسال غير ممكن لأن عنوان البريد الإلكتروني غير صالح: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' برنامج الإرسال غير مدعوم.';
$PHPMAILER_LANG['provide_address'] = 'يجب توفير عنوان البريد الإلكتروني لمستلم واحد على الأقل.';
$PHPMAILER_LANG['recipients_failed'] = 'خطأ SMTP: الأخطاء التالية ' .
'فشل في الارسال لكل من : ';
$PHPMAILER_LANG['recipients_failed'] = 'خطأ SMTP: الأخطاء التالية فشل في الارسال لكل من : ';
$PHPMAILER_LANG['signing'] = 'خطأ في التوقيع: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() غير ممكن.';
$PHPMAILER_LANG['smtp_error'] = 'خطأ على مستوى الخادم SMTP: ';
Expand Down
42 changes: 32 additions & 10 deletions api/vendor/phpmailer/phpmailer/src/PHPMailer.php
Expand Up @@ -428,9 +428,11 @@ class PHPMailer
public $Debugoutput = 'echo';

/**
* Whether to keep SMTP connection open after each message.
* If this is set to true then to close the connection
* requires an explicit call to smtpClose().
* Whether to keep the SMTP connection open after each message.
* If this is set to true then the connection will remain open after a send,
* and closing the connection will require an explicit call to smtpClose().
* It's a good idea to use this if you are sending multiple messages as it reduces overhead.
* See the mailing list example for how to use it.
*
* @var bool
*/
Expand Down Expand Up @@ -748,7 +750,7 @@ class PHPMailer
*
* @var string
*/
const VERSION = '6.4.1';
const VERSION = '6.5.0';

/**
* Error severity: message only, continue processing.
Expand Down Expand Up @@ -1335,7 +1337,8 @@ public static function validateAddress($address, $patternselect = null)
if (null === $patternselect) {
$patternselect = static::$validator;
}
if (is_callable($patternselect)) {
//Don't allow strings as callables, see SECURITY.md and CVE-2021-3603
if (is_callable($patternselect) && !is_string($patternselect)) {
return call_user_func($patternselect, $address);
}
//Reject line breaks in addresses; it's valid RFC5322, but not RFC5321
Expand Down Expand Up @@ -2182,7 +2185,8 @@ public function smtpClose()
* The default language is English.
*
* @param string $langcode ISO 639-1 2-character language code (e.g. French is "fr")
* @param string $lang_path Path to the language file directory, with trailing separator (slash)
* @param string $lang_path Path to the language file directory, with trailing separator (slash).D
* Do not set this from user input!
*
* @return bool
*/
Expand Down Expand Up @@ -2244,14 +2248,32 @@ public function setLanguage($langcode = 'en', $lang_path = '')
if (!static::fileIsAccessible($lang_file)) {
$foundlang = false;
} else {
//Overwrite language-specific strings.
//This way we'll never have missing translation keys.
$foundlang = include $lang_file;
//$foundlang = include $lang_file;
$lines = file($lang_file);
foreach ($lines as $line) {
//Translation file lines look like this:
//$PHPMAILER_LANG['authenticate'] = 'SMTP-Fehler: Authentifizierung fehlgeschlagen.';
//These files are parsed as text and not PHP so as to avoid the possibility of code injection
//See https://blog.stevenlevithan.com/archives/match-quoted-string
$matches = [];
if (
preg_match(
'/^\$PHPMAILER_LANG\[\'([a-z\d_]+)\'\]\s*=\s*(["\'])(.+)*?\2;/',
$line,
$matches
) &&
//Ignore unknown translation keys
array_key_exists($matches[1], $PHPMAILER_LANG)
) {
//Overwrite language-specific strings so we'll never have missing translation keys.
$PHPMAILER_LANG[$matches[1]] = (string)$matches[3];
}
}
}
}
$this->language = $PHPMAILER_LANG;

return (bool) $foundlang; //Returns false if language not found
return $foundlang; //Returns false if language not found
}

/**
Expand Down
2 changes: 1 addition & 1 deletion api/vendor/phpmailer/phpmailer/src/POP3.php
Expand Up @@ -46,7 +46,7 @@ class POP3
*
* @var string
*/
const VERSION = '6.4.1';
const VERSION = '6.5.0';

/**
* Default POP3 port number.
Expand Down
3 changes: 2 additions & 1 deletion api/vendor/phpmailer/phpmailer/src/SMTP.php
Expand Up @@ -35,7 +35,7 @@ class SMTP
*
* @var string
*/
const VERSION = '6.4.1';
const VERSION = '6.5.0';

/**
* SMTP line break constant.
Expand Down Expand Up @@ -186,6 +186,7 @@ class SMTP
'Amazon_SES' => '/[\d]{3} Ok (.*)/',
'SendGrid' => '/[\d]{3} Ok: queued as (.*)/',
'CampaignMonitor' => '/[\d]{3} 2.0.0 OK:([a-zA-Z\d]{48})/',
'Haraka' => '/[\d]{3} Message Queued \((.*)\)/',
];

/**
Expand Down

0 comments on commit 686e9ee

Please sign in to comment.