OpenCATS
OpenCATS copied to clipboard
[Security] Bump phpmailer/phpmailer from 6.0.7 to 6.5.0
Bumps phpmailer/phpmailer from 6.0.7 to 6.5.0. This update includes security fixes.
Vulnerabilities fixed
Sourced from The PHP Security Advisories Database.
Untrusted code may be run from an overridden address validator
Affected versions: <6.5.0
Sourced from The PHP Security Advisories Database.
RCE affecting Windows hosts via UNC paths to translation files
Affected versions: <6.5.0
Sourced from The GitHub Security Advisory Database.
Insufficient output escaping of attachment names in PHPMailer
Impact
CWE-116: Incorrect output escaping.
An attachment added like this (note the double quote within the attachment name, which is entirely valid):
$mail->addAttachment('/tmp/attachment.tmp', 'filename.html";.jpg');Will result in a message containing these headers:
Content-Type: application/octet-stream; name="filename.html";.jpg" Content-Disposition: attachment; filename="filename.html";.jpg"The attachment will be named
filename.html, and the trailing";.jpg"will be ignored. Mail filters that reject.htmlattachments but permit.jpgattachments may be fooled by this.Note that the MIME type itself is obtained automatically from the source filename (in this case
attachment.tmp, which maps to a genericapplication/octet-streamtype), and not the name given to the attachment (though these are the same if a separate name is not provided), though it can be set explicitly in other parameters to attachment methods.Patches
Patched in PHPMailer 6.1.6 by escaping double quotes within the name using a backslash, as per RFC822 section 3.4.1, resulting in correctly escaped headers like this:
Content-Type: application/octet-stream; name="filename.html\";.jpg"
... (truncated)
Affected versions: < 6.1.6
Release notes
Sourced from phpmailer/phpmailer's releases.
PHPMailer 6.5.0
This is a security release.
- SECURITY Fixes CVE-2021-34551, a complex RCE affecting Windows hosts. See https://github.com/PHPMailer/PHPMailer/blob/HEAD/SECURITY.md for details.
- The fix for this issue changes the way that language files are loaded. While they remain in the same PHP-like format, they are processed as plain text, and any code in them will not be run, including operations such as concatenation using the
.operator.- Deprecation The current translation file format using PHP arrays is now deprecated; the next major version will introduce a new format.
- SECURITY Fixes CVE-2021-3603 that may permit untrusted code to be run from an address validator. See https://github.com/PHPMailer/PHPMailer/blob/HEAD/SECURITY.md for details.
- The fix for this issue includes a minor BC break: callables injected into
validateAddress, or indirectly through the$validatorclass property, may no longer be simple strings. If you want to inject your own validator, provide a closure instead of a function name.- Haraka message ID strings are now recognised
Thanks to Vikrant Singh Chauhan, listensec.com, and the WordPress security team for reporting and assistance with this release.
PHPMailer 6.4.1
This is a security release.
- SECURITY Fixes CVE-2020-36326, a regression of CVE-2018-19296 object injection introduced in 6.1.8, see SECURITY.md for details
- Reject more file paths that look like URLs, matching RFC3986 spec, blocking URLS using schemes such as
ssh2- Ensure method signature consistency in
doCallbackcalls- Ukrainian language update
- Add composer scripts for checking coding standards and running tests
Thanks to Fariskhi Vidyan for the report and assistance, and Tidelift for support.
PHPMailer 6.4.0
This is a maintenance release. The changes introduced in 6.3.0 for setting an envelope sender automatically when using
mail()caused problems, especially in WordPress, so this change has been reverted. It gets a minor version bump as it's a change in behaviour, but only back to what 6.2.0 did. See #2298 for more info.Other changes:
- Check for the mbstring extension before decoding addresss in
parseAddress, so it won't fail if you don't have it installed- Add Serbian Latin translation (
sr_latn)- Enrol PHPMailer in Tidelift, because supporting open-source is important!
PHPMailer 6.3.0
This is a maintenance release.
- Handle early connection errors such as 421 during connection and EHLO states
- Switch to Github Actions for CI
- Generate debug output for
mail(), sendmail, and qmail transports. Enable using the same mechanism as for SMTP: setSMTPDebug> 0- Make the
mail()and sendmail transports set the envelope sender the same way as SMTP does, i.e. use whateverFromis set to, only falling back to thesendmail_fromphp.ini setting ifFromis unset. This avoids errors from themail()function ifSenderis not set explicitly and php.ini is not configured. This is a minor functionality change, so bumps the minor version number.- Extend
parseAddressesto decode encoded names, improve testsPHPMailer 6.2.0
This is a maintenance release. With this release, PHPMailer gains official PHP 8 compatibility; earlier versions worked in PHP 8 pre-releases, but the test suite did not. The considerable rework this required (which also restored tests running on older PHP versions) was done by
@jrfnl– thank you very much!
- PHP 8.0 compatibility
- Switch from PHP CS Fixer to PHP CodeSniffer for coding standards
- Create class constants for the debug levels in the POP3 class
- Improve French, Slovenian, and Ukrainian translations
- Improve file upload examples so file extensions are retained
- Resolve PHP 8 line break issues due to a very old PHP bug being fixed
... (truncated)
Changelog
Sourced from phpmailer/phpmailer's changelog.
Version 6.5.0 (June 16th, 2021)
- SECURITY Fixes CVE-2021-34551, a complex RCE affecting Windows hosts. See https://github.com/PHPMailer/PHPMailer/blob/master/SECURITY.md for details.
- The fix for this issue changes the way that language files are loaded. While they remain in the same PHP-like format, they are processed as plain text, and any code in them will not be run, including operations such as concatenation using the
.operator.- Deprecation The current translation file format using PHP arrays is now deprecated; the next major version will introduce a new format.
- SECURITY Fixes CVE-2021-3603 that may permit untrusted code to be run from an address validator. See https://github.com/PHPMailer/PHPMailer/blob/master/SECURITY.md for details.
- The fix for this issue includes a minor BC break: callables injected into
validateAddress, or indirectly through the$validatorclass property, may no longer be simple strings. If you want to inject your own validator, provide a closure instead of a function name.- Haraka message ID strings are now recognised
Version 6.4.1 (April 29th, 2021)
- SECURITY Fixes CVE-2020-36326, a regression of CVE-2018-19296 object injection introduced in 6.1.8, see SECURITY.md for details
- Reject more file paths that look like URLs, matching RFC3986 spec, blocking URLS using schemes such as
ssh2- Ensure method signature consistency in
doCallbackcalls- Ukrainian language update
- Add composer scripts for checking coding standards and running tests
Version 6.4.0 (March 31st, 2021)
- Revert change that made the
mail()and sendmail transports set the envelope sender if one isn't explicitly provided, as it causes problems described in PHPMailer/PHPMailer#2298- Check for mbstring extension before decoding addresss in
parseAddress- Add Serbian Latin translation (
sr_latn)- Enrol PHPMailer in Tidelift
Version 6.3.0 (February 19th, 2021)
- Handle early connection errors such as 421 during connection and EHLO states
- Switch to Github Actions for CI
- Generate debug output for
mail(), sendmail, and qmail transports. Enable using the same mechanism as for SMTP: setSMTPDebug> 0- Make the
mail()and sendmail transports set the envelope sender the same way as SMTP does, i.e. use whateverFromis set to, only falling back to thesendmail_fromphp.ini setting ifFromis unset. This avoids errors from themail()function ifSenderis not set explicitly and php.ini is not configured. This is a minor functionality change, so bumps the minor version number.- Extend
parseAddressesto decode encoded names, improve testsVersion 6.2.0
- PHP 8.0 compatibility, many thanks to
@jrf_nl!- Switch from PHP CS Fixer to PHP CodeSniffer for coding standards
- Create class constants for the debug levels in the POP3 class
- Improve French, Slovenian, and Ukrainian translations
- Improve file upload examples so file extensions are retained
- Resolve PHP 8 line break issues due to a very old PHP bug being fixed
- Avoid warnings when using old openssl functions
- Improve Travis-CI build configuration
Version 6.1.8 (October 9th, 2020)
- Mark
ext-hashas required in composer.json. This has long been required, but now it will cause an error at install time rather than runtime, making it easier to diagnose- Make file upload examples safer
- Update links to SMTP testing servers
- Avoid errors when set_time_limit is disabled (you need better hosting!)
- Allow overriding auth settings for local tests; makes it easy to run tests using HELO
- Recover gracefully from errors during keepalive sessions
- Add AVIF MIME type mapping
- Prevent duplicate
Toheaders in BCC-only messages when usingmail()- Avoid file function problems when attaching files from Windows UNC paths
- Improve German, Bahasa Indonesian, Filipino translations
- Add Javascript-based example
... (truncated)
Commits
a5b5c43Changeloge121da3Merge branch 'master' of https://github.com/PHPMailer/PHPMailer74e512aSecurity updateacd264bMerge branch 'CVE-2021-34551'0063f83Changelog707205fChangelog1047838Changelogc2f191bChangelog45f3c18Deny string-based callables altogether6334babCVE docs- Additional commits viewable in compare view
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot mergewill merge this PR after your CI passes on it@dependabot squash and mergewill squash and merge this PR after your CI passes on it@dependabot cancel mergewill cancel a previously requested merge and block automerging@dependabot reopenwill reopen this PR if it is closed@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)@dependabot use these labelswill set the current labels as the default for future PRs for this repo and language@dependabot use these reviewerswill set the current reviewers as the default for future PRs for this repo and language@dependabot use these assigneeswill set the current assignees as the default for future PRs for this repo and language@dependabot use this milestonewill set the current milestone as the default for future PRs for this repo and language@dependabot badge mewill comment on this PR with code to add a "Dependabot enabled" badge to your readme
Additionally, you can set the following in your Dependabot dashboard:
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)
@dependabot rebase
applied manually. closing.