Roundcube Webmail Remote Code Execution Vulnerability — Roundcube Webmail contains an remote code execution vulnerability that allows attackers to execute code via shell metacharacters in a configuration setting for im_convert_path or im_identify_path.
CVE-2020-12641 is a critical remote code execution vulnerability in Roundcube Webmail (CVSS 9.0) that allows attackers to execute arbitrary code by injecting shell metacharacters into the im_convert_path or im_identify_path configuration settings. This vulnerability can be exploited by an attacker with access to the Roundcube admin panel or through misconfigured deployments, leading to full server compromise. Given the widespread use of Roundcube in enterprise and government email infrastructure, this represents an urgent threat requiring immediate remediation. Active exploits are publicly available, significantly elevating the risk of exploitation in the wild.
IMMEDIATE ACTIONS:
1. Identify all Roundcube Webmail instances in your environment immediately.
2. Restrict access to the Roundcube admin panel to trusted IP addresses only via firewall rules.
3. Audit current im_convert_path and im_identify_path configuration values for any suspicious shell metacharacters (e.g., ;, |, &, $, `, >, <).
4. Disable image processing features (ImageMagick integration) temporarily if patching cannot be done immediately.
PATCHING GUIDANCE:
5. Upgrade Roundcube Webmail to version 1.4.4 or later, which contains the official fix for this vulnerability.
6. Verify the integrity of the updated package using official checksums before deployment.
7. After patching, review all configuration files for any unauthorized modifications.
COMPENSATING CONTROLS (if patch cannot be applied immediately):
8. Set im_convert_path and im_identify_path to empty strings or null values in config.inc.php to disable ImageMagick integration.
9. Implement Web Application Firewall (WAF) rules to detect and block shell metacharacter injection attempts.
10. Enable strict input validation at the application layer.
DETECTION RULES:
11. Monitor web server logs for unusual POST requests to Roundcube admin endpoints.
12. Deploy SIEM rules to alert on process spawning from web server processes (e.g., apache2, nginx spawning /bin/sh or /bin/bash).
13. Use EDR solutions to detect anomalous child processes from the Roundcube PHP process.
14. Search for indicators: shell metacharacters in Roundcube config logs, unexpected outbound connections from the mail server.
الإجراءات الفورية:
1. تحديد جميع نسخ Roundcube Webmail في بيئتك فورًا.
2. تقييد الوصول إلى لوحة إدارة Roundcube على عناوين IP موثوقة فقط عبر قواعد جدار الحماية.
3. مراجعة قيم إعدادات im_convert_path و im_identify_path الحالية للكشف عن أي محارف خاصة مشبوهة مثل (;، |، &، $، `).
4. تعطيل ميزات معالجة الصور (تكامل ImageMagick) مؤقتًا إذا تعذّر التصحيح الفوري.
إرشادات التصحيح:
5. ترقية Roundcube Webmail إلى الإصدار 1.4.4 أو أحدث الذي يتضمن الإصلاح الرسمي لهذه الثغرة.
6. التحقق من سلامة الحزمة المحدّثة باستخدام المجاميع الاختبارية الرسمية قبل النشر.
7. بعد التصحيح، مراجعة جميع ملفات الإعداد للكشف عن أي تعديلات غير مصرح بها.
ضوابط التعويض (إذا تعذّر تطبيق التصحيح فورًا):
8. ضبط im_convert_path و im_identify_path على قيم فارغة أو null في ملف config.inc.php لتعطيل تكامل ImageMagick.
9. تطبيق قواعد جدار حماية تطبيقات الويب (WAF) للكشف عن محاولات حقن المحارف الخاصة وحجبها.
10. تفعيل التحقق الصارم من المدخلات على مستوى التطبيق.
قواعد الكشف:
11. مراقبة سجلات خادم الويب للكشف عن طلبات POST غير معتادة على نقاط نهاية إدارة Roundcube.
12. نشر قواعد SIEM للتنبيه عند إنشاء عمليات من عمليات خادم الويب مثل إنشاء apache2 أو nginx لعمليات /bin/sh أو /bin/bash.
13. استخدام حلول EDR للكشف عن العمليات الفرعية الشاذة من عملية PHP الخاصة بـ Roundcube.
14. البحث عن مؤشرات الاختراق: المحارف الخاصة في سجلات إعداد Roundcube، والاتصالات الصادرة غير المتوقعة من خادم البريد.