CVE-2017-11503
Cross-site scripting in PHPMailer
PHPMailer 5.2.23 has XSS in the "From Email Address" and "To Email Address" fields of code_generator.php.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- Required
What an attacker can affect
- Confidentiality
- Low
- Integrity
- Low
- Availability
- None
Exploit likelihood
What each source reports
NVD Score used
6.1
PHPMailer 5.2.23 has XSS in the "From Email Address" and "To Email Address" fields of code_generator.php.
- Record
CVE-2017-11503- CVSS 3.0
- 6.1 Medium
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N - CVSS 2.0
- 4.3 Medium
AV:N/AC:M/Au:N/C:N/I:P/A:N - Weakness
- CWE-79
- Updated
- 2026-11-02
CVE List No score
PHPMailer 5.2.23 has XSS in the "From Email Address" and "To Email Address" fields of code_generator.php.
- Record
CVE-2017-11503- Updated
- 2026-11-02
EUVDEUVD-2020-0330 No score
PHPMailer 5.2.23 has XSS in the "From Email Address" and "To Email Address" fields of code_generator.php.
- Record
EUVD-2020-0330- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-58mj-pw57-4vm2
6.1
Cross-site scripting in PHPMailer
PHPMailer versions prior to 5.2.24 (released July 26th 2017) have an XSS vulnerability in one of the code examples, CVE-2017-11503. The code_generator.phps example did not filter user input prior to output. This file is distributed with a .phps extension, so it it not normally executable unless it is explicitly renamed, and the file is not included when PHPMailer is loaded through composer, so it is safe by default. There was also an undisclosed potential XSS vulnerability in the default exception handler (unused by default). Patches for both issues kindly provided by Patrick Monnerat of the Fedora Project.
Impact
PHPMailer 5.2.23 has XSS in the "From Email Address" and "To Email Address" fields of code_generator.php.
Patches
Fixed in 5.2.24
Workarounds
None.
References
https://nvd.nist.gov/vuln/detail/CVE-2017-11503
For more information
If you have any questions or comments about this advisory:
- Open a private issue in the PHPMailer project
- Record
GHSA-58mj-pw57-4vm2- CVSS 3.0
- 6.1 Medium
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N - Weakness
- CWE-79
- Updated
- 2026-11-02
OSV
6.1
PHPMailer 5.2.23 has XSS in the "From Email Address" and "To Email Address" fields of code_generator.php.
- Record
CVE-2017-11503- CVSS 3.0
- 6.1 Medium
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N - Updated
- 2026-11-02
OSVDEBIAN-CVE-2017-11503
6.1
PHPMailer 5.2.23 has XSS in the "From Email Address" and "To Email Address" fields of code_generator.php.
- Record
DEBIAN-CVE-2017-11503- CVSS 3.0
- 6.1 Medium
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N - Updated
- 2026-11-02
Show 5 moreShow less
OSVGHSA-58mj-pw57-4vm2
6.1
Cross-site scripting in PHPMailer
PHPMailer versions prior to 5.2.24 (released July 26th 2017) have an XSS vulnerability in one of the code examples, CVE-2017-11503. The code_generator.phps example did not filter user input prior to output. This file is distributed with a .phps extension, so it it not normally executable unless it is explicitly renamed, and the file is not included when PHPMailer is loaded through composer, so it is safe by default. There was also an undisclosed potential XSS vulnerability in the default exception handler (unused by default). Patches for both issues kindly provided by Patrick Monnerat of the Fedora Project.
Impact
PHPMailer 5.2.23 has XSS in the "From Email Address" and "To Email Address" fields of code_generator.php.
Patches
Fixed in 5.2.24
Workarounds
None.
References
https://nvd.nist.gov/vuln/detail/CVE-2017-11503
For more information
If you have any questions or comments about this advisory:
- Open a private issue in the PHPMailer project
- Record
GHSA-58mj-pw57-4vm2- CVSS 3.0
- 6.1 Medium
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N - Weakness
- CWE-79
- Updated
- 2026-11-02
OSVUBUNTU-CVE-2017-11503
6.1
PHPMailer 5.2.23 has XSS in the "From Email Address" and "To Email Address" fields of code_generator.php.
- Record
UBUNTU-CVE-2017-11503- CVSS 3.0
- 6.1 Medium
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N - Updated
- 2026-11-02
OSVMGASA-2017-0257 No score
Updated php-phpmailer packages fix security vulnerability
It was discovered that php-phpmailer has a XSS vulnerability in the "From Email Address" and "To Email Address" fields of code_generator.php (CVE-2017-11503).
- Record
MGASA-2017-0257- 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
OSVUSN-5956-2 No score
libphp-phpmailer vulnerability
USN-5956-1 fixed vulnerabilities in PHPMailer. It was discovered that the fix for CVE-2017-11503 was incomplete. This update fixes the problem.
Original advisory details:
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-2- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
phpmailer/phpmailerPackagist |
5.0.0 up to 5.2.24 | 5.2.24 |
libphp-phpmailerDebian:12 |
before 6.0.6-0.1 | 6.0.6-0.1 |
libphp-phpmailerDebian:13 |
before 6.0.6-0.1 | 6.0.6-0.1 |
libphp-phpmailerDebian:14 |
before 6.0.6-0.1 | 6.0.6-0.1 |
phpmailer/phpmailerPackagist |
5.0.0 up to 5.2.24, plus listed versions v5.2.10v5.2.11v5.2.12v5.2.13v5.2.14 Show 16 moreShow lessv5.2.15v5.2.16v5.2.17v5.2.18v5.2.19v5.2.2v5.2.20v5.2.21v5.2.22v5.2.23v5.2.4v5.2.5v5.2.6v5.2.7v5.2.8v5.2.9 |
5.2.24 |
php-phpmailerMageia:5 |
before 5.2.24-1.mga5 | 5.2.24-1.mga5 |
php-phpmailerMageia:6 |
before 5.2.24-1.mga6 | 5.2.24-1.mga6 |
libphp-phpmailerUbuntu:Pro:16.04:LTS |
before 5.2.14+dfsg-1ubuntu0.1~esm2, plus listed versions 5.2.10+dfsg-15.2.14+dfsg-15.2.14+dfsg-1build15.2.14+dfsg-1ubuntu0.1~esm1 |
5.2.14+dfsg-1ubuntu0.1~esm2 |
libphp-phpmailerUbuntu:Pro:18.04:LTS |
before 5.2.14+dfsg-2.3+deb9u2ubuntu0.1~esm2, 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.15.2.14+dfsg-2.3+deb9u2ubuntu0.1~esm1 |
5.2.14+dfsg-2.3+deb9u2ubuntu0.1~esm2 |
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 |
Public exploits
Links only. Every CVE stores no exploit code.
| Source | Link | Date |
|---|---|---|
| PoC in GitHub | wizardafric/download | 2018-03-26 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | ||
| aliases | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV, PoC in GitHub |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2017-11503 is a medium vulnerability (CVSS 6.1) in Phpmailer Project Phpmailer, published July 20, 2017. Public exploit code exists. EPSS puts the chance of exploitation in the next 30 days at 2.40%, the 84th percentile. Fixed in phpmailer/phpmailer 5.2.24.
References
securityfocus.com/bid/99293
packetstormsecurity.com/files/143138/phpmailer-xss.txt
cxsecurity.com/issue/WLB-2017060181
securitytracker.com/id/1039026
github.com/PHPMailer/PHPMailer/security/advisories/GHSA-58mj-pw57-4vm2
nvd.nist.gov/vuln/detail/CVE-2017-11503
Show 18 moreShow less
github.com/FriendsOfPHP/security-advisories/blob/master/phpmailer/phpmailer/CVE-2017-11503.yaml
github.com/PHPMailer/PHPMailer/releases/tag/v5.2.24
github.com/advisories/GHSA-58mj-pw57-4vm2
github.com/PHPMailer/PHPMailer
security-tracker.debian.org/tracker/CVE-2017-11503
advisories.mageia.org/MGASA-2017-0257.html
bugs.mageia.org/show_bug.cgi?id=21398
lists.fedoraproject.org/archives/list/[email protected]/thread/545FEK4BT73LWYBXC2P7MQYBELWVG257
ubuntu.com/security/CVE-2017-11503
ubuntu.com/security/notices/USN-5956-1
ubuntu.com/security/notices/USN-5956-2
cve.org/CVERecord?id=CVE-2017-11503
ubuntu.com/security/CVE-2016-10033
ubuntu.com/security/CVE-2016-10045
ubuntu.com/security/CVE-2017-5223
ubuntu.com/security/CVE-2018-19296
ubuntu.com/security/CVE-2020-13625
ubuntu.com/security/CVE-2021-3603