Cloudanix VulnDB

CVE-2023-42117

High · 8.1

CVSS

8.1

EPSS

6.8%

Published

May 3, 2024

CISA due date

—

Cloudanix analysis

Monitor only SSVC: Track

A flaw in the Exim email server lets remote attackers take control of the server without logging in, which could let them read or tamper with emails and use the machine for further attacks.

Exploitation
Remote Unauthenticated
Attacker needs
None
Complexity
High
Impact
Remote Code Execution
Component
Network Service
Class
Memory Corruption
Remediation
Upgrade
Effort
Medium
Patch risk
Medium

What it actually does

The vulnerability is a memory corruption flaw in the Exim SMTP service caused by insufficient validation of user-supplied data, allowing remote unauthenticated attackers to achieve arbitrary code execution in the context of the Exim process.

Why it matters to the business

Successful exploitation can lead to full compromise of mail servers, enabling attackers to intercept or manipulate email traffic, deploy malware, or pivot to other systems, potentially causing service disruption and data exposure in organizations relying on Exim for email handling.

How an attack unfolds

An attacker connects to the Exim SMTP listener on TCP port 25 and sends specially crafted input that triggers improper handling of special elements, resulting in memory corruption that is leveraged to execute attacker-controlled code without requiring authentication.

How to fix it

Upgrade Exim to the fixed commit de76e9b07d0b6e463f0d6c24b3695966218809dd or later. If immediate patching is not possible, restrict network access to the SMTP service and apply compensating controls such as network segmentation or additional authentication layers.

How to confirm the fix worked

Verify the deployed Exim version or commit hash against de76e9b07d0b6e463f0d6c24b3695966218809dd, review build logs for the fix, and test SMTP input handling with known trigger patterns in a non-production environment to confirm the memory corruption path is closed.

Typical attack path

  1. Identify publicly reachable Exim SMTP servers listening on TCP port 25
  2. Send crafted SMTP commands or data containing unneutralized special elements
  3. Trigger memory corruption condition in the SMTP processing logic
  4. Achieve code execution within the Exim process context
  5. Establish persistence or perform post-exploitation actions such as credential theft or lateral movement

How to detect it

Review SMTP service logs for unusual connection patterns or malformed input around the time of suspected activity, inspect process memory dumps or core files for signs of corruption, and correlate with network flow data showing unexpected outbound connections from mail servers.

What your security team should do

  • Prioritize upgrading all Exim installations to the fixed commit de76e9b07d0b6e463f0d6c24b3695966218809dd
  • Monitor EPSS score trends and reassess exposure if exploitation maturity increases
  • Implement network-level controls to limit unauthenticated SMTP access from untrusted sources
  • Include Exim mail servers in regular vulnerability scanning and patch management cycles

The record

Exim Improper Neutralization of Special Elements Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of Exim. Authentication is not required to exploit this vulnerability. The specific flaw exists within the smtp service, which listens on TCP port 25 by default. The issue results from the lack of proper validation of user-supplied data, which can result in a memory corruption condition. An attacker can leverage this vulnerability to execute code in the context of the current process. Was ZDI-CAN-17554.

Affected packages

Ecosystem Package Introduced Fixed
Chainguard exim 0 4.96.1-r0
Chainguard exim-cdb 0 4.96.1-r0
Chainguard exim-dbmdb 0 4.96.1-r0
Chainguard exim-dnsdb 0 4.96.1-r0
Chainguard exim-doc 0 4.96.1-r0
Chainguard exim-mysql 0 4.96.1-r0
Chainguard exim-pgsql 0 4.96.1-r0
Chainguard exim-scripts 0 4.96.1-r0
Chainguard exim-sqlite 0 4.96.1-r0
Chainguard exim-utils 0 4.96.1-r0
Chainguard libspf2 0 1.2.11-r1
Chainguard libspf2-dev 0 1.2.11-r1
Chainguard libspf2-tools 0 1.2.11-r1
Debian:11 exim4 0 No fix
Debian:11 exim4 0 4.94.2-7+deb11u4
Debian:12 exim4 0 4.96-15+deb12u3
Debian:13 exim4 0 4.97~RC2-2
SUSE:Package Hub 15 SP4 exim 0 4.94.2-bp154.2.9.1
SUSE:Package Hub 15 SP5 exim 0 4.94.2-bp155.5.6.1
SUSE:Package Hub 15 SP5 exim 0 4.97.1-bp155.5.9.1
Ubuntu:20.04:LTS exim4 0 4.93-13ubuntu1.9
Ubuntu:22.04:LTS exim4 0 4.95-4ubuntu2.4
Ubuntu:23.10 exim4 0 4.96-17ubuntu2.1
Ubuntu:Pro:14.04:LTS exim4 0 4.82-3ubuntu2.4+esm7
Ubuntu:Pro:16.04:LTS exim4 0 4.86.2-2ubuntu2.6+esm5
Ubuntu:Pro:18.04:LTS exim4 0 4.90.1-1ubuntu1.10+esm2
Wolfi exim 0 4.96.1-r0
Wolfi exim-cdb 0 4.96.1-r0
Wolfi exim-dbmdb 0 4.96.1-r0
Wolfi exim-dnsdb 0 4.96.1-r0
Wolfi exim-doc 0 4.96.1-r0
Wolfi exim-mysql 0 4.96.1-r0
Wolfi exim-pgsql 0 4.96.1-r0
Wolfi exim-scripts 0 4.96.1-r0
Wolfi exim-sqlite 0 4.96.1-r0
Wolfi exim-utils 0 4.96.1-r0
Wolfi libspf2 0 1.2.11-r1
Wolfi libspf2-dev 0 1.2.11-r1
Wolfi libspf2-tools 0 1.2.11-r1
openSUSE:Leap 15.4 exim 0 4.94.2-bp154.2.9.1
openSUSE:Leap 15.5 exim 0 4.94.2-bp155.5.6.1
openSUSE:Leap 15.5 exim 0 4.97.1-bp155.5.9.1
openSUSE:Tumbleweed exim 0 4.96.2-1.1

Related vulnerabilities