Introduction
A header decoding bug in Exim's string expansion code lets a remote, unauthenticated sender corrupt heap memory on the receiving mail server. The Exim advisory states that the out-of-bounds write is followed by an expansion operation running with root privilege. Because Exim commonly sits directly on the internet edge, a memory corruption flaw reachable through ordinary SMTP traffic is worth prompt attention, even though no public exploit or active exploitation has been reported.
Exim is a message transfer agent originally developed at the University of Cambridge for Unix systems connected to the internet, and it can be used as a replacement for Sendmail. A SecuritySpace survey published June 1, 2025 counted 286,701 Exim servers, or 55.96% of the 512,332 MX servers whose software it could identify from SMTP banners. That figure is historical and says nothing about how many servers run a vulnerable release, but it explains why Exim defects tend to matter across the mail ecosystem.
CVE-2026-137702 carries a MITRE CNA CVSS v3.1 score of 8.1 (High) with the vector CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H, and is classified as CWE-787 (Out of bounds Write). Exim tracks the issue as EXIM-Security-2026-11-19.1 / GCVE-25-2026-11-82-1 rather than by CVE number. The NVD entry links to both Exim documents, which is how the identifiers are tied together. The fix shipped in Exim 4.100.2 on November 25, 2026.
Technical information
Where the bug lives
All of the relevant logic is in find_header() in src/expand.c. The string expander calls this helper for header lookups such as $h_subject:. It locates the matching header lines, joins them into a growable string (gstring), and returns that buffer to the caller along with its size through an out parameter.
Unless raw output (FH_WANT_RAW) was requested, find_header() then passes the text through rfc2047_decode2(). That function decodes RFC 2047 encoded words such as =?charset?B?...?= and can convert the result to another character set using iconv.
Root cause: buffer and size out of sync
Before the fix, find_header() wrote the raw buffer's size into the caller's variable and then handed that same pointer directly to the decoder:
*newsize = g->size; rawhdr = string_from_gstring(g); ... uschar * error, * decoded = rfc2047_decode2(rawhdr, check_rfc2047_length, charset, '?', NULL, newsize, &error); if (error) DEBUG(D_any) debug_printf("*** error in RFC 2047 decoding: %s\n" " input was: %s\n", error, rawhdr); return decoded ? decoded : rawhdr;
As the source comment notes, rfc2047_decode2() can fail with an error after charset conversion has already started. In that situation it either returns partly decoded data together with the error, or returns NULL. In both cases it may already have written its own size into *newsize.
The old code fell back to rawhdr when decoded was NULL, but it never restored the raw size. The caller therefore received one buffer and a size value that described a different buffer. Expansion code trusts that size when it writes, so it could write past the end of the heap allocation. This is the out-of-bounds write described in the CVE record and summarized in the Exim ChangeLog as "Fix an OOB write resulting from header decode."
Attack flow
Based on the advisory and the patch, the documented sequence looks like this:
- An attacker sends a message to an Exim server over SMTP. According to the CVSS vector, no authentication or user interaction is required.
- The message contains header content that Exim later processes through
find_header()during a header expansion, with RFC 2047 decoding enabled (that is, withoutFH_WANT_RAW). rfc2047_decode2()begins charset conversion, fails partway through, and has already written its own size value into the caller's size variable.find_header()returns a buffer whose size no longer matches the value the caller holds.- Expansion code writes using the mismatched size and runs past the end of the heap allocation. The advisory states this is "followed by an expansion operation done with root privilege."
What remains undisclosed
The patch pins down the vulnerable function, but the public material does not describe the heap layout, allocation sizes, the exact header encoding or charset needed, any configuration prerequisites, or the specific conditions behind the AC:H (high complexity) rating. No complete exploit chain demonstrating attacker-controlled code execution has been published. The 8.1 score reflects potential high confidentiality, integrity, and availability impact. It is not a measure of how reliably a given server can be compromised.
Exploitation status
Active exploitation is not confirmed in the available reporting. The CVE record and Exim disclosures name no campaign, victim, malware family, or threat actor. VulDB reports no publicly available exploit, and Rapid7's entry published November 27, 2026 notes the CVE is not in CISA's Known Exploited Vulnerabilities catalog. VulDB describes exploitation as easy, which conflicts with the CNA vector's AC:H. We follow the CNA vector here. Absence of public reporting is not proof that private exploitation has not occurred.
Patch information
The fix is a single commit, eac152d113babed951f3cc52f548c4b4ba974ae3, titled "Fix iconv failure handling" (Jeremy Harris, 19 Nov 2026). It changes 21 lines in src/expand.c and adds the ChangeLog entry. The release is tagged exim-4.100.2 at code.exim.org and signed by Jeremy Harris. The release announcement gives the signing key ID as 0xBCE58C8CE41F32DF. Source tarballs are available from the official Exim download directory and the Exim source repository.
-find_header(uschar * name, int * newsize, unsigned flags, const uschar * charset) +find_header(uschar * name, int * newsizep, unsigned flags, const uschar * charset) ... -*newsize = g->size; +*newsizep = g->size; ... { + int newsize; uschar * error, * decoded = rfc2047_decode2(rawhdr, - check_rfc2047_length, charset, '?', NULL, newsize, &error); - if (error) - DEBUG(D_any) debug_printf("*** error in RFC 2047 decoding: %s\n" - " input was: %s\n", error, rawhdr); - return decoded ? decoded : rawhdr; + check_rfc2047_length, charset, '?', NULL, &newsize, &error); + if (decoded && !error) + { + *newsizep = newsize; + return decoded; + } + + if (error) DEBUG(D_any) + debug_printf("*** error in RFC 2047 decoding: %s\n input was: %s\n", + error, rawhdr); + return rawhdr; }
The patch does three things:
rfc2047_decode2()now writes into a localint newsize, so it can no longer modify the caller's size directly. Renaming the parameter tonewsizepseparates the caller's pointer from the local copy.*newsizepis updated only when the decoder returns data and reports no error, so the decoded buffer and its size are returned together.- On any decode failure, including partial data returned with an error, the function returns
rawhdr, and the caller's size is stillg->size. This is also a small behaviour change. Previously, partially converted data was returned whenever the decoder produced output. Now any charset conversion error makes Exim use the undecoded header text.
After the patch, the returned pointer and the returned size always describe the same buffer.
The Exim advisory states there is no workaround. Exim's documented deliver_drop_privilege option, which drops root during delivery and routing, is general hardening. The sources do not establish that it prevents this SMTP reception defect, so it should not be treated as a substitute for the upgrade.
Downstream backports
Debian has applied the same src/expand.c change:
- unstable:
exim4 4.100.1-5, labelled "From 4.100.2". - trixie security:
exim4 4.98.2-1+deb13u6, carried as86_Fix-iconv-failure-handling.patch.
If you review the trixie debdiff, note that it also includes an unrelated patch, 86_Extend-musl-dns-OOB-read-fix.patch, a one-character change in src/string.c. That patch is not part of this CVE fix.
The cited disclosures do not establish fixed package versions for other distributions.
Affected systems and versions
- Explicitly affected (Exim advisory): Exim 4.100 and Exim 4.100.1.
- Affected range (CVE record / NVD): all Exim versions before 4.100.2. The upstream list is narrower than the CVE range, and the narrower list should not be read as clearing older releases.
- Fixed upstream: Exim 4.100.2, released November 25, 2026.
- Fixed Debian packages:
exim4 4.100.1-5(unstable) andexim4 4.98.2-1+deb13u6(trixie security). - Configuration: the vulnerable path is header expansion through
find_header()with RFC 2047 decoding (noFH_WANT_RAW). The advisory does not identify specific configurations that are or are not exposed.
Vendor security history
Exim has a substantial record of serious remotely reachable bugs, and a mostly prompt record of fixing them:
- 21Nails (2021): Qualys reported 21 vulnerabilities, 10 remotely exploitable and 11 locally exploitable, some of which could be chained into unauthenticated remote code execution as root. Qualys says Exim acknowledged the report immediately, and a security update addressed releases before 4.94.2.
- CVE-2025-26794: Exim's own security history records that this issue was not entirely fixed initially. The final fix appeared in 4.99.1.
- CVE-2019-10149: Exim released a fix in June 2019. NSA later attributed exploitation of unpatched servers, from at least August 2019, to Russian GRU actors known as Sandworm, who abused the SMTP
MAIL FROMfield to download and run shell scripts. This is historical context only. There is no evidence linking Sandworm or that campaign's indicators to CVE-2026-137702.
For the current issue, Exim records receiving the report on November 12, drafting a fix on November 19, and publishing 4.100.2 on November 25, 2026. The detailed advisory labels severity as High, while the release announcement says Medium. The MITRE CNA score is 8.1 High. Neither label changes the remediation target.
References
- NVD entry for CVE-2026-137702
- CVE Record for CVE-2026-137702
- Exim advisory EXIM-Security-2026-11-19.1
- Exim Security Release 4.100.2 announcement
- oss security mailing list post
- Debian trixie debdiff for exim4 4.98.2-1+deb13u6
- Debian changelog for exim4 4.100.1-5
- Exim source repository
- Exim download directory
- Rapid7 Vulnerability Database entry
- VulDB entry 444691
- Cybersecurity Help bulletin SB20261125113
- LinuxCompatible: Exim 4.100.2 release
- Exim Internet Mailer homepage
- Exim security wiki
- Exim specification: Security considerations
- Exim advisory on the 2023 ZDI reports
- Qualys: 21Nails, multiple vulnerabilities in Exim
- SecuritySpace Mail (MX) Server Survey, May 2025
- NSA: Exim MTA actively exploited by Russian GRU cyber actors
- CISA: NSA advisory on Sandworm exploiting Exim
- NSA advisory PDF: Sandworm actors exploiting Exim
- FIRST CVSS v3.1 specification



