CVE-2020-13625
Insufficient output escaping of attachment names in PHPMailer
PHPMailer before 6.1.6 contains an output escaping bug when the name of a file attachment contains a double quote character. This can result in the file type being misinterpreted by the receiver or any mail relay processing the message.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- High
- Availability
- None
Exploit likelihood
What each source reports
NVD Score used
7.5
PHPMailer before 6.1.6 contains an output escaping bug when the name of a file attachment contains a double quote character. This can result in the file type being misinterpreted by the receiver or any mail relay processing the message.
- Record
CVE-2020-13625- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - CVSS 2.0
- 5.0 Medium
AV:N/AC:L/Au:N/C:N/I:P/A:N - Weakness
- CWE-116
- Updated
- 2026-11-02
CVE List No score
PHPMailer before 6.1.6 contains an output escaping bug when the name of a file attachment contains a double quote character. This can result in the file type being misinterpreted by the receiver or any mail relay processing the message.
- Record
CVE-2020-13625- Updated
- 2026-11-02
EUVDEUVD-2020-0422 No score
PHPMailer before 6.1.6 contains an output escaping bug when the name of a file attachment contains a double quote character. This can result in the file type being misinterpreted by the receiver or any mail relay processing the message.
- Record
EUVD-2020-0422- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-f7hx-fqxw-rvvj
7.5
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 .html attachments but permit .jpg attachments 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 generic application/octet-stream type), 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"
Content-Disposition: attachment; filename="filename.html\";.jpg"
Workarounds
Reject or filter names and filenames containing double quote (") characters before passing them to attachment functions such as addAttachment().
References
CVE-2020-13625. PHPMailer 6.1.6 release
For more information
If you have any questions or comments about this advisory:
- Open an issue in the PHPMailer repo
- Record
GHSA-f7hx-fqxw-rvvj- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Weakness
- CWE-116
- Updated
- 2026-11-02
OSVALPINE-CVE-2020-13625
7.5
PHPMailer before 6.1.6 contains an output escaping bug when the name of a file attachment contains a double quote character. This can result in the file type being misinterpreted by the receiver or any mail relay processing the message.
- Record
ALPINE-CVE-2020-13625- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Updated
- 2026-11-03
OSV
7.5
PHPMailer before 6.1.6 contains an output escaping bug when the name of a file attachment contains a double quote character. This can result in the file type being misinterpreted by the receiver or any mail relay processing the message.
- Record
CVE-2020-13625- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Updated
- 2026-11-02
Show 11 moreShow less
OSVDEBIAN-CVE-2020-13625
7.5
PHPMailer before 6.1.6 contains an output escaping bug when the name of a file attachment contains a double quote character. This can result in the file type being misinterpreted by the receiver or any mail relay processing the message.
- Record
DEBIAN-CVE-2020-13625- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Updated
- 2026-11-02
OSVGHSA-f7hx-fqxw-rvvj
7.5
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 .html attachments but permit .jpg attachments 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 generic application/octet-stream type), 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"
Content-Disposition: attachment; filename="filename.html\";.jpg"
Workarounds
Reject or filter names and filenames containing double quote (") characters before passing them to attachment functions such as addAttachment().
References
CVE-2020-13625. PHPMailer 6.1.6 release
For more information
If you have any questions or comments about this advisory:
- Open an issue in the PHPMailer repo
- Record
GHSA-f7hx-fqxw-rvvj- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Weakness
- CWE-116
- Updated
- 2026-11-02
OSVUBUNTU-CVE-2020-13625
7.5
PHPMailer before 6.1.6 contains an output escaping bug when the name of a file attachment contains a double quote character. This can result in the file type being misinterpreted by the receiver or any mail relay processing the message.
- Record
UBUNTU-CVE-2020-13625- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Updated
- 2026-11-02
OSVBIT-phpmailer-2020-13625 No score
PHPMailer before 6.1.6 contains an output escaping bug when the name of a file attachment contains a double quote character. This can result in the file type being misinterpreted by the receiver or any mail relay processing the message.
- Record
BIT-phpmailer-2020-13625- Updated
- 2026-11-02
OSVCLSA-2026-1771375983 No score
TuxCare security update for phpmailer/phpmailer (3 CVEs)
TuxCare rebuilt phpmailer/phpmailer to address 3 CVEs. Fixed in 5.2.28-p1+tuxcare.
- Record
CLSA-2026-1771375983- Updated
- 2026-11-02
OSVMGASA-2020-0313 No score
Updated php-phpmailer packages fix security vulnerability
Fix insufficient output escaping bug in file attachment names (CVE-2020-13625).
- Record
MGASA-2020-0313- Updated
- 2026-11-02
OSVopenSUSE-SU-2020:1060-1 No score
Security update for cacti, cacti-spine
This update for cacti, cacti-spine fixes the following issues:
-
cacti 1.2.13:
- Query XSS vulnerabilities require vendor package update (CVE-2020-11022 / CVE-2020-11023)
- Lack of escaping on some pages can lead to XSS exposure
- Update PHPMailer to 6.1.6 (CVE-2020-13625)
- SQL Injection vulnerability due to input validation failure when editing colors (CVE-2020-14295, boo#1173090)
- Lack of escaping on template import can lead to XSS exposure
-
switch from cron to systemd timers (boo#1115436):
- cacti-cron.timer
- cacti-cron.service
-
avoid potential root escalation on systems with fs.protected_hardlinks=0 (boo#1154087): handle directory permissions in file section instead of using chown during post installation
-
rewrote apache configuration to get rid of .htaccess files and explicitely disable directory permissions per default (only allow a limited, well-known set of directories)
- Record
openSUSE-SU-2020:1060-1- Updated
- 2026-11-02
OSVopenSUSE-SU-2020:1106-1 No score
Security update for cacti, cacti-spine
This update for cacti, cacti-spine fixes the following issues:
-
cacti 1.2.13:
- Query XSS vulnerabilities require vendor package update (CVE-2020-11022 / CVE-2020-11023)
- Lack of escaping on some pages can lead to XSS exposure
- Update PHPMailer to 6.1.6 (CVE-2020-13625)
- SQL Injection vulnerability due to input validation failure when editing colors (CVE-2020-14295, boo#1173090)
- Lack of escaping on template import can lead to XSS exposure
-
switch from cron to systemd timers (boo#1115436):
- cacti-cron.timer
- cacti-cron.service
-
avoid potential root escalation on systems with fs.protected_hardlinks=0 (boo#1154087): handle directory permissions in file section instead of using chown during post installation
-
rewrote apache configuration to get rid of .htaccess files and explicitely disable directory permissions per default (only allow a limited, well-known set of directories)
This update was imported from the openSUSE:Leap:15.1:Update update project.
- Record
openSUSE-SU-2020:1106-1- Updated
- 2026-11-02
OSVopenSUSE-SU-2024:10670-1 No score
cacti-1.2.18-1.2 on GA media
These are all security issues fixed in the cacti-1.2.18-1.2 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2024:10670-1- Updated
- 2026-11-02
OSVUSN-4505-1 No score
libphp-phpmailer vulnerability
Elar Lang discovered that PHPMailer did not properly escape double quote characters in filenames. A remote attacker could possibly exploit this with a crafted filename to bypass attachment filters that are based on matching filename extensions. (CVE-2020-13625)
- Record
USN-4505-1- Updated
- 2026-11-02
OSVUSN-5956-1 No score
libphp-phpmailer vulnerabilities
Dawid Golunski discovered that PHPMailer was not properly escaping user input data used as arguments to functions executed by the system shell. An attacker could possibly use this issue to execute arbitrary code. This issue only affected Ubuntu 16.04 ESM. (CVE-2016-10033, CVE-2016-10045)
It was discovered that PHPMailer was not properly escaping characters in certain fields of the code_generator.php example code. An attacker could possibly use this issue to conduct cross-site scripting (XSS) attacks. This issue was only fixed in Ubuntu 16.04 ESM and Ubuntu 18.04 ESM. (CVE-2017-11503)
Yongxiang Li discovered that PHPMailer was not properly converting relative paths provided as user input when adding attachments to messages, which could lead to relative image URLs being treated as absolute local file paths and added as attachments. An attacker could possibly use this issue to access unauthorized resources and expose sensitive information. This issue only affected Ubuntu 16.04 ESM. (CVE-2017-5223)
Sehun Oh discovered that PHPMailer was not properly processing untrusted non-local file attachments, which could lead to an object injection. An attacker could possibly use this issue to execute arbitrary code. This issue only affected Ubuntu 16.04 ESM. (CVE-2018-19296)
Elar Lang discovered that PHPMailer was not properly escaping file attachment names, which could lead to a misinterpretation of file types by entities processing the message. An attacker could possibly use this issue to bypass attachment filters. This issue was only fixed in Ubuntu 16.04 ESM and Ubuntu 20.04 ESM. (CVE-2020-13625)
It was discovered that PHPMailer was not properly handling callables in its validateAddress function, which could result in untrusted code being called should the global namespace contain a function called 'php'. An attacker could possibly use this issue to execute arbitrary code. This issue was only fixed in Ubuntu 20.04 ESM and Ubuntu 22.04 ESM. (CVE-2021-3603)
- Record
USN-5956-1- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
phpmailer/phpmailerPackagist |
before 6.1.6 | 6.1.6 |
cactiAlpine:v3.13 |
before 1.2.13-r0 | 1.2.13-r0 |
cactiAlpine:v3.14 |
before 1.2.13-r0 | 1.2.13-r0 |
cactiAlpine:v3.15 |
before 1.2.13-r0 | 1.2.13-r0 |
cactiAlpine:v3.16 |
before 1.2.13-r0 | 1.2.13-r0 |
cactiAlpine:v3.17 |
before 1.2.13-r0 | 1.2.13-r0 |
cactiAlpine:v3.18 |
before 1.2.13-r0 | 1.2.13-r0 |
cactiAlpine:v3.19 |
before 1.2.13-r0 | 1.2.13-r0 |
cactiAlpine:v3.20 |
before 1.2.13-r0 | 1.2.13-r0 |
cactiAlpine:v3.21 |
before 1.2.13-r0 | 1.2.13-r0 |
Show 28 moreShow less
| Package | Affected | Fixed |
|---|---|---|
cactiAlpine:v3.22 |
before 1.2.13-r0 | 1.2.13-r0 |
cactiAlpine:v3.23 |
before 1.2.13-r0 | 1.2.13-r0 |
cactiAlpine:v3.24 |
before 1.2.13-r0 | 1.2.13-r0 |
phpmailerBitnami |
before 6.1.6 | 6.1.6 |
phpmailer/phpmailerTuxCare:Packagist From an advisory covering 3 CVEs |
5.2.28 up to 5.2.28-p1+tuxcare | 5.2.28-p1+tuxcare |
libphp-phpmailerDebian:12 |
before 6.1.6-1 | 6.1.6-1 |
libphp-phpmailerDebian:13 |
before 6.1.6-1 | 6.1.6-1 |
libphp-phpmailerDebian:14 |
before 6.1.6-1 | 6.1.6-1 |
libphp-phpmailerDebian:8 |
before 5.2.9+dfsg-2+deb8u6, plus listed versions 5.2.9+dfsg-25.2.9+dfsg-2+deb8u15.2.9+dfsg-2+deb8u25.2.9+dfsg-2+deb8u35.2.9+dfsg-2+deb8u45.2.9+dfsg-2+deb8u5 |
5.2.9+dfsg-2+deb8u6 |
libphp-phpmailerDebian:9 |
before 5.2.14+dfsg-2.3+deb9u2, plus listed versions 5.2.14+dfsg-2.35.2.14+dfsg-2.3+deb9u1 |
5.2.14+dfsg-2.3+deb9u2 |
phpmailer/phpmailerPackagist |
before 6.1.6, plus listed versions v5.2.10v5.2.11v5.2.12v5.2.13v5.2.14 Show 40 moreShow lessv5.2.15v5.2.16v5.2.17v5.2.18v5.2.19v5.2.2v5.2.20v5.2.21v5.2.22v5.2.23v5.2.24v5.2.25v5.2.26v5.2.27v5.2.28v5.2.4v5.2.5v5.2.6v5.2.7v5.2.8v5.2.9v6.0.0v6.0.0rc1v6.0.0rc2v6.0.0rc3v6.0.0rc4v6.0.0rc5v6.0.1v6.0.2v6.0.3v6.0.4v6.0.5v6.0.6v6.0.7v6.1.0v6.1.1v6.1.2v6.1.3v6.1.4v6.1.5 |
6.1.6 |
php-phpmailerMageia:7 |
before 6.1.6-1.mga7 | 6.1.6-1.mga7 |
libphp-phpmailerUbuntu:Pro:16.04:LTS |
before 5.2.14+dfsg-1ubuntu0.1~esm1, plus listed versions 5.2.10+dfsg-15.2.14+dfsg-15.2.14+dfsg-1build1 |
5.2.14+dfsg-1ubuntu0.1~esm1 |
libphp-phpmailerUbuntu:18.04:LTS |
before 5.2.14+dfsg-2.3+deb9u2build0.18.04.1, plus listed versions 5.2.14+dfsg-2.35.2.14+dfsg-2.3+deb9u1build0.18.04.1 |
5.2.14+dfsg-2.3+deb9u2build0.18.04.1 |
libphp-phpmailerUbuntu:Pro:20.04:LTS |
before 6.0.6-0.1ubuntu0.1~esm1, plus listed versions 6.0.6-0.1 |
6.0.6-0.1ubuntu0.1~esm1 |
libphp-phpmailerUbuntu:Pro:16.04:LTS From an advisory covering 7 CVEs |
before 5.2.14+dfsg-1ubuntu0.1~esm1, plus listed versions 5.2.10+dfsg-15.2.14+dfsg-15.2.14+dfsg-1build1 |
5.2.14+dfsg-1ubuntu0.1~esm1 |
libphp-phpmailerUbuntu:Pro:18.04:LTS From an advisory covering 7 CVEs |
before 5.2.14+dfsg-2.3+deb9u2ubuntu0.1~esm1, plus listed versions 5.2.14+dfsg-2.35.2.14+dfsg-2.3+deb9u1build0.18.04.15.2.14+dfsg-2.3+deb9u2build0.18.04.1 |
5.2.14+dfsg-2.3+deb9u2ubuntu0.1~esm1 |
libphp-phpmailerUbuntu:Pro:20.04:LTS From an advisory covering 7 CVEs |
before 6.0.6-0.1ubuntu0.1~esm1, plus listed versions 6.0.6-0.1 |
6.0.6-0.1ubuntu0.1~esm1 |
libphp-phpmailerUbuntu:Pro:22.04:LTS From an advisory covering 7 CVEs |
before 6.2.0-2ubuntu0.1~esm1, plus listed versions 6.2.0-2 |
6.2.0-2ubuntu0.1~esm1 |
cactiSUSE:Package Hub 12 From an advisory covering 4 CVEs |
before 1.2.13-11.1 | 1.2.13-11.1 |
cacti-spineSUSE:Package Hub 12 From an advisory covering 4 CVEs |
before 1.2.13-8.1 | 1.2.13-8.1 |
cactiopenSUSE:Leap 15.1 From an advisory covering 4 CVEs |
before 1.2.13-11.1 | 1.2.13-11.1 |
cacti-spineopenSUSE:Leap 15.1 From an advisory covering 4 CVEs |
before 1.2.13-8.1 | 1.2.13-8.1 |
cactiopenSUSE:Leap 15.2 From an advisory covering 4 CVEs |
before 1.2.13-11.1 | 1.2.13-11.1 |
cacti-spineopenSUSE:Leap 15.2 From an advisory covering 4 CVEs |
before 1.2.13-8.1 | 1.2.13-8.1 |
cactiSUSE:Package Hub 15 SP1 From an advisory covering 4 CVEs |
before 1.2.13-bp151.4.12.1 | 1.2.13-bp151.4.12.1 |
cacti-spineSUSE:Package Hub 15 SP1 From an advisory covering 4 CVEs |
before 1.2.13-bp151.4.12.1 | 1.2.13-bp151.4.12.1 |
cactiopenSUSE:Tumbleweed From an advisory covering 31 CVEs |
before 1.2.18-1.2 | 1.2.18-1.2 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | ||
| affected, aliases, references | OSV | |
| aliases | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2020-13625 is a high vulnerability (CVSS 7.5) in Phpmailer Project Phpmailer, published May 27, 2020. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 3.78%, the 90th percentile. Fixed in phpmailer/phpmailer 6.1.6.
References
github.com/PHPMailer/PHPMailer/releases/tag/v6.1.6
github.com/PHPMailer/PHPMailer/security/advisories/GHSA-f7hx-fqxw-rvvj
lists.debian.org/debian-lts-announce/2020/06/msg00014.html
lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/SMH4TC5XTS3KZVGMSKEPPBZ2XTZCKKCX
lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/EFM3BZABL6RUHTVMXSC7OFMP4CKWMRPJ
lists.opensuse.org/opensuse-security-announce/2020-07/msg00067.html
Show 61 moreShow less
lists.opensuse.org/opensuse-security-announce/2020-07/msg00085.html
lists.debian.org/debian-lts-announce/2020/08/msg00004.html
usn.ubuntu.com/4505-1
github.com/PHPMailer/PHPMailer/commit/c2796cb1cb99d7717290b48c4e6f32cb6c60b7b3
nvd.nist.gov/vuln/detail/CVE-2020-13625
lists.fedoraproject.org/archives/list/[email protected]/message/SMH4TC5XTS3KZVGMSKEPPBZ2XTZCKKCX
lists.fedoraproject.org/archives/list/[email protected]/message/EFM3BZABL6RUHTVMXSC7OFMP4CKWMRPJ
github.com/advisories/GHSA-f7hx-fqxw-rvvj
security.alpinelinux.org/vuln/CVE-2020-13625
security-tracker.debian.org/tracker/CVE-2020-13625
github.com/PHPMailer/PHPMailer
advisories.mageia.org/MGASA-2020-0313.html
bugs.mageia.org/show_bug.cgi?id=26760
lists.fedoraproject.org/archives/list/[email protected]/thread/OBRDMEV3CB44CAAF5BOHFNV23JVRO6PZ
ubuntu.com/security/CVE-2020-13625
ubuntu.com/security/notices/USN-4505-1
ubuntu.com/security/notices/USN-5956-1
cve.org/CVERecord?id=CVE-2020-13625
ubuntu.com/security/CVE-2016-10033
ubuntu.com/security/CVE-2016-10045
ubuntu.com/security/CVE-2017-5223
ubuntu.com/security/CVE-2017-11503
ubuntu.com/security/CVE-2018-19296
ubuntu.com/security/CVE-2021-3603
lists.opensuse.org/archives/list/[email protected]/thread/VVPI65AW45TXMRAYCWJ6YJT3LF4GIMWL
bugzilla.suse.com/1115436
bugzilla.suse.com/1154087
bugzilla.suse.com/1173090
suse.com/security/cve/CVE-2020-11022
suse.com/security/cve/CVE-2020-11023
suse.com/security/cve/CVE-2020-13625
suse.com/security/cve/CVE-2020-14295
lists.opensuse.org/archives/list/[email protected]/thread/4IXKYESUUIOBHBKL32YKWOWHSJKS7RN3
suse.com/security/cve/CVE-2006-6799
suse.com/security/cve/CVE-2007-3112
suse.com/security/cve/CVE-2009-4112
suse.com/security/cve/CVE-2014-4000
suse.com/security/cve/CVE-2017-10970
suse.com/security/cve/CVE-2017-11163
suse.com/security/cve/CVE-2017-11691
suse.com/security/cve/CVE-2017-12065
suse.com/security/cve/CVE-2017-12927
suse.com/security/cve/CVE-2017-12978
suse.com/security/cve/CVE-2017-15194
suse.com/security/cve/CVE-2017-16641
suse.com/security/cve/CVE-2017-16660
suse.com/security/cve/CVE-2017-16661
suse.com/security/cve/CVE-2017-16785
suse.com/security/cve/CVE-2018-20723
suse.com/security/cve/CVE-2018-20724
suse.com/security/cve/CVE-2018-20725
suse.com/security/cve/CVE-2018-20726
suse.com/security/cve/CVE-2019-16723
suse.com/security/cve/CVE-2019-17357
suse.com/security/cve/CVE-2019-17358
suse.com/security/cve/CVE-2020-14424
suse.com/security/cve/CVE-2020-25706
suse.com/security/cve/CVE-2020-35701
suse.com/security/cve/CVE-2020-7106
suse.com/security/cve/CVE-2020-7237
suse.com/security/cve/CVE-2020-8813