Every CVE Search/ Get API key

CVE-2020-13625

Insufficient output escaping of attachment names in PHPMailer

7.5 HighFix available

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

3.78%Up 1.7 points since Apr 14, 2021
90%50%10%1%

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 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
CVSS 2.0
5.0 MediumAV: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:

Record
GHSA-f7hx-fqxw-rvvj
CVSS 3.1
7.5 HighCVSS: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 HighCVSS: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 HighCVSS: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 HighCVSS: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:

Record
GHSA-f7hx-fqxw-rvvj
CVSS 3.1
7.5 HighCVSS: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 HighCVSS: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

Affected packages
PackageAffectedFixed
phpmailer/phpmailer
Packagist
before 6.1.6
6.1.6
cacti
Alpine:v3.13
before 1.2.13-r0
1.2.13-r0
cacti
Alpine:v3.14
before 1.2.13-r0
1.2.13-r0
cacti
Alpine:v3.15
before 1.2.13-r0
1.2.13-r0
cacti
Alpine:v3.16
before 1.2.13-r0
1.2.13-r0
cacti
Alpine:v3.17
before 1.2.13-r0
1.2.13-r0
cacti
Alpine:v3.18
before 1.2.13-r0
1.2.13-r0
cacti
Alpine:v3.19
before 1.2.13-r0
1.2.13-r0
cacti
Alpine:v3.20
before 1.2.13-r0
1.2.13-r0
cacti
Alpine:v3.21
before 1.2.13-r0
1.2.13-r0
Show 28 moreShow less
Affected packages
PackageAffectedFixed
cacti
Alpine:v3.22
before 1.2.13-r0
1.2.13-r0
cacti
Alpine:v3.23
before 1.2.13-r0
1.2.13-r0
cacti
Alpine:v3.24
before 1.2.13-r0
1.2.13-r0
phpmailer
Bitnami
before 6.1.6
6.1.6
phpmailer/phpmailer
TuxCare:Packagist
From an advisory covering 3 CVEs
5.2.28 up to 5.2.28-p1+tuxcare
5.2.28-p1+tuxcare
libphp-phpmailer
Debian:12
before 6.1.6-1
6.1.6-1
libphp-phpmailer
Debian:13
before 6.1.6-1
6.1.6-1
libphp-phpmailer
Debian:14
before 6.1.6-1
6.1.6-1
libphp-phpmailer
Debian: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-phpmailer
Debian: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/phpmailer
Packagist
before 6.1.6, plus listed versions
v5.2.10v5.2.11v5.2.12v5.2.13v5.2.14
Show 40 moreShow less
v5.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-phpmailer
Mageia:7
before 6.1.6-1.mga7
6.1.6-1.mga7
libphp-phpmailer
Ubuntu: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-phpmailer
Ubuntu: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-phpmailer
Ubuntu: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-phpmailer
Ubuntu: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-phpmailer
Ubuntu: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-phpmailer
Ubuntu: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-phpmailer
Ubuntu: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
cacti
SUSE:Package Hub 12
From an advisory covering 4 CVEs
before 1.2.13-11.1
1.2.13-11.1
cacti-spine
SUSE:Package Hub 12
From an advisory covering 4 CVEs
before 1.2.13-8.1
1.2.13-8.1
cacti
openSUSE:Leap 15.1
From an advisory covering 4 CVEs
before 1.2.13-11.1
1.2.13-11.1
cacti-spine
openSUSE:Leap 15.1
From an advisory covering 4 CVEs
before 1.2.13-8.1
1.2.13-8.1
cacti
openSUSE:Leap 15.2
From an advisory covering 4 CVEs
before 1.2.13-11.1
1.2.13-11.1
cacti-spine
openSUSE:Leap 15.2
From an advisory covering 4 CVEs
before 1.2.13-8.1
1.2.13-8.1
cacti
SUSE: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-spine
SUSE: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
openSUSE:Tumbleweed
From an advisory covering 31 CVEs
before 1.2.18-1.2
1.2.18-1.2

History

History
RecordedChangedSources
affected, facts
affected, aliases, referencesOSV
aliasesEUVD
first indexedCVE 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

Show 61 moreShow less
MoveEnter Open