Exim Mail Transfer Agent (MTA) Improper Input Validation — Improper validation of recipient address in deliver_message() function in /src/deliver.c may lead to remote command execution.
CVE-2019-10149 is a critical remote code execution vulnerability in Exim Mail Transfer Agent (MTA) versions 4.87 through 4.91, dubbed 'The Return of the WIZard.' The flaw exists in the deliver_message() function where improper validation of recipient addresses allows attackers to execute arbitrary commands with root privileges. Active exploitation has been confirmed in the wild, with multiple threat actors including nation-state groups leveraging this vulnerability. Immediate patching is essential as Exim is widely deployed across internet-facing mail servers globally and in the Middle East region.
IMMEDIATE ACTIONS (within 24 hours):
1. Identify all Exim instances: run 'exim --version' or 'exim4 --version' across all mail servers
2. Check version — vulnerable range is 4.87 to 4.91 inclusive
3. Isolate internet-facing Exim servers if patching cannot be done immediately
4. Review mail server logs for exploitation indicators: unusual RCPT TO patterns, commands in recipient fields, unexpected child processes spawned by Exim
PATCHING GUIDANCE:
1. Upgrade to Exim 4.92 or later immediately (latest stable version preferred)
2. For Debian/Ubuntu: 'apt-get update && apt-get upgrade exim4'
3. For RHEL/CentOS: obtain patched RPM from vendor or compile from source
4. Restart Exim service after patching: 'systemctl restart exim4'
5. Verify patched version: 'exim --version'
COMPENSATING CONTROLS (if immediate patching is not possible):
1. Restrict SMTP access using firewall rules to trusted IP ranges only
2. Deploy a mail relay/gateway (e.g., Postfix, commercial gateway) in front of vulnerable Exim instances
3. Enable enhanced logging and alerting on SMTP connections
4. Disable local delivery if not required
DETECTION RULES:
1. SIEM alert: Monitor for RCPT TO fields containing shell metacharacters (|, ;, $, backtick)
2. IDS/IPS signature: Detect SMTP RCPT TO with '${run{...}}' patterns
3. Monitor for unusual child processes spawned by Exim (e.g., /bin/sh, wget, curl)
4. Check for new cron jobs, SSH keys, or user accounts created post-exploitation
5. Snort/Suricata rule: alert tcp any any -> any 25 (content:"RCPT TO"; pcre:"/RCPT TO.*\$\{run/i"; msg:"Exim CVE-2019-10149 Exploit Attempt";)
الإجراءات الفورية (خلال 24 ساعة):
1. تحديد جميع نسخ Exim: تشغيل 'exim --version' أو 'exim4 --version' على جميع خوادم البريد
2. التحقق من الإصدار — النطاق المتأثر هو 4.87 إلى 4.91 شاملاً
3. عزل خوادم Exim المكشوفة على الإنترنت إذا تعذّر التصحيح الفوري
4. مراجعة سجلات خادم البريد للكشف عن مؤشرات الاستغلال: أنماط RCPT TO غير معتادة، أوامر في حقول المستلمين، عمليات فرعية غير متوقعة مُطلقة من Exim
إرشادات التصحيح:
1. الترقية إلى Exim 4.92 أو أحدث فورًا (يُفضّل أحدث إصدار مستقر)
2. لـ Debian/Ubuntu: 'apt-get update && apt-get upgrade exim4'
3. لـ RHEL/CentOS: الحصول على RPM المُصحَّح من المورد أو التجميع من المصدر
4. إعادة تشغيل خدمة Exim بعد التصحيح: 'systemctl restart exim4'
5. التحقق من الإصدار المُصحَّح: 'exim --version'
ضوابط التعويض (إذا تعذّر التصحيح الفوري):
1. تقييد الوصول إلى SMTP باستخدام قواعد جدار الحماية لنطاقات IP الموثوقة فقط
2. نشر بوابة/ترحيل بريد (مثل Postfix أو بوابة تجارية) أمام نسخ Exim المعرّضة للخطر
3. تفعيل التسجيل المحسّن والتنبيهات على اتصالات SMTP
4. تعطيل التسليم المحلي إذا لم يكن مطلوبًا
قواعد الكشف:
1. تنبيه SIEM: مراقبة حقول RCPT TO التي تحتوي على محارف خاصة بالصدفة (|، ;، $، backtick)
2. توقيع IDS/IPS: الكشف عن SMTP RCPT TO بأنماط '${run{...}}'
3. مراقبة العمليات الفرعية غير المعتادة المُطلقة من Exim (مثل /bin/sh، wget، curl)
4. التحقق من وجود مهام cron جديدة أو مفاتيح SSH أو حسابات مستخدمين تم إنشاؤها بعد الاستغلال
5. قاعدة Snort/Suricata: alert tcp any any -> any 25 (content:"RCPT TO"; pcre:"/RCPT TO.*\$\{run/i"; msg:"Exim CVE-2019-10149 Exploit Attempt";)