{"id":"CVE-2017-11503","aliases":["DEBIAN-CVE-2017-11503","EUVD-2020-0330","GHSA-58mj-pw57-4vm2","MGASA-2017-0257","UBUNTU-CVE-2017-11503","USN-5956-1","USN-5956-2"],"status":"published","title":"Cross-site scripting in PHPMailer","description":"PHPMailer 5.2.23 has XSS in the \"From Email Address\" and \"To Email Address\" fields of code_generator.php.","severity":{"version":"3.0","score":6.1,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium","assessor":"primary","from":"nvd"},"epss":{"day":"2026-11-07","score":0.024,"percentile":0.84123,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":true,"fix_available":true},"cwes":["CWE-79"],"published":"2017-07-20T23:00:00Z","modified":"2026-10-20T10:47:41Z","exploits":[{"source":"pocgithub","id":"wizardafric/download","title":"wizardafric/download","date":"2018-03-26","url":"https://github.com/wizardafric/download"}],"fixes":[{"ecosystem":"Packagist","package":"phpmailer/phpmailer","fixed_in":["5.2.24"],"sources":["ghsa","osv"]},{"ecosystem":"Debian:12","package":"libphp-phpmailer","fixed_in":["6.0.6-0.1"],"sources":["osv"]},{"ecosystem":"Debian:13","package":"libphp-phpmailer","fixed_in":["6.0.6-0.1"],"sources":["osv"]},{"ecosystem":"Debian:14","package":"libphp-phpmailer","fixed_in":["6.0.6-0.1"],"sources":["osv"]},{"ecosystem":"Mageia:5","package":"php-phpmailer","fixed_in":["5.2.24-1.mga5"],"sources":["osv"]},{"ecosystem":"Mageia:6","package":"php-phpmailer","fixed_in":["5.2.24-1.mga6"],"sources":["osv"]},{"ecosystem":"Ubuntu:Pro:16.04:LTS","package":"libphp-phpmailer","fixed_in":["5.2.14+dfsg-1ubuntu0.1~esm2"],"sources":["osv"]},{"ecosystem":"Ubuntu:Pro:18.04:LTS","package":"libphp-phpmailer","fixed_in":["5.2.14+dfsg-2.3+deb9u2ubuntu0.1~esm2"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"Packagist","package":"phpmailer/phpmailer","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"5.0.0"},{"fixed":"5.2.24"}]}]},{"source":"osv","ecosystem":"Debian:12","package":"libphp-phpmailer","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"6.0.6-0.1"}]}]},{"source":"osv","ecosystem":"Debian:13","package":"libphp-phpmailer","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"6.0.6-0.1"}]}]},{"source":"osv","ecosystem":"Debian:14","package":"libphp-phpmailer","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"6.0.6-0.1"}]}]},{"source":"osv","ecosystem":"Packagist","package":"phpmailer/phpmailer","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"5.0.0"},{"fixed":"5.2.24"}]}],"versions":["v5.2.10","v5.2.11","v5.2.12","v5.2.13","v5.2.14","v5.2.15","v5.2.16","v5.2.17","v5.2.18","v5.2.19","v5.2.2","v5.2.20","v5.2.21","v5.2.22","v5.2.23","v5.2.4","v5.2.5","v5.2.6","v5.2.7","v5.2.8","v5.2.9"]},{"source":"osv","ecosystem":"Mageia:5","package":"php-phpmailer","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.2.24-1.mga5"}]}]},{"source":"osv","ecosystem":"Mageia:6","package":"php-phpmailer","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.2.24-1.mga6"}]}]},{"source":"osv","ecosystem":"Ubuntu:Pro:16.04:LTS","package":"libphp-phpmailer","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.2.14+dfsg-1ubuntu0.1~esm2"}]}],"versions":["5.2.10+dfsg-1","5.2.14+dfsg-1","5.2.14+dfsg-1build1","5.2.14+dfsg-1ubuntu0.1~esm1"]},{"source":"osv","ecosystem":"Ubuntu:Pro:18.04:LTS","package":"libphp-phpmailer","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.2.14+dfsg-2.3+deb9u2ubuntu0.1~esm2"}]}],"versions":["5.2.14+dfsg-2.3","5.2.14+dfsg-2.3+deb9u1build0.18.04.1","5.2.14+dfsg-2.3+deb9u2build0.18.04.1","5.2.14+dfsg-2.3+deb9u2ubuntu0.1~esm1"]},{"source":"osv","ecosystem":"Ubuntu:Pro:16.04:LTS","package":"libphp-phpmailer","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.2.14+dfsg-1ubuntu0.1~esm1"}]}],"versions":["5.2.10+dfsg-1","5.2.14+dfsg-1","5.2.14+dfsg-1build1"],"bundled":7},{"source":"osv","ecosystem":"Ubuntu:Pro:18.04:LTS","package":"libphp-phpmailer","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.2.14+dfsg-2.3+deb9u2ubuntu0.1~esm1"}]}],"versions":["5.2.14+dfsg-2.3","5.2.14+dfsg-2.3+deb9u1build0.18.04.1","5.2.14+dfsg-2.3+deb9u2build0.18.04.1"],"bundled":7},{"source":"osv","ecosystem":"Ubuntu:Pro:20.04:LTS","package":"libphp-phpmailer","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"6.0.6-0.1ubuntu0.1~esm1"}]}],"versions":["6.0.6-0.1"],"bundled":7},{"source":"osv","ecosystem":"Ubuntu:Pro:22.04:LTS","package":"libphp-phpmailer","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"6.2.0-2ubuntu0.1~esm1"}]}],"versions":["6.2.0-2"],"bundled":7},{"source":"osv","ecosystem":"Ubuntu:Pro:16.04:LTS","package":"libphp-phpmailer","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.2.14+dfsg-1ubuntu0.1~esm2"}]}],"versions":["5.2.10+dfsg-1","5.2.14+dfsg-1","5.2.14+dfsg-1build1","5.2.14+dfsg-1ubuntu0.1~esm1"]},{"source":"osv","ecosystem":"Ubuntu:Pro:18.04:LTS","package":"libphp-phpmailer","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.2.14+dfsg-2.3+deb9u2ubuntu0.1~esm2"}]}],"versions":["5.2.14+dfsg-2.3","5.2.14+dfsg-2.3+deb9u1build0.18.04.1","5.2.14+dfsg-2.3+deb9u2build0.18.04.1","5.2.14+dfsg-2.3+deb9u2ubuntu0.1~esm1"]}],"products":[{"vendor":"phpmailer_project","product":"phpmailer"}],"references":[{"url":"http://www.securityfocus.com/bid/99293/","tags":["vdb-entry","x_refsource_BID","x_transferred","Third Party Advisory","VDB Entry","advisory"]},{"url":"https://packetstormsecurity.com/files/143138/phpmailer-xss.txt","tags":["x_refsource_MISC","x_transferred","Exploit","Third Party Advisory","VDB Entry","evidence","web","report"]},{"url":"https://cxsecurity.com/issue/WLB-2017060181","tags":["x_refsource_MISC","x_transferred","Exploit","Third Party Advisory","evidence","web","report"]},{"url":"http://www.securitytracker.com/id/1039026","tags":["vdb-entry","x_refsource_SECTRACK","x_transferred","Third Party Advisory","VDB Entry","advisory","web"]},{"url":"https://github.com/PHPMailer/PHPMailer/security/advisories/GHSA-58mj-pw57-4vm2","tags":["web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2017-11503","tags":["advisory"]},{"url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/phpmailer/phpmailer/CVE-2017-11503.yaml","tags":["web"]},{"url":"https://github.com/PHPMailer/PHPMailer/releases/tag/v5.2.24","tags":["Patch","Release Notes","Third Party Advisory","fix","web"]},{"url":"https://github.com/advisories/GHSA-58mj-pw57-4vm2"},{"url":"https://github.com/PHPMailer/PHPMailer","tags":["Product","package"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2017-11503","tags":["advisory"]},{"url":"http://www.securityfocus.com/bid/99293","tags":["web"]},{"url":"https://advisories.mageia.org/MGASA-2017-0257.html","tags":["advisory"]},{"url":"https://bugs.mageia.org/show_bug.cgi?id=21398","tags":["report"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/thread/545FEK4BT73LWYBXC2P7MQYBELWVG257/","tags":["web"]},{"url":"https://ubuntu.com/security/CVE-2017-11503","tags":["report"]},{"url":"https://ubuntu.com/security/notices/USN-5956-1","tags":["advisory"]},{"url":"https://ubuntu.com/security/notices/USN-5956-2","tags":["advisory"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2017-11503","tags":["report"]},{"url":"https://ubuntu.com/security/CVE-2016-10033","tags":["report"]},{"url":"https://ubuntu.com/security/CVE-2016-10045","tags":["report"]},{"url":"https://ubuntu.com/security/CVE-2017-5223","tags":["report"]},{"url":"https://ubuntu.com/security/CVE-2018-19296","tags":["report"]},{"url":"https://ubuntu.com/security/CVE-2020-13625","tags":["report"]},{"url":"https://ubuntu.com/security/CVE-2021-3603","tags":["report"]}],"sources":{"cve":[{"id":"CVE-2017-11503","description":"PHPMailer 5.2.23 has XSS in the \"From Email Address\" and \"To Email Address\" fields of code_generator.php.","status":"published","published":"2017-07-20T23:00:00Z","modified":"2024-08-05T18:12:40.168Z","updated_at":"2026-11-02T14:33:20.171335Z"}],"euvd":[{"id":"EUVD-2020-0330","description":"PHPMailer 5.2.23 has XSS in the \"From Email Address\" and \"To Email Address\" fields of code_generator.php.","status":"published","published":"2017-07-20T23:00:00Z","modified":"2024-08-05T18:12:40Z","updated_at":"2026-11-03T02:23:22.6605Z"}],"ghsa":[{"id":"GHSA-58mj-pw57-4vm2","title":"Cross-site scripting in PHPMailer","description":"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.\n\n### Impact\nPHPMailer 5.2.23 has XSS in the \u0026quot;From Email Address\u0026quot; and \u0026quot;To Email Address\u0026quot; fields of code_generator.php.\n\n### Patches\nFixed in 5.2.24\n\n### Workarounds\nNone.\n\n### References\nhttps://nvd.nist.gov/vuln/detail/CVE-2017-11503\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open a private issue in [the PHPMailer project](https://github.com/PHPMailer/PHPMailer)","status":"published","published":"2020-03-05T22:09:13Z","modified":"2023-01-09T05:02:21Z","cvss":[{"version":"3.0","score":6.1,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T14:36:03.040255Z"}],"nvd":[{"id":"CVE-2017-11503","description":"PHPMailer 5.2.23 has XSS in the \"From Email Address\" and \"To Email Address\" fields of code_generator.php.","status":"published","published":"2017-07-20T23:29:00.31Z","modified":"2026-06-17T01:01:54.473Z","cvss":[{"version":"3.0","score":6.1,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium","assessor":"primary"},{"version":"2.0","score":4.3,"vector":"AV:N/AC:M/Au:N/C:N/I:P/A:N","level":"medium","assessor":"primary"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T14:03:54.862898Z"}],"osv":[{"id":"CVE-2017-11503","description":"PHPMailer 5.2.23 has XSS in the \"From Email Address\" and \"To Email Address\" fields of code_generator.php.","status":"published","published":"2017-07-20T23:29:00.31Z","modified":"2026-10-20T10:47:41.514472403Z","cvss":[{"version":"3.0","score":6.1,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium"}],"updated_at":"2026-11-02T15:44:03.851821Z"},{"id":"DEBIAN-CVE-2017-11503","description":"PHPMailer 5.2.23 has XSS in the \"From Email Address\" and \"To Email Address\" fields of code_generator.php.","status":"published","published":"2017-07-20T23:29:00.31Z","modified":"2026-09-01T20:03:41.186428885Z","cvss":[{"version":"3.0","score":6.1,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium"}],"updated_at":"2026-11-02T15:45:28.50097Z"},{"id":"GHSA-58mj-pw57-4vm2","title":"Cross-site scripting in PHPMailer","description":"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.\n\n### Impact\nPHPMailer 5.2.23 has XSS in the \u0026quot;From Email Address\u0026quot; and \u0026quot;To Email Address\u0026quot; fields of code_generator.php.\n\n### Patches\nFixed in 5.2.24\n\n### Workarounds\nNone.\n\n### References\nhttps://nvd.nist.gov/vuln/detail/CVE-2017-11503\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open a private issue in [the PHPMailer project](https://github.com/PHPMailer/PHPMailer)","status":"published","published":"2020-03-05T22:09:13Z","modified":"2024-02-16T08:24:37.079984Z","cvss":[{"version":"3.0","score":6.1,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T15:46:38.213481Z"},{"id":"UBUNTU-CVE-2017-11503","description":"PHPMailer 5.2.23 has XSS in the \"From Email Address\" and \"To Email Address\" fields of code_generator.php.","status":"published","published":"2017-07-20T23:29:00Z","modified":"2026-02-04T04:26:00.673679Z","cvss":[{"version":"3.0","score":6.1,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium"}],"updated_at":"2026-11-02T15:54:13.729565Z"},{"id":"MGASA-2017-0257","title":"Updated php-phpmailer packages fix security vulnerability","description":"It was discovered that php-phpmailer has a XSS vulnerability in the\n\"From Email Address\" and \"To Email Address\" fields of\ncode_generator.php (CVE-2017-11503).\n","status":"published","published":"2017-08-13T13:17:41Z","modified":"2026-04-16T06:23:44.435257207Z","updated_at":"2026-11-02T15:49:40.103088Z"},{"id":"USN-5956-1","title":"libphp-phpmailer vulnerabilities","description":"Dawid Golunski discovered that PHPMailer was not properly escaping user\ninput data used as arguments to functions executed by the system shell. An\nattacker could possibly use this issue to execute arbitrary code. This\nissue only affected Ubuntu 16.04 ESM. (CVE-2016-10033, CVE-2016-10045)\n\nIt was discovered that PHPMailer was not properly escaping characters\nin certain fields of the code_generator.php example code. An attacker\ncould possibly use this issue to conduct cross-site scripting (XSS)\nattacks. This issue was only fixed in Ubuntu 16.04 ESM and Ubuntu 18.04\nESM. (CVE-2017-11503)\n\nYongxiang Li discovered that PHPMailer was not properly converting\nrelative paths provided as user input when adding attachments to messages,\nwhich could lead to relative image URLs being treated as absolute local\nfile paths and added as attachments. An attacker could possibly use this\nissue to access unauthorized resources and expose sensitive information.\nThis issue only affected Ubuntu 16.04 ESM. (CVE-2017-5223)\n\nSehun Oh discovered that PHPMailer was not properly processing untrusted\nnon-local file attachments, which could lead to an object injection. An\nattacker could possibly use this issue to execute arbitrary code. This\nissue only affected Ubuntu 16.04 ESM. (CVE-2018-19296)\n\nElar Lang discovered that PHPMailer was not properly escaping file\nattachment names, which could lead to a misinterpretation of file types\nby entities processing the message. An attacker could possibly use this\nissue to bypass attachment filters. This issue was only fixed in Ubuntu\n16.04 ESM and Ubuntu 20.04 ESM. (CVE-2020-13625)\n\nIt was discovered that PHPMailer was not properly handling callables in\nits validateAddress function, which could result in untrusted code being\ncalled should the global namespace contain a function called 'php'. An\nattacker could possibly use this issue to execute arbitrary code. This\nissue was only fixed in Ubuntu 20.04 ESM and Ubuntu 22.04 ESM.\n(CVE-2021-3603)\n","status":"published","published":"2023-03-15T14:33:12Z","modified":"2026-06-25T13:31:53.33751944Z","updated_at":"2026-11-02T16:58:16.738762Z"},{"id":"USN-5956-2","title":"libphp-phpmailer vulnerability","description":"USN-5956-1 fixed vulnerabilities in PHPMailer. It was discovered that the\nfix for CVE-2017-11503 was incomplete. This update fixes the problem.\n\nOriginal advisory details:\n\n Dawid Golunski discovered that PHPMailer was not properly escaping user\n input data used as arguments to functions executed by the system shell. An\n attacker could possibly use this issue to execute arbitrary code. This\n issue only affected Ubuntu 16.04 ESM. (CVE-2016-10033, CVE-2016-10045)\n \n It was discovered that PHPMailer was not properly escaping characters\n in certain fields of the code_generator.php example code. An attacker\n could possibly use this issue to conduct cross-site scripting (XSS)\n attacks. This issue was only fixed in Ubuntu 16.04 ESM and Ubuntu 18.04\n ESM. (CVE-2017-11503)\n \n Yongxiang Li discovered that PHPMailer was not properly converting\n relative paths provided as user input when adding attachments to messages,\n which could lead to relative image URLs being treated as absolute local\n file paths and added as attachments. An attacker could possibly use this\n issue to access unauthorized resources and expose sensitive information.\n This issue only affected Ubuntu 16.04 ESM. (CVE-2017-5223)\n \n Sehun Oh discovered that PHPMailer was not properly processing untrusted\n non-local file attachments, which could lead to an object injection. An\n attacker could possibly use this issue to execute arbitrary code. This\n issue only affected Ubuntu 16.04 ESM. (CVE-2018-19296)\n \n Elar Lang discovered that PHPMailer was not properly escaping file\n attachment names, which could lead to a misinterpretation of file types\n by entities processing the message. An attacker could possibly use this\n issue to bypass attachment filters. This issue was only fixed in Ubuntu\n 16.04 ESM and Ubuntu 20.04 ESM. (CVE-2020-13625)\n \n It was discovered that PHPMailer was not properly handling callables in\n its validateAddress function, which could result in untrusted code being\n called should the global namespace contain a function called 'php'. An\n attacker could possibly use this issue to execute arbitrary code. This\n issue was only fixed in Ubuntu 20.04 ESM and Ubuntu 22.04 ESM.\n (CVE-2021-3603)\n","status":"published","published":"2023-03-15T19:58:32Z","modified":"2026-06-25T13:31:53.869673051Z","updated_at":"2026-11-02T16:58:16.738762Z"}]}}
