CVE-2024-39929

5.4 MEDIUM

📋 TL;DR

This vulnerability in Exim mail servers allows attackers to bypass filename extension filtering by using specially crafted multiline RFC 2231 headers. Attackers can deliver executable attachments that would normally be blocked, potentially delivering malware to end users' mailboxes. Organizations running vulnerable Exim versions as mail transfer agents are affected.

💻 Affected Systems

Products:
  • Exim
Versions: Through 4.97.1
Operating Systems: Linux, Unix-like systems
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects systems using $mime_filename extension blocking. Systems without this protection mechanism are not vulnerable to this specific bypass.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers deliver executable malware attachments directly to user mailboxes, bypassing security filters, leading to malware execution and potential system compromise.

🟠

Likely Case

Attackers deliver executable attachments that bypass filename filtering, increasing phishing and malware delivery success rates.

🟢

If Mitigated

With proper attachment scanning and user education, the risk is reduced to nuisance spam or blocked by additional security layers.

🌐 Internet-Facing: HIGH
🏢 Internal Only: LOW

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires sending specially crafted emails but does not require authentication to the mail server.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 4.98-RC3 and later

Vendor Advisory: https://bugs.exim.org/show_bug.cgi?id=3099

Restart Required: Yes

Instructions:

1. Download Exim 4.98-RC3 or later from exim.org. 2. Compile and install following Exim documentation. 3. Restart Exim service. 4. Verify version with 'exim -bV'.

🔧 Temporary Workarounds

Enhanced attachment filtering

all

Implement additional attachment scanning beyond filename extension checks

Disable problematic MIME handling

linux

Configure Exim to reject or sanitize RFC 2231 headers

Add to Exim configuration: 'untrusted_set_sender = *' and appropriate ACL rules

🧯 If You Can't Patch

  • Implement external email filtering/gateway with attachment scanning
  • Enable additional antivirus/antimalware scanning on mail server and endpoints

🔍 How to Verify

Check if Vulnerable:

Check Exim version with 'exim -bV | head -1'. If version is 4.97.1 or earlier, system is vulnerable.

Check Version:

exim -bV | head -1

Verify Fix Applied:

After patching, verify version is 4.98-RC3 or later with 'exim -bV | head -1'.

📡 Detection & Monitoring

Log Indicators:

  • Unusual multiline header patterns in email logs
  • Failed attachment blocking events followed by deliveries

Network Indicators:

  • Emails with multiline RFC 2231 headers containing executable extensions

SIEM Query:

source="exim" AND "RFC2231" AND ("exe" OR "bat" OR "sh" OR executable extension)

🔗 References

📤 Share & Export