medium CVSS 6.5 EPSS 0.58%

CVE-2026-40685·Exim vulnerability

In Exim before 4.99.2, when JSON lookup is enabled, an out-of-bounds heap write can occur when a JSON operator encounters malformed JSON in an untrusted header, because of an incorrect implementation of \ skipping.

Severity
medium
Software
Exim
Fixed in
4.99.2
Published

How likely is exploitation

FIRST's Exploit Prediction Scoring System puts the probability of this CVE being exploited in the next 30 days at 0.58% — higher than 46% of all published CVEs. EPSS is an independent forecast of exploitation, not a severity rating: it says nothing about how much damage a successful attack does, which is what a CVSS score measures.

Affected versions

Until: 4.99.2

Fixed in: 4.99.2

How to fix this CVE

Upgrade Exim to version 4.99.2 or later to patch a heap memory corruption vulnerability triggered by malformed JSON in email headers when the JSON lookup feature is enabled. This vulnerability could allow attackers to cause denial of service or potentially execute arbitrary code on mail servers processing untrusted messages. Ensure your mail server configuration validates and sanitizes incoming headers before processing.

sudo dnf update exim

Defensia detects this vulnerability

How to check if you are affected

  1. Run `exim -bV | grep Exim` to check the currently installed Exim version and confirm it is below 4.99.2
  2. Verify JSON lookup is enabled by checking the Exim configuration with `exim -bP | grep -i json` or reviewing /etc/exim4/exim4.conf for json lookup directives
  3. Search mail logs for malformed JSON patterns with `grep -i 'json.*error\|json.*invalid\|json.*malformed' /var/log/exim4/mainlog`
  4. After patching, run `exim -bV | grep Exim` again to confirm the version is 4.99.2 or higher

FAQ

What is CVE-2026-40685?

This vulnerability is a heap buffer overflow in Exim's JSON lookup feature that occurs when processing specially crafted malformed JSON contained in untrusted email headers. The flaw stems from incorrect escape sequence handling and can lead to memory corruption.

Is CVE-2026-40685 being actively exploited?

No, this vulnerability is not currently listed in the CISA Known Exploited Vulnerabilities (KEV) catalog and no public exploits are available, but it should still be patched promptly to prevent future exploitation.

What versions of Exim are affected by CVE-2026-40685?

All versions of Exim before 4.99.2 are affected. The vulnerability exists in all releases that support the JSON lookup feature with the flawed escape sequence implementation.

How do I check if my server is vulnerable to CVE-2026-40685?

Run `exim -bV` to display your Exim version. If the version is below 4.99.2, your server is vulnerable. Additionally, confirm JSON lookup is enabled in your configuration file.

Does Defensia detect CVE-2026-40685?

Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If Exim is installed on a monitored server, CVE-2026-40685 will appear in your dashboard with remediation steps.

Related Exim CVEs

References

Track CVEs across your fleet automatically

Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2026-40685. Free for 1 server.

Get started free