{"id":"CVE-2016-10045","aliases":["ALPINE-CVE-2016-10045","EUVD-2020-0327","GHSA-4pc3-96mx-wwc8","UBUNTU-CVE-2016-10045","USN-5956-1"],"status":"published","title":"Remote code execution in PHPMailer","description":"The isMail transport in PHPMailer before 5.2.20 might allow remote attackers to pass extra parameters to the mail command and consequently execute arbitrary code by leveraging improper interaction between the escapeshellarg function and internal escaping performed in the mail function in PHP. NOTE: this vulnerability exists because of an incorrect fix for CVE-2016-10033.","severity":{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"primary","from":"nvd"},"epss":{"day":"2026-11-08","score":0.97738,"percentile":0.99905,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":true,"fix_available":true},"cwes":["CWE-77"],"published":"2016-12-30T19:00:00Z","modified":"2026-10-24T10:46:11Z","exploits":[{"source":"metasploit","id":"exploit/multi/http/phpmailer_arg_injection","title":"PHPMailer Sendmail Argument Injection","type":"exploit","platform":"PHP","date":"2016-12-26","verified":true,"url":"https://www.rapid7.com/db/modules/exploit/multi/http/phpmailer_arg_injection"},{"source":"exploitdb","id":"EDB-40969","title":"PHPMailer \u003c 5.2.20 - Remote Code Execution","type":"webapps","platform":"php","date":"2016-12-27","url":"https://www.exploit-db.com/exploits/40969"},{"source":"exploitdb","id":"EDB-40986","title":"PHPMailer \u003c 5.2.20 / SwiftMailer \u003c 5.4.5-DEV / Zend Framework / zend-mail \u003c 2.4.11 - 'AIO' 'PwnScriptum' Remote Code Execution","type":"webapps","platform":"php","date":"2017-01-02","url":"https://www.exploit-db.com/exploits/40986"},{"source":"exploitdb","id":"EDB-42221","title":"PHPMailer \u003c 5.2.20 with Exim MTA - Remote Code Execution","type":"webapps","platform":"php","date":"2017-06-21","url":"https://www.exploit-db.com/exploits/42221"}],"fixes":[{"ecosystem":"Packagist","package":"phpmailer/phpmailer","fixed_in":["5.2.20"],"sources":["ghsa","osv"]},{"ecosystem":"Alpine:v3.2","package":"php-phpmailer","fixed_in":["5.2.4-r0"],"sources":["osv"]},{"ecosystem":"Alpine:v3.3","package":"php-phpmailer","fixed_in":["5.2.4-r0"],"sources":["osv"]},{"ecosystem":"Alpine:v3.4","package":"php5-phpmailer","fixed_in":["5.2.0-r1"],"sources":["osv"]},{"ecosystem":"Alpine:v3.5","package":"php5-phpmailer","fixed_in":["5.2.4-r1"],"sources":["osv"]},{"ecosystem":"Ubuntu:Pro:16.04:LTS","package":"libphp-phpmailer","fixed_in":["5.2.14+dfsg-1ubuntu0.1~esm1"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"Packagist","package":"phpmailer/phpmailer","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"5.0.0"},{"fixed":"5.2.20"}]}]},{"source":"osv","ecosystem":"Alpine:v3.2","package":"php-phpmailer","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.2.4-r0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.3","package":"php-phpmailer","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.2.4-r0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.4","package":"php5-phpmailer","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.2.0-r1"}]}]},{"source":"osv","ecosystem":"Alpine:v3.5","package":"php5-phpmailer","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.2.4-r1"}]}]},{"source":"osv","ecosystem":"Packagist","package":"phpmailer/phpmailer","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"5.0.0"},{"fixed":"5.2.20"}]}],"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.4","v5.2.5","v5.2.6","v5.2.7","v5.2.8","v5.2.9"]},{"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"]},{"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}],"products":[{"vendor":"joomla","product":"joomla\\!"},{"vendor":"phpmailer_project","product":"phpmailer"},{"vendor":"wordpress","product":"wordpress"}],"references":[{"url":"http://packetstormsecurity.com/files/140286/PHPMailer-Remote-Code-Execution.html","tags":["x_refsource_MISC","x_transferred","Exploit","Third Party Advisory","VDB Entry","evidence","web","report"]},{"url":"http://packetstormsecurity.com/files/140350/PHPMailer-Sendmail-Argument-Injection.html","tags":["x_refsource_MISC","x_transferred","Exploit","Third Party Advisory","VDB Entry","evidence","web"]},{"url":"https://www.exploit-db.com/exploits/42221/","tags":["exploit","x_refsource_EXPLOIT-DB","x_transferred","Third Party Advisory","VDB Entry","advisory"]},{"url":"https://www.exploit-db.com/exploits/40969/","tags":["exploit","x_refsource_EXPLOIT-DB","x_transferred","Exploit","Third Party Advisory","VDB Entry","evidence","report"]},{"url":"http://www.securityfocus.com/archive/1/539967/100/0/threaded","tags":["mailing-list","x_refsource_BUGTRAQ","x_transferred","Third Party Advisory","VDB Entry","advisory"]},{"url":"http://openwall.com/lists/oss-security/2016/12/28/1","tags":["mailing-list","x_refsource_MLIST","x_transferred","Mailing List","Patch","fix","web","report"]},{"url":"https://github.com/PHPMailer/PHPMailer/wiki/About-the-CVE-2016-10033-and-CVE-2016-10045-vulnerabilities","tags":["x_refsource_CONFIRM","x_transferred","Patch","Vendor Advisory","fix","web","report"]},{"url":"https://github.com/PHPMailer/PHPMailer/releases/tag/v5.2.20","tags":["x_refsource_CONFIRM","x_transferred","Patch","Vendor Advisory","fix","web","report"]},{"url":"https://www.exploit-db.com/exploits/40986/","tags":["exploit","x_refsource_EXPLOIT-DB","x_transferred","Third Party Advisory","VDB Entry","advisory"]},{"url":"http://www.rapid7.com/db/modules/exploit/multi/http/phpmailer_arg_injection","tags":["x_refsource_MISC","x_transferred","Exploit","Third Party Advisory","evidence","web"]},{"url":"http://www.securityfocus.com/bid/95130","tags":["vdb-entry","x_refsource_BID","x_transferred","Exploit","Third Party Advisory","VDB Entry","evidence"]},{"url":"https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10045-Vuln-Patch-Bypass.html","tags":["x_refsource_MISC","x_transferred","Exploit","Patch","Third Party Advisory","fix","web","report"]},{"url":"http://seclists.org/fulldisclosure/2016/Dec/81","tags":["mailing-list","x_refsource_FULLDISC","x_transferred","Mailing List","Patch","Third Party Advisory","fix","web","report"]},{"url":"http://www.securitytracker.com/id/1037533","tags":["vdb-entry","x_refsource_SECTRACK","x_transferred","Third Party Advisory","VDB Entry","advisory"]},{"url":"https://developer.joomla.org/security-centre/668-20161205-phpmailer-security-advisory.html","tags":["x_refsource_CONFIRM","x_transferred","Third Party Advisory","advisory","web","report"]},{"url":"https://github.com/PHPMailer/PHPMailer/security/advisories/GHSA-4pc3-96mx-wwc8","tags":["web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2016-10045","tags":["advisory"]},{"url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/phpmailer/phpmailer/CVE-2016-10045.yaml","tags":["web"]},{"url":"https://www.exploit-db.com/exploits/40969","tags":["web"]},{"url":"https://www.exploit-db.com/exploits/40986","tags":["web"]},{"url":"https://www.exploit-db.com/exploits/42221","tags":["web"]},{"url":"https://github.com/advisories/GHSA-4pc3-96mx-wwc8"},{"url":"https://security.alpinelinux.org/vuln/CVE-2016-10045","tags":["advisory"]},{"url":"https://github.com/PHPMailer/PHPMailer","tags":["package"]},{"url":"https://ubuntu.com/security/CVE-2016-10045","tags":["report"]},{"url":"https://ubuntu.com/security/notices/USN-5956-1","tags":["advisory"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2016-10045","tags":["report"]},{"url":"https://ubuntu.com/security/CVE-2016-10033","tags":["report"]},{"url":"https://ubuntu.com/security/CVE-2017-5223","tags":["report"]},{"url":"https://ubuntu.com/security/CVE-2017-11503","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-2016-10045","description":"The isMail transport in PHPMailer before 5.2.20 might allow remote attackers to pass extra parameters to the mail command and consequently execute arbitrary code by leveraging improper interaction between the escapeshellarg function and internal escaping performed in the mail function in PHP. NOTE: this vulnerability exists because of an incorrect fix for CVE-2016-10033.","status":"published","published":"2016-12-30T19:00:00Z","modified":"2024-08-06T03:07:32.139Z","updated_at":"2026-11-02T14:33:31.764001Z"}],"euvd":[{"id":"EUVD-2020-0327","description":"The isMail transport in PHPMailer before 5.2.20 might allow remote attackers to pass extra parameters to the mail command and consequently execute arbitrary code by leveraging improper interaction between the escapeshellarg function and internal escaping performed in the mail function in PHP. NOTE: this vulnerability exists because of an incorrect fix for CVE-2016-10033.","status":"published","published":"2016-12-30T19:00:00Z","modified":"2024-08-06T03:07:32Z","updated_at":"2026-11-03T02:22:25.285099Z"}],"ghsa":[{"id":"GHSA-4pc3-96mx-wwc8","title":"Remote code execution in PHPMailer","description":"### Impact\nThe `isMail` transport in PHPMailer before 5.2.20 might allow remote attackers to pass extra parameters to the `mail` command and consequently execute arbitrary code by leveraging improper interaction between the `escapeshellarg` function and internal escaping performed in the mail function in PHP. NOTE: this vulnerability exists because of an incorrect fix for CVE-2016-10033.\n\nThis issue really emphasises that it\u0026#39;s worth avoiding the built-in PHP `mail()` function entirely.\n\n### Patches\nFixed in 5.2.20\n\n### Workarounds\nSend via SMTP to localhost instead of calling the `mail()` function.\n\n### References\nhttps://nvd.nist.gov/vuln/detail/CVE-2016-10045\nSee also https://nvd.nist.gov/vuln/detail/CVE-2016-10033\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:14Z","modified":"2025-04-14T22:05:58Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-77"],"updated_at":"2026-11-02T14:38:39.85223Z"}],"nvd":[{"id":"CVE-2016-10045","description":"The isMail transport in PHPMailer before 5.2.20 might allow remote attackers to pass extra parameters to the mail command and consequently execute arbitrary code by leveraging improper interaction between the escapeshellarg function and internal escaping performed in the mail function in PHP. NOTE: this vulnerability exists because of an incorrect fix for CVE-2016-10033.","status":"published","published":"2016-12-30T19:59:00.247Z","modified":"2026-06-17T00:38:57.007Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"primary"},{"version":"2.0","score":7.5,"vector":"AV:N/AC:L/Au:N/C:P/I:P/A:P","level":"high","assessor":"primary"}],"cwes":["CWE-77"],"updated_at":"2026-11-02T14:03:33.686843Z"}],"osv":[{"id":"ALPINE-CVE-2016-10045","description":"The isMail transport in PHPMailer before 5.2.20 might allow remote attackers to pass extra parameters to the mail command and consequently execute arbitrary code by leveraging improper interaction between the escapeshellarg function and internal escaping performed in the mail function in PHP. NOTE: this vulnerability exists because of an incorrect fix for CVE-2016-10033.","status":"published","published":"2016-12-30T19:59:00.247Z","modified":"2026-09-22T06:30:06.019872414Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"updated_at":"2026-11-02T15:27:46.318571Z"},{"id":"CVE-2016-10045","description":"The isMail transport in PHPMailer before 5.2.20 might allow remote attackers to pass extra parameters to the mail command and consequently execute arbitrary code by leveraging improper interaction between the escapeshellarg function and internal escaping performed in the mail function in PHP. NOTE: this vulnerability exists because of an incorrect fix for CVE-2016-10033.","status":"published","published":"2016-12-30T19:59:00.247Z","modified":"2026-10-24T10:46:11.941042302Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"updated_at":"2026-11-02T15:44:01.531338Z"},{"id":"GHSA-4pc3-96mx-wwc8","title":"Remote code execution in PHPMailer","description":"### Impact\nThe `isMail` transport in PHPMailer before 5.2.20 might allow remote attackers to pass extra parameters to the `mail` command and consequently execute arbitrary code by leveraging improper interaction between the `escapeshellarg` function and internal escaping performed in the mail function in PHP. NOTE: this vulnerability exists because of an incorrect fix for CVE-2016-10033.\n\nThis issue really emphasises that it\u0026#39;s worth avoiding the built-in PHP `mail()` function entirely.\n\n### Patches\nFixed in 5.2.20\n\n### Workarounds\nSend via SMTP to localhost instead of calling the `mail()` function.\n\n### References\nhttps://nvd.nist.gov/vuln/detail/CVE-2016-10045\nSee also https://nvd.nist.gov/vuln/detail/CVE-2016-10033\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:14Z","modified":"2025-04-14T22:27:44.787084Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-77"],"updated_at":"2026-11-02T15:46:37.148947Z"},{"id":"UBUNTU-CVE-2016-10045","description":"The isMail transport in PHPMailer before 5.2.20 might allow remote attackers to pass extra parameters to the mail command and consequently execute arbitrary code by leveraging improper interaction between the escapeshellarg function and internal escaping performed in the mail function in PHP. NOTE: this vulnerability exists because of an incorrect fix for CVE-2016-10033.","status":"published","published":"2016-12-30T19:59:00Z","modified":"2026-02-04T02:51:08.744657Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"},{"version":"3.0","score":9.8,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"updated_at":"2026-11-02T15:54:11.100633Z"},{"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"}]}}
