CVE-2017-7692: Post-authenticated RCE in SquirrelMail Sendmail transport
- Vendor
- Squirrelmail
CVE-2017-7692 is a post-authentication remote code execution vulnerability in SquirrelMail affecting 1.4.22 and other versions before squirrelmail-20170427_0200-SVN.stable, including versions up to 1.4.23 as described in the provided content. The flaw is in Deliver_SendMail.class.php, specifically the initStream function, where SquirrelMail constructs a command line for the local Sendmail binary and incorrectly sanitizes attacker-controlled input with escapeshellcmd(). The vulnerable input is the envelope sender / Return-Path value derived from the user's configured email address, notably the -f$envelopefrom portion of the Sendmail command line. Because the sanitization is insufficient for this context and does not properly prevent argument injection via whitespace or tab characters, an authenticated user can inject additional Sendmail parameters. If the target deployment uses Sendmail as a command-line transport, the attacker can supply options such as -C to force Sendmail to load an attacker-controlled sendmail.cf file, which can then trigger arbitrary shell command execution on the server. The provided content also notes proof-of-concept exploitation by uploading a malicious sendmail.cf as an attachment, modifying the user's email address setting to inject Sendmail arguments, and then sending an email to trigger execution.
Impact, mitigation & remediation
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
Successful exploitation allows an authenticated attacker to execute arbitrary shell commands on the remote server in the security context of the web server or SquirrelMail process, with the provided content citing shell access as www-data in a proof-of-concept. This can lead to full compromise of the webmail application, unauthorized file creation or overwrite through injected Sendmail options, theft of mail and application data, installation of persistence mechanisms, pivoting to adjacent systems, and broader compromise of the underlying host depending on local privileges and environment.
Mitigation
If you can’t patch tonight, do this now.
If immediate patching is not possible, switch SquirrelMail from Sendmail command-line delivery to SMTP, which the provided content identifies as the recommended temporary workaround. More generally, disable use of local Sendmail invocation from SquirrelMail where feasible, restrict authenticated user ability to inject unsafe sender values, harden attachment handling and temporary file locations, and monitor for anomalous Sendmail invocations containing unexpected flags such as -C, -X, or -oQ. Limiting the privileges of the web server account and constraining execution with MAC controls can reduce post-exploitation impact but does not remove the underlying flaw.
Remediation
Patch, then assume compromise.
Upgrade SquirrelMail to a fixed release, specifically squirrelmail-20170427_0200-SVN.stable or later, as indicated in the provided content. Ensure the patch correcting the unsafe Sendmail command construction is applied across all affected installations. Review local packaging versions as downstream distributions may ship vulnerable builds even when labeled differently; the content specifically notes Ubuntu 16.04 package 2:1.4.23~svn20120406-2ubuntu1.16.04.1 as vulnerable. After patching, audit SquirrelMail configuration and user settings for maliciously modified email address values, inspect mail attachments and temporary storage for attacker-supplied sendmail.cf files, and review server logs and filesystem artifacts for evidence of exploitation.
Exploits
No validated public exploits yet. Hidden: 1 not yet analyzed, such as Exploit-DB entries.
Affected products & vendors
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
References
Frequently asked questions
- Is CVE-2017-7692 exploited in the wild?
- Yes. As of Oct 16, 2026, Mallory has reports of exploitation in the wild.
- Is there a public exploit for CVE-2017-7692?
- Yes. As of Oct 16, 2026, Mallory has reports of a public exploit for CVE-2017-7692.
- Is there a patch for CVE-2017-7692?
- Upgrade SquirrelMail to a fixed release, specifically squirrelmail-20170427_0200-SVN.stable or later, as indicated in the provided content. Ensure the patch correcting the unsafe Sendmail command construction is applied across all affected installations.
- What products are affected by CVE-2017-7692?
- Squirrelmail.
- How severe is CVE-2017-7692?
- CVE-2017-7692 has a CVSS v3 score of 8.8 (High) and an EPSS score of 32.2% (99th percentile) as of Oct 16, 2026.
Recent activity
4 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.