{"id":"CVE-2017-7692","url":"https://www.cyber-defence.io/tools/cve/CVE-2017-7692","generatedAt":"2026-10-28T20:47:07.127Z","title":"SquirrelMail 1.4.22 (and other versions before 20170427_0200-SVN) allows post-authentication remote code execution via a sendmail.cf file that is mishandled in a popen call.","description":"SquirrelMail 1.4.22 (and other versions before 20170427_0200-SVN) allows post-authentication remote code execution via a sendmail.cf file that is mishandled in a popen call. It's possible to exploit this vulnerability to execute arbitrary shell commands on the remote server. The problem is in the Deliver_SendMail.class.php with the initStream function that uses escapeshellcmd() to sanitize the sendmail command before executing it. The use of escapeshellcmd() is not correct in this case since it doesn't escape whitespaces, allowing the injection of arbitrary command parameters. The problem is in -f$envelopefrom within the sendmail command line. Hence, if the target server uses sendmail and SquirrelMail is configured to use it as a command-line program, it's possible to trick sendmail into using an attacker-provided configuration file that triggers the execution of an arbitrary command. For exploitation, the attacker must upload a sendmail.cf file as an email attachment, and inject the sendmail.cf filename with the -C option within the \"Options > Personal Informations > Email Address\" setting.","published":"2017-04-20T14:59:00.000Z","lastModified":"2026-06-17T01:25:00.000Z","status":"Modified","sourceIdentifier":"cve@mitre.org","cvss":{"version":"3.0","score":8.8,"severity":"HIGH","vector":"CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"},"cwe":["CWE-20"],"affected":["squirrelmail/squirrelmail"],"epss":{"score":0.32156,"percentile":0.98308,"date":"2026-10-27","history":[{"date":"2026-09-21","score":0.27775,"percentile":0.98053},{"date":"2026-09-22","score":0.32156,"percentile":0.9824}]},"kev":{"listed":false},"exploits":{"count":1,"verified":false,"firstPublished":"2017-04-23","source":"Exploit-DB (https://gitlab.com/exploit-database/exploitdb)","entries":[{"edbId":41910,"kind":"exploit","title":"SquirrelMail < 1.4.22 - Remote Code Execution","url":"https://www.exploit-db.com/exploits/41910","sourceUrl":"https://gitlab.com/exploit-database/exploitdb/-/blob/main/exploits/linux/remote/41910.sh","file":"exploits/linux/remote/41910.sh","published":"2017-04-23","added":"2017-04-23","updated":"2017-09-28","author":"Dawid Golunski","type":"remote","platform":"linux","port":null,"verified":false,"codes":["CVE-2017-7692"],"tags":null,"aliases":"SquirrelMail_RCE_exploit.sh","applicationUrl":null,"screenshotUrl":null,"referenceUrl":"https://legalhackers.com/advisories/SquirrelMail-Exploit-Remote-Code-Exec-CVE-2017-7692-Vuln.html"}]},"verdict":{"level":"urgent","text":"EPSS puts the probability of exploitation in the next 30 days at 32.2%, higher than 98% of all known CVEs. Patch or mitigate before the next change window."},"changes":[],"references":[{"url":"http://openwall.com/lists/oss-security/2017/04/19/6","tags":["Mailing List","Third Party Advisory"],"source":"cve@mitre.org"},{"url":"http://openwall.com/lists/oss-security/2017/04/27/1","source":"cve@mitre.org"},{"url":"http://www.debian.org/security/2017/dsa-3852","source":"cve@mitre.org"},{"url":"http://www.securityfocus.com/bid/98067","source":"cve@mitre.org"},{"url":"http://www.securitytracker.com/id/1038312","source":"cve@mitre.org"},{"url":"https://legalhackers.com/advisories/SquirrelMail-Exploit-Remote-Code-Exec-CVE-2017-7692-Vuln.html","tags":["Exploit","Third Party Advisory"],"source":"cve@mitre.org"},{"url":"https://security.gentoo.org/glsa/201709-13","source":"cve@mitre.org"},{"url":"https://www.exploit-db.com/exploits/41910/","source":"cve@mitre.org"},{"url":"http://openwall.com/lists/oss-security/2017/04/19/6","tags":["Mailing List","Third Party Advisory"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"http://openwall.com/lists/oss-security/2017/04/27/1","source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"http://www.debian.org/security/2017/dsa-3852","source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"http://www.securityfocus.com/bid/98067","source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"http://www.securitytracker.com/id/1038312","source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"https://legalhackers.com/advisories/SquirrelMail-Exploit-Remote-Code-Exec-CVE-2017-7692-Vuln.html","tags":["Exploit","Third Party Advisory"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"https://security.gentoo.org/glsa/201709-13","source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"https://www.exploit-db.com/exploits/41910/","source":"af854a3a-2127-422b-91ae-364da2661108"}],"sources":{"nvd":"https://nvd.nist.gov/vuln/detail/CVE-2017-7692","epss":"https://www.first.org/epss/","kev":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","exploitdb":"https://www.exploit-db.com/"},"licence":"CC BY 4.0 — link back to the CVE Explorer if you publish the results; upstream data remains subject to its own terms."}