Endian Firewall version 3.3.25 and prior allow authenticated users to execute arbitrary OS commands via the DATE parameter to /cgi-bin/logs_ids.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 critical command injection vulnerability in the logs_ids.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 gain full system control. This poses significant risk to Saudi organizations using Endian Firewall as perimeter security, particularly in banking and government sectors where firewall compromise could lead to lateral movement and data exfiltration.
IMMEDIATE ACTIONS:
1. Identify all Endian Firewall instances running version 3.3.25 or earlier in your environment
2. Restrict administrative access to /cgi-bin/logs_ids.cgi to trusted IP addresses only via firewall rules
3. Implement network segmentation to isolate firewall management interfaces
4. Review authentication logs for suspicious access patterns to logs_ids.cgi
5. Monitor for command injection patterns in firewall logs (shell metacharacters in DATE parameter)
PATCHING GUIDANCE:
1. Contact Endian support immediately to request security patches or upgrade timeline
2. If no patch is available, plan immediate upgrade to latest Endian Firewall version
3. Test patches in isolated lab environment before production deployment
4. Coordinate with SAMA/NCA for critical infrastructure notification if applicable
COMPENSATING CONTROLS (if patching delayed):
1. Implement Web Application Firewall (WAF) rules to block requests with shell metacharacters (|, ;, &, $, `, >, <) in DATE parameter
2. Disable CGI access to logs_ids.cgi if functionality not required
3. Implement strict input validation at network edge: whitelist only valid date formats (YYYY-MM-DD)
4. Deploy intrusion detection signatures for command injection attempts
5. Enforce multi-factor authentication for firewall administrative access
6. Implement privileged access management (PAM) for firewall admin accounts
DETECTION RULES:
1. Alert on HTTP requests to /cgi-bin/logs_ids.cgi containing: pipe (|), semicolon (;), backtick (`), dollar sign ($), ampersand (&), or newline characters in DATE parameter
2. Monitor for Endian Firewall process spawning unexpected child processes (bash, sh, perl)
3. Alert on file access patterns from Endian Firewall process to /etc/passwd, /etc/shadow, or system binaries
4. Detect unusual outbound connections from Endian Firewall management interface
5. Monitor syslog for Perl errors or warnings from logs_ids.cgi execution
الإجراءات الفورية:
1. تحديد جميع مثيلات Endian Firewall التي تعمل بالإصدار 3.3.25 أو الإصدارات السابقة في بيئتك
2. تقييد الوصول الإداري إلى /cgi-bin/logs_ids.cgi إلى عناوين IP موثوقة فقط عبر قواعد جدار الحماية
3. تنفيذ تقسيم الشبكة لعزل واجهات إدارة جدار الحماية
4. مراجعة سجلات المصادقة للبحث عن أنماط وصول مريبة إلى logs_ids.cgi
5. مراقبة أنماط حقن الأوامر في سجلات جدار الحماية (أحرف shell في معامل DATE)
إرشادات التصحيح:
1. اتصل بدعم Endian على الفور لطلب تصحيحات أمان أو جدول زمني للترقية
2. إذا لم يكن هناك تصحيح متاح، خطط للترقية الفورية إلى أحدث إصدار من Endian Firewall
3. اختبر التصحيحات في بيئة معملية معزولة قبل نشر الإنتاج
4. تنسيق مع SAMA/NCA لإخطار البنية التحتية الحرجة إن أمكن
الضوابط البديلة (إذا تأخر التصحيح):
1. تنفيذ قواعد جدار تطبيقات الويب (WAF) لحظر الطلبات التي تحتوي على أحرف shell (|، ;، &، $، `، >، <) في معامل DATE
2. تعطيل وصول CGI إلى logs_ids.cgi إذا لم تكن الوظيفة مطلوبة
3. تنفيذ التحقق من صحة الإدخال الصارم على حافة الشبكة: قائمة بيضاء بصيغ التاريخ الصحيحة فقط (YYYY-MM-DD)
4. نشر توقيعات كشف الاختراق لمحاولات حقن الأوامر
5. فرض المصادقة متعددة العوامل لوصول إدارة جدار الحماية
6. تنفيذ إدارة الوصول المميز (PAM) لحسابات مسؤول جدار الحماية
قواعد الكشف:
1. تنبيه على طلبات HTTP إلى /cgi-bin/logs_ids.cgi تحتوي على: أنبوب (|)، فاصلة منقوطة (;)، علامة خلفية (`)، علامة دولار ($)، علامة العطف (&)، أو أحرف سطر جديد في معامل DATE
2. مراقبة عمليات Endian Firewall التي تولد عمليات فرعية غير متوقعة (bash، sh، perl)
3. تنبيه على أنماط الوصول إلى الملفات من عملية Endian Firewall إلى /etc/passwd أو /etc/shadow أو ثنائيات النظام
4. كشف الاتصالات الصادرة غير العادية من واجهة إدارة Endian Firewall
5. مراقبة syslog لأخطاء Perl أو تحذيرات من تنفيذ logs_ids.cgi