Endian Firewall version 3.3.25 and prior allow authenticated users to execute arbitrary OS commands via the DATE parameter to /cgi-bin/logs_clamav.cgi. The DATE parameter value is used to construct a file path that is passed to a Perl open() call, which allows command injection due to an incomplete regular expression validation.
Endian Firewall versions 3.3.25 and prior contain a command injection vulnerability in the logs_clamav.cgi module that allows authenticated users to execute arbitrary OS commands via the DATE parameter. The vulnerability exploits incomplete regex validation in Perl's open() function, enabling attackers with valid credentials to achieve remote code execution with firewall privileges. This poses a critical risk to Saudi organizations using Endian Firewall as perimeter security, particularly given the lack of available patches.
IMMEDIATE ACTIONS:
1. Identify all Endian Firewall instances in your environment (versions 3.3.25 and prior) using network discovery tools
2. Restrict administrative access to firewall management interfaces - implement principle of least privilege for admin accounts
3. Monitor firewall logs for suspicious DATE parameter values containing shell metacharacters (|, ;, &, $, `, etc.)
4. Disable or restrict access to /cgi-bin/logs_clamav.cgi if not actively used
COMPENSATING CONTROLS (until patch available):
5. Implement Web Application Firewall (WAF) rules to block requests to logs_clamav.cgi containing command injection patterns
6. Apply input validation at network level - block DATE parameters with special characters
7. Segment firewall management access to dedicated administrative networks
8. Enable comprehensive audit logging for all CGI script access
9. Implement multi-factor authentication for firewall administrative accounts
10. Consider deploying alternative firewall solutions or air-gapping critical Endian instances
DETECTION RULES:
- Alert on POST/GET requests to /cgi-bin/logs_clamav.cgi with DATE parameter containing: pipe (|), semicolon (;), ampersand (&), backtick (`), dollar sign ($), or command substitution patterns
- Monitor firewall process execution logs for unexpected child processes spawned from Perl interpreter
- Track failed authentication attempts followed by successful CGI access
- Log all modifications to firewall rules or configurations
الإجراءات الفورية:
1. تحديد جميع مثيلات Endian Firewall في بيئتك (الإصدارات 3.3.25 وما قبلها) باستخدام أدوات اكتشاف الشبكة
2. تقييد الوصول الإداري إلى واجهات إدارة جدار الحماية - تطبيق مبدأ الامتياز الأقل للحسابات الإدارية
3. مراقبة سجلات جدار الحماية للقيم المريبة لمعامل DATE التي تحتوي على أحرف shell (|، ;، &، $، `، إلخ)
4. تعطيل أو تقييد الوصول إلى /cgi-bin/logs_clamav.cgi إذا لم يكن قيد الاستخدام النشط
الضوابط التعويضية (حتى توفر التصحيح):
5. تطبيق قواعد جدار تطبيقات الويب (WAF) لحظر الطلبات إلى logs_clamav.cgi التي تحتوي على أنماط حقن الأوامر
6. تطبيق التحقق من الإدخال على مستوى الشبكة - حظر معاملات DATE بأحرف خاصة
7. تقسيم الوصول إلى إدارة جدار الحماية إلى شبكات إدارية مخصصة
8. تفعيل تسجيل التدقيق الشامل لجميع عمليات الوصول إلى البرامج النصية CGI
9. تطبيق المصادقة متعددة العوامل لحسابات جدار الحماية الإدارية
10. النظر في نشر حلول جدار حماية بديلة أو عزل مثيلات Endian الحرجة
قواعد الكشف:
- تنبيه على طلبات POST/GET إلى /cgi-bin/logs_clamav.cgi مع معامل DATE يحتوي على: أنبوب (|)، فاصلة منقوطة (;)، علامة العطف (&)، علامة خلفية (`)، علامة دولار ($)، أو أنماط استبدال الأوامر
- مراقبة سجلات تنفيذ عمليات جدار الحماية للعمليات الفرعية غير المتوقعة التي تم إطلاقها من مترجم Perl
- تتبع محاولات المصادقة الفاشلة متبوعة بالوصول الناجح إلى CGI
- تسجيل جميع التعديلات على قواعد جدار الحماية أو التكوينات