CVE Professor
/
All CVEs
CVE-2026-141382

CVE-2026-141382 — Exim — CWE-787

HIGH CVSS 8.1 Shodan

Exim before 4.100.3 allows attackers to send SMTP traffic that triggers a heap out-of-bounds write in expansion code running as root. NOTE: this issue occurs because of an incomplete fix for CVE-2026-137702.

Exim before 4.100.3 allows attackers to send SMTP traffic that triggers a heap out-of-bounds write in expansion code running as root. NOTE: this issue occurs because of an incomplete fix for CVE-2026-137702.

CVSS v3.1 Vector Metrics
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Attack Vector Network AV:N
Attack Complexity High AC:H
Privileges Req. None PR:N
User Interaction None UI:N
Scope Unchanged S:U
Confidentiality High C:H
Integrity High I:H
Availability High A:H
AI Security Analysis & Remediation

🎯 What is this vulnerability?

CVE-2026-141382 is a Heap Out-of-Bounds Write (OOB Write) vulnerability in the Exim mail transfer agent (MTA), specifically affecting versions prior to 4.100.3. The flaw resides in the string expansion code (used for processing variables like $sender_address, $local_part, etc., within Exim configuration files and SMTP commands).

Technical Breakdown:

1. CWE-787 (Out-of-bounds Write): The core issue is that the memory allocator or buffer management logic in the expansion routine fails to correctly calculate or enforce the bounds of a heap-allocated buffer. 2. Incomplete Fix for CVE-2026-137702: This is a regression or incomplete patch. The previous vulnerability (CVE-2026-137702) likely addressed a similar OOB write, but the fix did not cover all code paths or edge cases in the expansion engine. 3. Root Privilege Context: Exim typically runs as the exim user for network-facing processes, but certain components (like the exim daemon itself during specific phases, or if configured to run as root for certain operations like DNS lookups or local delivery) may execute with elevated privileges. The CVE explicitly states the expansion code runs as root. This is critical: if the expansion code is triggered in a context where the process has root privileges (e.g., during local delivery or specific ACL checks that drop privileges later), an OOB write can corrupt heap metadata or function pointers, leading to arbitrary code execution with root privileges. 4. Trigger Mechanism: The vulnerability is triggered by SMTP traffic. An attacker sends a specially crafted SMTP command (likely in the MAIL FROM:, RCPT TO:, or DATA section) that contains a string which, when expanded by Exim’s internal variable expansion engine, causes the heap write to overflow.

Why is it dangerous?

  • Unauthenticated (PR:N): No login required.
  • Network Vector (AV:N): Exploitable remotely via SMTP.
  • High Complexity (AC:H): Crafting a reliable heap OOB write to achieve RCE is complex due to ASLR, stack canaries, and heap layout randomness. However, the high impact (C:H/I:H/A:H) and root execution make it a critical threat if exploited.
  • No User Interaction (UI:N): Fully automated.
  • ⚡ Attack Chain

    1. Discovery & Reconnaissance

  • Banner Grabbing: Use nmap or nc to connect to port 25 and read the SMTP banner.
  • nmap -sV -p 25 --script smtp-enum-users target_ip
        # Output: Exim 4.100.2 (or earlier)
  • Version Verification: Confirm the version is < 4.100.3.
  • Exposure Check: Ensure the SMTP port is accessible from the internet (not just internal).
  • 2. Exploitation

    The attacker crafts a malicious SMTP session. The exact payload depends on the specific heap layout and the incomplete fix details, but it generally involves:
  • Sending a MAIL FROM: or RCPT TO: command with a specially crafted string that triggers the vulnerable expansion path.
  • The string must be long enough to overflow the heap buffer and overwrite adjacent memory (e.g., a function pointer or return address).
  • Illustrative PoC (Conceptual):

    Note: The exact payload is not publicly disclosed in the CVE description. The following is an illustrative example of how such a vulnerability might be triggered. It is not a working exploit.

    # Illustrative SMTP session
    nc target_ip 25
    EHLO attacker.com
    MAIL FROM:<[email protected]>
    # The following RCPT TO: line contains a crafted string that triggers the OOB write
    # The string is designed to overflow the heap buffer in the expansion code
    RCPT TO:<"$(python3 -c 'print("A"*1000 + "\x41\x41\x41\x41")')"@target.com>
    DATA
    Subject: Test
    From: [email protected]
    To: [email protected]
    
    Hello
    .
    QUIT

    Key Technical Details:

  • The crafted string in RCPT TO: is processed by Exim’s expansion engine.

  • The expansion code allocates a heap buffer for the expanded string.

  • Due to the incomplete fix, the buffer size calculation is incorrect, leading to an OOB write.

  • The write corrupts heap metadata or a function pointer, leading to control flow hijacking.
  • 3. Post-Exploitation

  • Root Shell: If the OOB write successfully hijacks control flow, the attacker gains a root shell on the mail server.
  • Persistence: The attacker can:
  • - Install a rootkit. - Modify Exim configuration to allow backdoored mail delivery. - Exfiltrate mail data, credentials, and system files. - Pivot to other internal systems.
  • Lateral Movement: With root access, the attacker can read /etc/shadow, SSH keys, and other sensitive files.
  • 🌍 Real World Impact

  • Confidentiality (C:H): Full access to all mail data, including sensitive business communications, credentials, and personal information.
  • Integrity (I:H): The attacker can modify mail, inject malicious content, or alter system files.
  • Availability (A:H): The attacker can crash the Exim service or the entire server, causing a denial of service.
  • Practical Consequences:
  • - Data Breach: Massive exposure of email content. - Ransomware: The attacker can encrypt mail stores or system files. - Supply Chain Attack: Compromised mail server can be used to send phishing emails to other organizations. - Regulatory Fines: Violation of GDPR, CCPA, or other data protection laws.

    🛡️ Remediation & Mitigation

    1. Patching

  • Upgrade to Exim 4.100.3 or later.
  • - This is the only reliable fix. The vulnerability is in the core expansion code, and workarounds are not guaranteed to be effective. - Command:
    # Debian/Ubuntu
            sudo apt update && sudo apt upgrade exim4
    
            # RHEL/CentOS
            sudo yum update exim
    
            # Compile from source
            wget https://exim.org/exim.html
            # Follow compilation instructions for version 4.100.3+

    2. Workarounds (Temporary)

  • Restrict SMTP Access:
  • - Use a firewall to restrict access to port 25 to known IP addresses only. - iptables example:
    iptables -A INPUT -p tcp --dport 25 -s 192.168.1.0/24 -j ACCEPT
            iptables -A INPUT -p tcp --dport 25 -j DROP
  • Disable Expansion Features:
  • - If possible, disable the use of expansion variables in SMTP commands. This is difficult in practice, as expansion is a core feature of Exim.
  • Run Exim as Non-Root:
  • - Ensure Exim does not run as root for the network-facing processes. However, the CVE states the expansion code runs as root, so this may not be fully effective if the vulnerable code path is still executed with root privileges.

    3. Detection

  • Log Monitoring:
  • - Monitor Exim logs (/var/log/exim4/mainlog or /var/log/maillog) for unusual SMTP commands, especially those with very long or malformed RCPT TO: or MAIL FROM: fields. - Example Log Pattern:
    2026-12-01 12:00:00 1abc1234567890 Q=1 R=1 S=100 T=1
            2026-12-01 12:00:00 1abc1234567890 => [email protected] [192.168.1.100]
            2026-12-01 12:00:00 1abc1234567890 ** Failed: heap corruption detected
  • Intrusion Detection:
  • - Use a WAF or IDS to detect abnormal SMTP traffic patterns. - ModSecurity Rule (Illustrative):
    SecRule REQUEST_URI "@rx (RCPT TO:.*[A-Z]{100,})" \
                "id:100001,phase:1,deny,status:403,msg:'Potential Exim OOB Write Attack'"
  • File Integrity Monitoring:
  • - Monitor for unexpected changes to Exim binaries or configuration files.

    ⚠️ Urgency

  • CVSS Score: 8.1 (HIGH)
  • CISA KEV: No
  • Exploit Complexity: High (AC:H)
  • Priority: HIGH
  • Recommendation:
- Patch immediately if the mail server is exposed to the internet. - If the server is internal-only, patch within 7 days. - Monitor for signs of exploitation, especially if the server has been exposed to the internet for an extended period. - Assume compromise if the server is internet-facing and has not been patched.

[🤖 CVE Professor AI Security Engine]

Target Reconnaissance Queries (FOFA & Shodan)

FOFA Query

app="Exim Exim"
CVSS Score
8.1 / 10 · CVSS HIGH
Weakness Types (CWE)
Affected Products (1)
exim:exim
References & Advisories (2)
Related CVEs
9.2
CVE-2026-144499
ASN1SCC before 4.7.0.1 contains an out-of-bounds write vulnerability in the SequenceOf_decode template in StgC
8.1
CVE-2026-92728
A heap out-of-bounds write flaw was found in GRUB2's DNS response parser. In recv_hook() (grub-core/net/dns.c)
7.3
CVE-2026-129782
Out-of-bounds write in the zwlr_virtual_pointer_v1 protocol implementation of Hyprland for Linux, versions 0.5
7.2
CVE-2026-145314
A heap out-of-bounds write exists in the MPEG-1/2 video decoder (libavcodec/mpeg12dec.c) in FFmpeg before 6.1.
9.3
CVE-2026-88766
Out of Bounds Write when processing a crafted APDU command via the VSIM service due to a stack-based buffer ov
8.8
CVE-2026-125688
An out-of-bounds write in the screen-image decoder of TeamViewer Full Client for Linux prior to version 15.84
8.8
CVE-2026-125689
An out-of-bounds write vulnerability in TeamViewer Full Client prior to version 15.84 has been identified in t