☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]

CVE-2023-42116

CVE-2023-42116 Remote Code Execution in Exim
📅 PUBLISHED: 2024-05-03 02:13 UTC 🔄 UPDATED: 2026-10-02 19:27 UTC
[ OFFICIAL PATCH DEPLOYED ↓ ] FIX: LIKELY — 2 independent sources confirm fix
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 3.76%
👁️
3.76% probability
93.9× above the median CVE
Tier: HIGH
30-day exploitation window · FIRST.org · updated daily
Patch available — upgrade to latest release
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
8.1
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2023-42116 is a critical stack-based buffer overflow vulnerability in the Exim Mail Transfer Agent (MTA), specifically within its handling of NTLM challenge requests during SMTP authentication. This vulnerability allows an unauthenticated, remote attacker to execute arbitrary code on the target system with the privileges of the Exim service account (typically root or a dedicated user). The flaw arises from the lack of proper length validation when copying user-supplied data to a fixed-length stack buffer. With a CVSS score of 8.1, this vulnerability poses a severe threat to mail infrastructure, potentially enabling full server compromise, data exfiltration, and lateral movement within a network. As of this report, no official patch or public exploit code has been released, but the risk remains high due to the widespread deployment of Exim.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

This vulnerability is not directly related to a package manager (NPM, PyPI, Go, Ruby) but affects the Exim MTA, which is often distributed via operating system package managers (e.g., apt, yum). Organizations should monitor their OS vendor for patched versions of the exim package.

CVSS Breakdown & Threat Level

  • CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Base Score: 8.1 (High)
  • Attack Vector: Network (AV:N) – Exploitable remotely.
  • Attack Complexity: Low (AC:L) – No special conditions required.
  • Privileges Required: None (PR:N) – No authentication needed.
  • User Interaction: None (UI:N) – No user action required.
  • Scope: Unchanged (S:U) – Vulnerability cannot affect resources beyond the Exim process.
  • Confidentiality Impact: High (C:H) – Full data access possible.
  • Integrity Impact: High (I:H) – Arbitrary code execution.
  • Availability Impact: High (A:H) – Potential for denial of service or full system takeover.

Threat Level: Critical. The combination of remote, unauthenticated exploitation and high impact makes this a top-priority vulnerability for any organization running Exim.

Deep Dive & Mechanics

The vulnerability resides in the Exim SMTP daemon's handling of NTLM (NT LAN Manager) authentication challenges. When a client initiates an NTLM authentication exchange, the server processes a series of challenge-response messages. The specific flaw is in the function that parses the NTLM challenge request from the client.

  1. Trigger: An attacker sends a crafted NTLM challenge request to the Exim server on port 25 (SMTP).
  2. Buffer Overflow: The vulnerable code copies the attacker-supplied data (e.g., a long username or challenge field) into a fixed-length stack buffer without verifying its size.
  3. Stack Corruption: The oversized data overwrites adjacent memory on the stack, including the saved return address and other critical data.
  4. Code Execution: By carefully crafting the overflow payload, the attacker can overwrite the return address to point to attacker-controlled shellcode. When the function returns, execution is redirected to the shellcode, granting arbitrary code execution.

The attack does not require authentication because the NTLM challenge exchange occurs before the authentication is fully established. The service account context (often root) provides elevated privileges.

Vulnerable vs. Patched Code

Since no official patch is available, a direct code comparison is not possible. However, the vulnerable pattern is a classic stack buffer overflow:

Vulnerable Code (Conceptual):

void handle_ntlm_challenge(char *user_input) {
    char buffer[256];
    // No length check - vulnerable
    strcpy(buffer, user_input);
    // ... process buffer ...
}

Patched Code (Conceptual):

void handle_ntlm_challenge(char *user_input) {
    char buffer[256];
    // Length validation added
    if (strlen(user_input) >= sizeof(buffer)) {
        // Log error and reject
        return;
    }
    strcpy(buffer, user_input);
    // ... process buffer ...
}

The fix would involve using safe string copy functions (e.g., strncpy, snprintf) or adding explicit length checks before copying data to the stack buffer.

Exploitation & Lab Setup

Note: No public exploit code is available at this time. The following is a conceptual guide for testing in a controlled environment.

Red Team (Offensive)

  1. Lab Environment:

    • Target: A virtual machine running a vulnerable version of Exim (e.g., Exim 4.94.2) on a Linux distribution (e.g., Ubuntu 20.04).
    • Attacker: Kali Linux or similar.
    • Network: Both VMs on the same isolated network.
  2. Reconnaissance:

    • Use Nmap to identify Exim: nmap -p 25 --script smtp-commands <target_ip>
    • Confirm NTLM support: nmap -p 25 --script smtp-ntlm-info <target_ip>
  3. Exploitation (Conceptual):

    • Craft a malicious NTLM challenge request with an oversized field.
    • Send the payload using a custom Python script or Netcat.
    • The payload should include shellcode to spawn a reverse shell.

    Example Payload Structure (Python):

    import socket
    
    target_ip = "192.168.1.100"
    port = 25
    
    # Craft NTLM challenge request with overflow
    # [NTLM header] + [padding] + [shellcode] + [overwritten return address]
    payload = b"\x00" * 1000  # Placeholder for actual exploit
    
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.connect((target_ip, port))
    s.send(b"EHLO attacker\r\n")
    s.recv(1024)
    s.send(b"AUTH NTLM\r\n")
    s.recv(1024)
    s.send(payload)
    s.close()
    

Blue Team (Defensive)

  1. Detection:

    • Monitor for unusual SMTP traffic, especially oversized NTLM challenge requests.
    • Look for crashes or restarts of the Exim service.
    • Use the detection rules provided below.
  2. Mitigation:

    • Disable NTLM authentication in Exim if not required (see Remediation).
    • Apply network segmentation to limit exposure of SMTP servers.
    • Implement an Intrusion Prevention System (IPS) to block exploit attempts.

Indicators of Compromise (IOCs)

  • Network IOCs:

    • SMTP packets with abnormally large NTLM challenge fields (e.g., > 256 bytes).
    • Repeated connection attempts from the same IP to port 25 with NTLM AUTH commands.
    • Outbound reverse shell connections from the Exim server to an external IP.
  • Host IOCs:

    • Exim service crashes or core dumps.
    • Unexpected processes spawned by the Exim user (e.g., /bin/sh, /bin/bash).
    • Unusual files in /tmp or /var/tmp created by the Exim process.
    • Modified system binaries or configuration files.
  • Log IOCs:

    • Exim mainlog entries showing repeated NTLM authentication failures.
    • System logs (e.g., /var/log/syslog) indicating segmentation faults in the Exim process.

Detection Engineering

YARA Rule

rule CVE_2023_42116_Exim_NTLM_Overflow {
    meta:
        description = "Detects potential NTLM challenge overflow in Exim SMTP traffic"
        author = "Valters IT"
        date = "2024-01-01"
        reference = "CVE-2023-42116"
    strings:
        $ntlm_auth = "AUTH NTLM" nocase
        $ntlm_challenge = /NTLMSSP\x00[\x01-\x03]\x00\x00\x00/  // NTLMSSP header
        $large_field = { 00 00 00 [4-8] 00 00 00 }  // Placeholder for oversized field
    condition:
        $ntlm_auth and $ntlm_challenge and #large_field > 1
}

Sigma Rule

title: CVE-2023-42116 Exim NTLM Buffer Overflow Attempt
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects potential exploitation of CVE-2023-42116 via oversized NTLM challenge requests
author: Valters IT
logsource:
    category: network_connection
    product: suricata
detection:
    selection:
        app_protocol: smtp
        event_type: alert
        alert.signature_id: 3000001  # Custom ID
    condition: selection
falsepositives:
    - Legitimate large NTLM challenges (unlikely)
level: high

Suricata Rule

alert tcp $EXTERNAL_NET any -> $HOME_NET 25 (msg:"CVE-2023-42116 Exim NTLM Buffer Overflow Attempt"; flow:to_server,established; content:"AUTH NTLM"; nocase; content:"NTLMSSP"; distance:0; within:7; byte_test:4,>,256,0,relative,string,dec; reference:cve,2023-42116; classtype:attempted-admin; sid:3000001; rev:1;)

Remediation & Mitigation

  1. Immediate Actions:

    • Disable NTLM Authentication: In the Exim configuration file (usually /etc/exim/exim.conf), remove or comment out any lines that enable NTLM authentication (e.g., auth_advertise_hosts or server_advertise_condition). Restart the Exim service.
    • Network Segmentation: Place SMTP servers behind a firewall and restrict access to only trusted IPs.
    • Monitor Logs: Enable detailed logging for SMTP authentication and monitor for anomalies.
  2. Long-Term Fixes:

    • Apply Patches: Monitor the Exim website and your OS vendor for an official patch. Apply it as soon as it becomes available.
    • Upgrade Exim: If a patched version is released, upgrade to the latest stable version.
    • Use Alternative Authentication: Switch to more secure authentication methods like CRAM-MD5 or PLAIN over TLS.
  3. Workarounds:

    • If NTLM is required, consider using a reverse proxy or load balancer that can inspect and filter SMTP traffic for malicious payloads.

Valters IT

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2023-42116/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.