CVE-2026-137702
CVE-2026-137702 — Exim (4.100.2) — CWE-787
HIGH
CVSS 8.1
CVE.org
Exim before 4.100.2 allows attackers to send SMTP traffic that triggers a heap out-of-bounds write in expansion code running as root.
Exim before 4.100.2 allows attackers to send SMTP traffic that triggers a heap out-of-bounds write in expansion code running as root.
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-137702 is a Heap Out-of-Bounds Write (OOB Write) vulnerability in the Exim mail transfer agent (MTA), specifically affecting versions prior to 4.100.2.
Technical Flaw Analysis
- CWE-787: Out-of-bounds Write: The core issue lies in Exim's expansion code. Exim uses a powerful string expansion mechanism (similar to
printfbut with custom variables like$sender_address,$domain, etc.) to process SMTP commands and configure routing. - Root Cause: The expansion engine fails to correctly calculate or enforce the bounds of the destination buffer when processing specific, maliciously crafted SMTP input. This results in writing data beyond the allocated heap memory block.
- Privilege Context: The description explicitly states the code runs as root. This is critical because Exim typically drops privileges for the main MTA process, but certain initialization, configuration parsing, or specific expansion contexts (such as those triggered during SMTP session setup or specific ACL checks) may still execute with elevated privileges or in a context where a heap corruption can lead to code execution with high impact.
- Trigger: The vulnerability is triggered by SMTP traffic. An attacker does not need to be an authenticated user; they only need to be able to open an SMTP connection to the target server.
- AV:N (Network): Exploitable remotely over the network.
- AC:H (High Complexity): The heap OOB write requires precise control over heap layout and memory corruption to achieve reliable code execution. This is not a simple buffer overflow; it requires bypassing ASLR, stack canaries, and heap protections.
- PR:N (No Privileges): No authentication is required.
- UI:N (No User Interaction): No user action is needed.
- S:U (Unchanged Scope): The vulnerable component and the impacted component are the same (the Exim process).
- C:H/I:H/A:H (High Impact): Successful exploitation leads to full compromise of the mail server, including data exfiltration, integrity modification (e.g., altering mail flow), and availability loss (DoS).
- Port Scanning: Identify open port 25 (SMTP) on the target network.
- Banner Grabbing: Use tools like
nmapwith thesmtp-enum-usersorsmtp-brutescripts, or simplync/telnetto retrieve the Exim version banner.
CVSS Vector Breakdown
⚡ Attack Chain
1. Discovery & Reconnaissance
nmap -sV -p 25 --script smtp-enum-users <target_ip>
# Or manually:
nc <target_ip> 25
# Look for: "220 <hostname> ESMTP Exim 4.100.1"EHLO and STARTTLS to probe for version leaks or use passive OSINT.2. Exploitation
EHLO, MAIL FROM, or RCPT TO) that triggers the vulnerable expansion code. The payload must be carefully constructed to:import socket
import struct
def exploit_exim_heap_oob(target_ip, target_port=25):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((target_ip, target_port))
# Receive banner
banner = s.recv(1024)
print(f"[+] Banner: {banner.decode()}")
# Craft malicious SMTP command
# This is a placeholder for the actual exploit payload.
# In reality, this would involve:
# 1. Heap grooming (allocating specific objects)
# 2. Triggering the OOB write with controlled data
# 3. Overwriting a critical pointer
# 4. Executing shellcode
# Example: Malicious EHLO command with crafted domain
# The domain string is processed by the expansion code
malicious_domain = "A" * 1000 + struct.pack("<I", 0x41414141) # Illustrative
payload = f"EHLO {malicious_domain}\r\n"
s.send(payload.encode())
response = s.recv(1024)
print(f"[+] Response: {response.decode()}")
# If successful, the server may crash or execute code.
# For RCE, the payload would include shellcode or a ROP chain.
# Example shellcode (x86_64) to reverse shell:
# shellcode = b"\x31\xf6\x56\x6a\x29\x59\x6a\x2f\x5a\x..."
s.close()
# exploit_exim_heap_oob("192.168.1.100")3. Post-Exploitation
/var/spool/mail), user credentials, and sensitive data stored on the server.
* Lateral Movement: Use the compromised mail server as a pivot point to attack other internal systems.
* Persistence: Install rootkits, modify cron jobs, or create backdoor accounts.
* Mail Manipulation: Alter mail flow, inject malicious emails, or use the server for phishing campaigns.🌍 Real World Impact
Practical Consequences
🛡️ Remediation & Mitigation
1. Upgrade (Primary Fix)
# Debian/Ubuntu
sudo apt update && sudo apt upgrade exim4
# RHEL/CentOS
sudo yum update eximexim -v
# Should show: Exim version 4.100.22. Workarounds (If Immediate Upgrade is Not Possible)
# Example iptables rule to allow SMTP only from internal network
iptables -A INPUT -p tcp --dport 25 -s 192.168.1.0/24 -j ACCEPT
iptables -A INPUT -p tcp --dport 25 -j DROP/etc/exim4/exim4.conf) and disable any unnecessary string expansion features or ACLs that might trigger the vulnerable code path.
Note: This is difficult to implement precisely without knowing the exact trigger, so it is not a reliable mitigation.*
3. Detection
/var/log/exim4/mainlog) for unusual SMTP commands, especially those with very long or malformed domains.
* Look for patterns of repeated connection attempts from the same IP.
⚠️ Urgency
Patching Priority: HIGH
Note: Since this is a heap OOB write, it is less likely to be exploited in the wild immediately compared to simpler buffer overflows, but it remains a critical vulnerability that should be patched as soon as possible.
[🤖 CVE Professor AI Security Engine]
Target Reconnaissance Queries (FOFA & Shodan)
FOFA Query
app="Exim Exim"
CVSS Score
HIGH
Weakness Types (CWE)
Affected Products (1)
Exim:Exim (4.100.2)
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