A critical zero-day vulnerability in all versions of Exim mail transfer agent (MTA) software can let unauthenticated attackers gain remote code execution (RCE) on Internet-exposed servers.
Found by an anonymous security researcher and disclosed through Trend Micro's Zero Day Initiative (ZDI), the security bug (CVE-2023-42115) is due to an Out-of-bounds Write weakness found in the SMTP service.
While this type of issue can lead to software crashes or corruption of data following successful exploitation, it can also be abused by attackers for code or command execution on vulnerable servers.
"The specific flaw exists within the smtp service, which listens on TCP port 25 by default," a ZDI security advisory published on Wednesday explains.
"The issue results from the lack of proper validation of user-supplied data, which can result in a write past the end of a buffer. An attacker can leverage this vulnerability to execute code in the context of the service account."
While ZDI reported the vulnerability to the Exim team in June 2022 and resent info on the flaw at the vendor's request in May 2023, the developers failed to provide an update on their patch progress.
As a result, ZDI published an advisory on September 27, with details on the CVE-2023-42115 zero-day and a full timeline of all exchanges with the Exim team.
Millions of servers exposed to attacks
MTA servers like Exim are highly vulnerable targets, primarily because they are often accessible via the Internet, serving as easy entry points for attackers into a target's network.
The National Security Agency (NSA) said three years ago, in May 2020, that the notorious Russian military hacking group Sandworm has been exploiting the critical CVE-2019-10149 (The Return of the WIZard) Exim flaw since at least August 2019.
Exim is also the default MTA on Debian Linux distros and the world's most popular MTA software, according to a mail server survey from early September 2023.
According to the survey, Exim is installed on more than 56% out of a total of 602,000 mail servers reachable on the Internet, representing just over 342,000 Exim servers.
Just over 3.5 million Exim servers are currently exposed online per a Shodan search, most of them in the United States, followed by Russia and Germany.
While a patch is not yet available to secure vulnerable Exim servers against potential attacks, ZDI advised admins to restrict remote access from the Internet to thwart incoming exploitation attempts.
"Given the nature of the vulnerability, the only salient mitigation strategy is to restrict interaction with the application," ZDI warned.
Private patches and other bugs waiting for a fix
ZDI also disclosed five other Exim zero-days with lower severity ratings this week, tagged as high and medium severity:
- CVE-2023-42116: Exim SMTP Challenge Stack-based Buffer Overflow Remote Code Execution Vulnerability (CVSS v3.0 8.1)
- CVE-2023-42117: Exim Improper Neutralization of Special Elements Remote Code Execution Vulnerability (CVSS v3.0 8.1)
- CVE-2023-42118: Exim libspf2 Integer Underflow Remote Code Execution Vulnerability (CVSS v3.0 7.5)
- CVE-2023-42119: Exim dnsdb Out-Of-Bounds Read Information Disclosure Vulnerability (CVSS v3.0 3.1)
- CVE-2023-42114: Exim NTLM Challenge Out-Of-Bounds Read Information Disclosure Vulnerability (CVSS v3.0 3.7)
Exim developer Heiko Schlittermann revealed on the Open Source Security (oss-sec) mailing list after this article was published that "fixes are available in a protected repository" for CVE-2023-42114, CVE-2023-42115, and CVE-2023-42116, and are "ready to be applied by the distribution maintainers."
"The remaining issues are debatable or miss information we need to fix them. We're more than happy to provide fixes for all issues as soon as we receive detailed information," Schlittermann added.
A ZDI representative replied to the oss-sec thread saying that the advisories published this week would be updated and the zero-day tag removed as soon as Exim publishes patches.
"The ZDI reached out multiple times to the developers regarding multiple bug reports with little progress to show for it. After our disclosure timeline was exceeded by many months, we notified the maintainer of our intent to publicly disclose these bugs, at which time we were told, "you do what you do," the ZDI representative said.
"If these bugs have been appropriately addressed, we will update our advisories with a link to the security advisory, code check-in, or other public documentation closing the issue."
Update: Added info on the other Exim five flaws disclosed by ZDI and Exim's private patches.
Comments
h_b_s - 6 months ago
"Given the nature of the vulnerability, the only salient mitigation strategy is to restrict interaction with the application,"
Not a realistic option if it's handling your external e'mail communications. Since this hasn't been patched, the only alternative is one admins will dread. They'll have to change MTA programs. Immediately. That's time consuming, error prone, tedious, and absolutely will piss management off if they lose access to the ability to e'mail or the ability to spam others (gotta have a silver lining after all).
h_b_s - 6 months ago
""Given the nature of the vulnerability, the only salient mitigation strategy is to restrict interaction with the application,"
Not a realistic option if it's handling your external e'mail communications. Since this hasn't been patched, the only alternative is one admins will dread. They'll have to change MTA programs. Immediately. That's time consuming, error prone, tedious, and absolutely will piss management off if they lose access to the ability to e'mail or the ability to spam others (gotta have a silver lining after all)."
(Yeah, I don't see this happening either, so many of those exim servers are going to get compromised before anything changes.)