CVE-2019-13917

9.8 CRITICAL

📋 TL;DR

CVE-2019-13917 is a critical remote code execution vulnerability in Exim mail servers that allows attackers to execute arbitrary commands as root in certain configurations. It affects Exim versions 4.85 through 4.92 when using the ${sort } expansion feature with attacker-controlled variables like $local_part or $domain. Organizations running vulnerable Exim configurations are at risk of complete system compromise.

💻 Affected Systems

Products:
  • Exim
Versions: 4.85 through 4.92
Operating Systems: Linux, Unix-like systems
Default Config Vulnerable: ✅ No
Notes: Only vulnerable in configurations using ${sort } expansion with attacker-controlled variables. Many default configurations are not affected.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote attacker gains root shell access on the Exim server, leading to complete system compromise, data theft, and potential lateral movement within the network.

🟠

Likely Case

Remote code execution as root on vulnerable Exim servers, allowing attackers to install malware, create backdoors, or use the server as a pivot point.

🟢

If Mitigated

Limited impact if proper network segmentation and least privilege principles are applied, though the vulnerability still allows root access on the affected system.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: CONFIRMED
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploits have been publicly available since disclosure. The vulnerability requires specific configuration conditions but is easily exploitable when those conditions are met.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 4.92.1

Vendor Advisory: http://exim.org/static/doc/security/CVE-2019-13917.txt

Restart Required: Yes

Instructions:

1. Download Exim 4.92.1 or later from exim.org
2. Stop Exim service: systemctl stop exim
3. Install the new version following vendor instructions
4. Restart Exim: systemctl start exim
5. Verify the patch is applied

🔧 Temporary Workarounds

Disable vulnerable sort expansion

linux

Remove or disable configurations using ${sort } expansion with user-controlled variables

Review Exim configuration files for ${sort } usage
Comment out or remove vulnerable configurations

🧯 If You Can't Patch

  • Implement strict network controls to limit access to Exim service
  • Monitor for exploitation attempts and unusual process activity

🔍 How to Verify

Check if Vulnerable:

Check Exim version with: exim -bV | grep version
If version is between 4.85 and 4.92 inclusive, check configuration for ${sort } usage with $local_part or $domain variables.

Check Version:

exim -bV | grep version

Verify Fix Applied:

Verify Exim version is 4.92.1 or later: exim -bV | grep version
Ensure no vulnerable ${sort } configurations remain.

📡 Detection & Monitoring

Log Indicators:

  • Unusual ${sort } expansion in Exim logs
  • Unexpected command execution in system logs
  • Failed authentication attempts followed by sort operations

Network Indicators:

  • Unusual SMTP traffic patterns
  • Exploit payloads in network traffic

SIEM Query:

source="exim.log" AND "${sort"

🔗 References

📤 Share & Export