On this page (7 sections)

On 30 November 2026 Ubuntu published USN-8228-2, a follow-up to its earlier Exim security update (USN-8228-1). The first update turned out to contain a regression: the fix for CVE-2026-40684 introduced a new out-of-bounds read when Exim processes certain DNS data. The new notice also fixes a separate problem where an SMTP client could cause Exim to expose heap memory.

If you run Exim (the exim4 package) on Ubuntu, whether for a website's contact forms, transactional mail or a full mail server, you should confirm that you have installed the newer package and not just the first update.

What happened

Exim's upstream project released version 4.99.2 as a security release covering four CVEs, as its ChangeLog shows: CVE-2026-40684 through CVE-2026-40687. Ubuntu shipped fixes in USN-8228-1. According to USN-8228-2, the change addressing CVE-2026-40684 introduced an out-of-bounds read when Exim handled certain DNS data, and this affected 20.04, 22.04, 24.04 and 26.04 LTS.

The second notice also covers a distinct bug: an SMTP client could expose heap memory in a 250 reply by sending RSET during a BDAT transfer. Ubuntu lists this as affecting 20.04, 22.04 and 24.04 LTS only. The notice does not assign a CVE identifier or severity score to either of these two new issues, so treat their severity as unrated rather than assuming it matches the original CVEs.

Background: the original Exim fixes

The regression sits on top of a batch of upstream fixes. Scores below are from the NVD-derived GitHub advisories and apply to Exim before 4.99.2.

Upstream Exim issues fixed in 4.99.2 (scores as published via NVD)
CVEConditionCVSSImpact
CVE-2026-40684Exim built on musl libc (not glibc); malformed PTR record data5.9 (medium)Crash of the connection instance
CVE-2026-40685JSON lookup enabled; malformed JSON in an untrusted header6.5 (medium)Out-of-bounds heap write
CVE-2026-40686utf8 operators enabled; malformed UTF-8 header data3.7 (low)Out-of-bounds read, possible information in an error message
CVE-2026-40687SPA authenticator inputNot given in the researchOut-of-bounds read/write per the Exim ChangeLog

Exim's own assessment files note that exposure depends on configuration: the JSON issue needs a config that uses json operators on externally provided input, and the UTF-8 issue needs UTF-8 operations on external input. Ubuntu's description of the same flaws is stronger, saying a remote attacker could possibly execute arbitrary code for CVE-2026-40685. Because the vendors word the impact differently, assume the more serious reading when deciding how fast to patch.

Who is affected

  • Ubuntu servers running exim4, including the exim4-daemon-light and exim4-daemon-heavy packages named in the notice.
  • Hosts on Ubuntu 20.04, 22.04, 24.04 or 26.04 LTS that installed the USN-8228-1 update: these carry the regression until updated.
  • Hosts on 20.04, 22.04 or 24.04 LTS that accept SMTP with BDAT (chunking): these are also exposed to the heap memory leak.
  • Systems on 20.04 LTS, where the fixed packages are delivered through Ubuntu Pro (ESM).

Debian-based mail relays inside web hosting stacks, application servers that use Exim only for outbound mail, and forgotten staging servers all count. Even if Exim only listens on localhost, check whether it is reachable from outside.

How to check your exposure

Run this on the server to see whether exim4 is installed and which version you have. The notice for 20.04 LTS lists 4.93-13ubuntu1.12+esm2 as the fixed version; for other releases compare against the version in the Ubuntu notice for your release.

Show the installed exim4 package versions (Ubuntu)Shell
apt list --installed 2>/dev/null | grep -i exim4

This shows whether Exim is accepting connections from the network, which determines how exposed the SMTP-facing bug is. Look for a listener on port 25 or other SMTP ports.

List listening sockets for Exim (Ubuntu, run as root)Shell
ss -tlnp | grep -i exim

To see which Exim features your configuration uses, which matters for the original CVEs, search the config for the operators involved. The path below is the standard Debian/Ubuntu location, and a split configuration may spread settings across several files.

Search Exim configuration for JSON and UTF-8 operators (read-only)Shell
grep -rnE 'json|from_utf8|utf8' /etc/exim4/ 2>/dev/null

What to do now

  1. Inventory every Ubuntu host running exim4, including relays, staging and legacy servers.
  2. Update the package lists and upgrade exim4 so you receive the USN-8228-2 build, not only the one from USN-8228-1.
  3. On Ubuntu 20.04 LTS, make sure Ubuntu Pro is attached, because the fix is delivered through ESM.
  4. Restart Exim after the upgrade if the package did not do it, then confirm the running version.
  5. Verify that mail still flows: send a test message and check the Exim log for errors, particularly around DNS lookups.
  6. If you cannot patch immediately, restrict SMTP access with a firewall to known senders and avoid exposing Exim to the open internet where possible.
  7. Review logs for crashes or odd SMTP replies since your first update (see the monitoring section).

This upgrades only the exim4 packages and does not change other software on the host.

Refresh package lists and upgrade the Exim packages (Ubuntu, run as root)Shell
apt update && apt install --only-upgrade exim4 exim4-daemon-light exim4-daemon-heavy
Caution. Restarting Exim briefly interrupts mail reception and delivery. Do it in a quiet window and keep a second MX or a queue-friendly sender in mind for busy mail servers. If a package is not installed on your system (for example only the light daemon is present), apt may report that; adjust the package list to what you actually have.
Restart Exim and check that it is running (Ubuntu, systemd)Shell
systemctl restart exim4 && systemctl status exim4 --no-pager
Tip. Ubuntu notes that a standard system update makes the necessary changes. If you use unattended upgrades, still confirm the installed version manually, since the regression came from an update you may already have applied automatically.

Detection and monitoring

Neither the research nor Ubuntu reports active exploitation of the regression or the BDAT/RSET leak. The EPSS estimates published for the original CVEs are low (for example 0.631% for CVE-2026-40684 per the GitHub advisory), but a probability score is not a guarantee, and mail servers are routinely probed.

Useful things to watch after patching:

  • Exim processes that crash or restart unexpectedly, visible in the system journal.
  • Unusual SMTP sessions that use BDAT followed by RSET, or replies containing unexpected binary-looking data.
  • Error messages in SMTP rejections that contain content you do not recognize, relevant to the UTF-8 information-leak class.
  • Spikes in DNS failures or malformed PTR lookups in the Exim main log.
Check recent Exim service log entries for crashes or errors (Ubuntu, systemd)Shell
journalctl -u exim4 --since '7 days ago' --no-pager | grep -iE 'segfault|signal|abort|error'

For the outside view of your servers, a security scan of a verified host can show which services are exposed to the internet, and monitoring can alert you to certificate or DNS changes on your mail domains. Neither replaces patching the server itself.

Why a regression matters

Memory-safety bugs such as out-of-bounds reads often get fixed by small parsing changes, and small changes can introduce new edge cases. That is what Ubuntu describes here: a fix for a DNS-handling crash that itself read past a buffer. The practical lesson is to treat security updates as a sequence. After a major fix, watch for a follow-up notice from your distribution and re-check your version a few days later. For broader habits, see our guide to small business website security.

Sources

This article is based on the public sources below. Details can change as vendors and researchers publish more; check the original advisories before acting on version numbers.

  1. CVE-2026-40684 - GitHub Advisory Databasegithub.com
  2. Support musl libc dn_expand oddity · 628bbaca76code.exim.org
  3. CVE-2026-40685 - GitHub Advisory Databasegithub.com
  4. when dewrap, only skip \ if associated char · 9fdc057e71code.exim.org
  5. CVE-2026-40686 - GitHub Advisory Databasegithub.com
  6. Expansions: harden for malformed UTF-8 · f2570bde16code.exim.org
  7. USN-8228-2: Exim regression | Ubuntu security notices | Ubuntuubuntu.com ·
  • Exim
  • Ubuntu
  • USN-8228-2
  • mail server
  • patching