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.
| CVE | Condition | CVSS | Impact |
|---|---|---|---|
| CVE-2026-40684 | Exim built on musl libc (not glibc); malformed PTR record data | 5.9 (medium) | Crash of the connection instance |
| CVE-2026-40685 | JSON lookup enabled; malformed JSON in an untrusted header | 6.5 (medium) | Out-of-bounds heap write |
| CVE-2026-40686 | utf8 operators enabled; malformed UTF-8 header data | 3.7 (low) | Out-of-bounds read, possible information in an error message |
| CVE-2026-40687 | SPA authenticator input | Not given in the research | Out-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.
apt list --installed 2>/dev/null | grep -i exim4This 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.
ss -tlnp | grep -i eximTo 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.
grep -rnE 'json|from_utf8|utf8' /etc/exim4/ 2>/dev/nullWhat to do now
- Inventory every Ubuntu host running exim4, including relays, staging and legacy servers.
- Update the package lists and upgrade exim4 so you receive the USN-8228-2 build, not only the one from USN-8228-1.
- On Ubuntu 20.04 LTS, make sure Ubuntu Pro is attached, because the fix is delivered through ESM.
- Restart Exim after the upgrade if the package did not do it, then confirm the running version.
- Verify that mail still flows: send a test message and check the Exim log for errors, particularly around DNS lookups.
- If you cannot patch immediately, restrict SMTP access with a firewall to known senders and avoid exposing Exim to the open internet where possible.
- 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.
apt update && apt install --only-upgrade exim4 exim4-daemon-light exim4-daemon-heavysystemctl restart exim4 && systemctl status exim4 --no-pagerDetection 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.
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.
- CVE-2026-40684 - GitHub Advisory Database
- Support musl libc dn_expand oddity · 628bbaca76
- CVE-2026-40685 - GitHub Advisory Database
- when dewrap, only skip \ if associated char · 9fdc057e71
- CVE-2026-40686 - GitHub Advisory Database
- Expansions: harden for malformed UTF-8 · f2570bde16
- USN-8228-2: Exim regression | Ubuntu security notices | Ubuntu
