high

CVE

CVE-2026-137702

CWE

CWE-787, CWE-131

Affected Surface

  • Exim 4.100 and 4.100.1 built from upstream source (fixed in 4.100.2, released 25 November 2026). MITRE's CVE record lists every version before 4.100.2
  • cPanel & WHM 11.138, 11.136, 11.134 (LTS), 11.110 (ELS) and WP Squared 138 with `cpanel-exim` 4.100.1 (fixed in cpanel-exim 4.100.2-2, shipped in 11.138.0.29, 11.136.0.55, 11.134.0.78, 11.110.0.165 and WP Squared 11.138.1.23)
  • Fedora 43, 44 and 45 and EPEL 8 and 9 with `exim` 4.100.1. Fedora 46 got 4.100.2-1 on 26 November; the Fedora 44, Fedora 45, EPEL 8, EPEL 9 and EPEL 10.4 builds were still in testing on 28 November
  • Debian `exim4` in bookworm before 4.96-15+deb12u11 (DLA-4940-1), trixie before 4.98.2-1+deb13u6 (DSA-6659-1), and the 4.100 / 4.100.1 packages in forky and sid before 4.100.1-5
  • Other distributions that packaged 4.100.1, including FreeBSD ports, Kali rolling and Gentoo, until they move to 4.100.2

TL;DR

Exim 4.100.2 came out on 25 November 2026 with a single security fix: a heap out-of-bounds write during SMTP reception, now CVE-2026-137702 (CVSS 3.1 8.1, AV:N/AC:H/PR:N). Exim’s advisory says “a remote attacker can cause a write outside an allocated area, followed by an expansion operation done with root privilege.” No login is needed. The attacker only has to send a message whose headers your configuration expands.

The cause is a size mismatch in $h_ header expansion. When Exim decodes an RFC 2047 encoded header (=?charset?Q?...?=) and the charset conversion fails, 4.100 and 4.100.1 fall back to the raw header text but keep the size of the decoder’s buffer. Anything the expansion appends afterwards can land past the end of the raw header’s heap block. That fallback arrived with a commit on 9 July 2026 and first shipped in 4.100 on 20 August.

Exim lists only 4.100 and 4.100.1 as affected. cPanel ships 4.100.1 as cpanel-exim and says its build is affected. So are Fedora 43 to 45, EPEL 8 and 9, FreeBSD ports and Debian testing. Debian also shipped the patch for its 4.96 (bookworm) and 4.98.2 (trixie) packages. There’s no public PoC, no exploitation report and no KEV listing. EPSS was 0.0048 on 28 November.

What to do now:

  1. Upgrade to Exim 4.100.2 or your vendor’s patched package, then restart the daemon so the old binary stops listening. On cPanel, run /scripts/upcp --security and confirm cpanel-exim is 4.100.2-2 or later.
  2. On Fedora and EPEL, pull the 4.100.2-1 build from updates-testing if it hasn’t reached stable for your release yet.
  3. Exim’s advisory lists no mitigation. Find every $h_ / $header_ reference in your configuration (command below) so you know which ACLs, routers and filters touch decoded headers.

Affected packages and projects

EcosystemPackageAffected versionsFixed or safe version
Upstream sourceExim4.100, 4.100.14.100.2 (tag exim-4.100.2, commit eac152d113ba)
cPanel & WHM / WP Squaredcpanel-exim4.100.1 on 11.138, 11.136, 11.134 LTS, 11.110 ELS, WP Squared 138cpanel-exim 4.100.2-2 (11.138.0.29, 11.136.0.55, 11.134.0.78, 11.110.0.165, WP Squared 11.138.1.23)
Fedora / EPELexim4.100.1 (Fedora 43 to 45, EPEL 8, EPEL 9)4.100.2-1: stable on Fedora 46 since 26 November; Fedora 44/45 and EPEL 8/9/10.4 in testing on 28 November
Debianexim4bookworm 4.96-15+deb12u10, trixie 4.98.2-1+deb13u5, forky/sid 4.100.1 before -54.96-15+deb12u11 (DLA-4940-1), 4.98.2-1+deb13u6 (DSA-6659-1), 4.100.1-5
Othersexim4.100.1 (FreeBSD ports, Kali rolling, Gentoo and others per Repology on 28 November)4.100.2 (already in Arch, Alpine 3.24, Gentoo, FreeBSD, Homebrew)

The CVE record, assigned by MITRE, says “Exim before 4.100.2”, and Debian patched two older branches. Upstream names only 4.100 and 4.100.1, and the source backs that up. In 4.99.5 and in Debian’s 4.98.2, find_header() returns the decoded string even when conversion fails, and the buffer size it reports belongs to that same string. We read the bookworm and trixie updates as precautionary backports of the upstream patch. They’re still worth installing.

Technical analysis

Where $h_ gets its size

In an Exim expansion string, $h_subject: (or $header_subject:) returns the Subject header after RFC 2047 decoding and conversion into headers_charset. $rh_ returns the raw header, and $bh_ decodes without converting the charset. The expansion code asks find_header() for the value and for the size of the heap block it lives in (src/src/expand.c, 4.100.1):

const uschar * charset = *name == 'b' ? NULL : headers_charset;

s = read_header_name(name, sizeof(name), s);
value = find_header(name, &newsize, flags, charset);
...
int len = Ustrlen(value);
if (!yield && newsize != 0)
  {
  yield = g;
  yield->size = newsize;       // capacity of the block holding value
  yield->ptr = len;
  yield->s = US value;         // reuse the block instead of copying it
  }
else
  yield = string_catn(yield, value, len);
  • charset is headers_charset for $h_ and NULL for $bh_. Only a non-NULL charset can make the conversion fail.
  • When the header is the first thing in the expansion (!yield), Exim doesn’t copy it. It adopts the returned buffer as the output string and sets the string’s capacity to newsize.
  • Everything the expansion produces after this point is appended with string_catn() into that buffer. string_catn() trusts yield->size to decide whether there’s room.

If newsize is bigger than the block value actually points to, those appends write past the end of it.

The fallback that broke the contract

Here’s find_header() in 4.100.1:

*newsize = g->size;                     // size of the raw header block
rawhdr = string_from_gstring(g);
if (flags & FH_WANT_RAW)
  return rawhdr;

else
  {
  uschar * error;
  const uschar * decoded = rfc2047_decode2(rawhdr, check_rfc2047_length,
                                          charset, '?', NULL, newsize, &error);
  if (error)
    DEBUG(any) debug_printf("*** error in RFC 2047 decoding: %s\n"
      "    input was: %s\n", error, rawhdr);
  return decoded && !error ? decoded : rawhdr;
  }
  • *newsize = g->size records the size of the raw header’s block.
  • rfc2047_decode2() receives the same newsize pointer as its sizeptr argument. It builds the decoded text in a new block and, on the way out, overwrites *newsize with that block’s size (if (sizeptr) *sizeptr = yield->size;). It does this on every path, including when it has set error.
  • When conversion fails, rfc2047_decode2() doesn’t give up. It copies the undecoded MIME word into its output, sets error and returns normally. The code comment says “Translation errors set error, but carry on, using the untranslated data.”
  • The last line then returns rawhdr, but *newsize now holds the decoded block’s size. Nothing ties those two sizes together. The caller ends up with the raw header’s pointer and the decoder’s capacity.

The && !error came from commit 79be3858c662 on 9 July 2026, “Fix $h_* for charset-conversion needed but no iconv”. It made the Linux build default to HAVE_ICONV=yes and changed what $h_ returns when conversion fails:

-  return decoded ? decoded : rawhdr;
+  return decoded && !error ? decoded : rawhdr;
-#if HAVE_ICONV
-  if (target)
+  if (target)					/* charset wanted */
     {
     const uschar * src_chset = mimeword + 2;
     src_chset = string_copyn(src_chset, q1 - src_chset); /* need nul-term str */
 
-    if (  strcmpic(target, src_chset) != 0
-       && (icd = iconv_open(CCS target, CCS src_chset)) == (iconv_t)-1)
-      *error = string_sprintf("iconv_open(%q, %q) failed: %s%s",
-	target, src_chset, strerror(errno),
-	errno == EINVAL ? " (maybe unsupported conversion)" : "");
-    }
+    if (strcmpic(target, src_chset) != 0)
+#if HAVE_ICONV
+      if ((icd = iconv_open(CCS target, CCS src_chset)) == (iconv_t)-1)
+	*error = string_sprintf("iconv_open(%q, %q) failed: %s%s",
+	  target, src_chset, strerror(errno),
+	  errno == EINVAL ? " (maybe unsupported conversion)" : "");
+#else
+      *error = US"charset conversion needed but not available";
 #endif
+    }

Returning the raw header on failure was a reasonable behaviour change. The commit’s test case shows =?US-ASCII?Q?Keith_Moore?= now coming back undecoded on a build without iconv. But the size written through newsize was left alone. After this commit, a conversion error can come from iconv_open() failing on a charset name, from an iconv() failure partway through a word, or, on builds without iconv, from any encoded word whose charset differs from headers_charset. The sender picks the charset name in the header, so they decide whether conversion fails.

Exim’s advisory doesn’t say which configurations are reachable or how the write turns into code execution, and nobody has published a PoC. From the code, the overflow needs an expansion string that starts with a $h_ or $header_ reference and then appends more output after it, evaluated while a received message’s headers are loaded. That covers DATA-time ACLs, routers, transports and system filters. Debian’s DSA says the bug “could result in the execution of arbitrary code.” cPanel’s notice says it could crash mail reception or delivery “and, in the worst case, allow code execution as root.”

The fix

Commit eac152d113ba (Jeremy Harris, 19 November) gives the decoder its own size variable and only copies it out when the decoded string is the one being returned:

 static const uschar *
-find_header(const uschar * name, int * newsize, unsigned flags,
+find_header(const uschar * name, int * newsizep, unsigned flags,
   const uschar * charset)
 {
@@
-*newsize = g->size;
+*newsizep = g->size;
 rawhdr = string_from_gstring(g);
@@
   uschar * error;
+  int newsize;
   const uschar * decoded = rfc2047_decode2(rawhdr, check_rfc2047_length,
-					  charset, '?', NULL, newsize, &error);
-  if (error)
-    DEBUG(any) debug_printf("*** error in RFC 2047 decoding: %s\n"
-      "    input was: %s\n", error, rawhdr);
-  return decoded && !error ? decoded : rawhdr;
+					charset, '?', NULL, &newsize, &error);
+  if (decoded && !error)
+    {
+    *newsizep = newsize;
+    return decoded;
+    }
+
+  if (error) DEBUG(any)
+    debug_printf("*** error in RFC 2047 decoding: %s\n    input was: %s\n",
+		error, rawhdr);
+  return rawhdr;

The raw header’s size goes out through newsizep first. The decoder writes into a local, and that value is only passed to the caller together with the decoded pointer. On the error path the caller gets rawhdr with rawhdr’s own size. Debian applied the same commit unchanged as 86_Fix-iconv-failure-handling.patch in its trixie package.

The advisory credits “the unnamed and uncredited authors whose works were ingested as the training corpus”. The report came in on 12 November, and the fix was drafted a week later. The advisory file rates the bug High, while the announcement email says Medium, and the two use different internal IDs (EXIM-Security-2026-11-19.1 and -11-82.1) for the same GCVE, GCVE-25-2026-11-82-1.

IOCs

None published. Exim, Debian, cPanel and the CVE record give no sample message, sender, IP address or exploitation report, and no public PoC repository existed on 28 November.

Things worth looking for on an unpatched 4.100.x server:

  • Exim processes dying with SIGSEGV or SIGABRT, or new entries in paniclog that line up with inbound SMTP sessions
  • Inbound messages with RFC 2047 encoded words (=?...?Q? / =?...?B?) that name an unusual or invalid charset, especially in headers your ACLs or filters read with $h_
  • The debug string error in RFC 2047 decoding, which only shows up if you run Exim with debugging enabled

Detection and remediation

# 1. Which Exim is running?
exim -bV | head -1
dpkg -l 'exim4*' 2>/dev/null | grep '^ii'
rpm -q exim cpanel-exim 2>/dev/null

# 2. Which parts of the config expand decoded headers? ($h_ / $header_ go through
#    charset conversion; $rh_ and $bh_ don't)
exim -bP config | grep -nE '\$(h|header)_[A-Za-z0-9-]+:'
grep -rnE '\$(h|header)_[A-Za-z0-9-]+:' /etc/exim* /etc/exim4/conf.d 2>/dev/null

# 3. Crashes since the 4.100 upgrade
grep -i exim /var/log/exim*/paniclog /var/log/exim4/paniclog 2>/dev/null | tail
journalctl -k --since 2026-08-20 | grep -iE 'exim.*(segfault|general protection)'

# 4. Upgrade
apt-get update && apt-get install --only-upgrade exim4-base exim4-daemon-light exim4-daemon-heavy  # Debian
dnf --enablerepo=updates-testing upgrade exim     # Fedora 44/45
dnf --enablerepo=epel-testing upgrade exim        # EPEL 8/9/10 until 4.100.2 reaches stable
/scripts/upcp --security && rpm -q cpanel-exim    # cPanel & WHM: expect 4.100.2-2 or later
/scripts/upcp --force && rpm -q cpanel-exim       # WP Squared

# 5. Restart so the patched binary is the one listening
systemctl restart exim4 || systemctl restart exim

If you build from source, take the exim-4.100.2 tag from code.exim.org/exim/exim or the tarballs on ftp.exim.org and check that the tag signature comes from key ID 0xBCE58C8CE41F32DF, the key named in the release announcement. If you maintain a patched 4.100.x tree, the fix is the single commit above and applies cleanly.

Exim’s advisory lists no mitigation other than upgrading. From reading the code, expansions that use $rh_ or $bh_ instead of $h_ never enter the failing conversion path, but that changes what your ACLs and filters see. Only use it as a short-term stopgap where you understand the effect, and still upgrade.

No credential rotation is needed unless you find evidence of compromise. If an unpatched server shows unexplained crashes during reception, treat the host as possibly compromised. Exim’s advisory describes the follow-on expansion as running with root privilege, so rotate whatever the host can reach: DKIM private keys, TLS keys, SMTP AUTH credentials and any database or LDAP passwords in the Exim configuration.

Timeline

  • 2026-07-09: Commit 79be3858c662 makes $h_ return the raw header when charset conversion fails, without changing the reported buffer size.
  • 2026-08-20: Exim 4.100 is tagged, the first release with the bug.
  • 2026-09-14: Exim 4.100.1 is tagged.
  • 2026-11-12 12:25 UTC: Exim receives the report.
  • 2026-11-19 11:14 UTC: Fix drafted (commit eac152d113ba) and GCVE-25-2026-11-82-1 assigned.
  • 2026-11-25 13:00 UTC: The exim-4.100.2 tag is pushed and the release goes public. The announcement goes to exim-announce at 13:04 UTC.
  • 2026-11-25 15:03 UTC: Debian publishes DSA-6659-1 for trixie, with no CVE yet. DLA-4940-1 covers bookworm.
  • 2026-11-26: Fedora 46 gets exim-4.100.2-1 (stable at 18:11 UTC). Fedora 44/45 and EPEL 8/9/10.4 builds enter testing. The announcement is forwarded to oss-security.
  • 2026-11-27 02:16 UTC: MITRE publishes CVE-2026-137702 (CVSS 3.1 8.1, CWE-787).
  • 2026-11-28 03:41 UTC: cPanel publishes its notice and patched cpanel-exim 4.100.2-2 builds.

From research to remediation

Check whether this pattern exists in your codebase

Turn this research into a remediation workflow. Scan dependencies and package manifests for similar supply-chain risk, then prioritize fixes with reachability context.

References