Roxy-WI is a web interface for managing Haproxy, Nginx, Apache and Keepalived servers. Prior to version 8.2.6.4, the /config/ < service > /find-in-config endpoint in Roxy-WI fails to sanitize the user-supplied words parameter before embedding it into a shell command string that is subsequently executed on a remote managed server via SSH. An authenticated attacker can inject arbitrary shell metacharacters to break out of the intended grep command context and execute arbitrary OS commands with sudo privileges on the target server, resulting in full Remote Code Execution (RCE). Version 8.2.6.4 patches the issue.
Roxy-WI versions prior to 8.2.6.4 contain a critical command injection vulnerability in the /config/<service>/find-in-config endpoint that allows authenticated attackers to execute arbitrary OS commands with sudo privileges on managed servers. The vulnerability stems from insufficient sanitization of the 'words' parameter before embedding it into shell commands executed via SSH. This affects organizations managing Haproxy, Nginx, Apache, and Keepalived infrastructure across Saudi Arabia's critical sectors.
IMMEDIATE ACTIONS:
1. Identify all Roxy-WI instances in your environment using network scanning and asset inventory tools
2. Restrict access to Roxy-WI web interface to trusted IP ranges only via firewall rules
3. Review SSH access logs and sudo command history on all managed servers for suspicious activity
4. Disable the /config/*/find-in-config endpoint if not actively used
PATCHING:
1. Upgrade Roxy-WI to version 8.2.6.4 or later immediately
2. Test patches in non-production environment first
3. Verify patch application by checking version in Roxy-WI admin panel
COMPENSATING CONTROLS (if immediate patching not possible):
1. Implement Web Application Firewall (WAF) rules to block requests containing shell metacharacters (|, ;, &, $, `, >, <, \n) in the 'words' parameter
2. Configure SSH key-based authentication only (disable password auth)
3. Implement command auditing on managed servers: auditctl -w /usr/bin/sudo -p x
4. Use sudo restrictions: limit Roxy-WI service account to specific commands only
5. Enable MFA for Roxy-WI administrative access
DETECTION RULES:
1. Monitor for HTTP requests to /config/*/find-in-config with special characters in parameters
2. Alert on unexpected sudo command execution from Roxy-WI service account
3. Monitor SSH sessions from Roxy-WI server for command injection patterns
4. Log and alert on any modification to managed server configurations outside normal change windows
الإجراءات الفورية:
1. تحديد جميع مثيلات Roxy-WI في بيئتك باستخدام أدوات المسح الشبكي وجرد الأصول
2. تقييد الوصول إلى واجهة Roxy-WI على نطاقات IP موثوقة فقط عبر قواعد جدار الحماية
3. مراجعة سجلات الوصول SSH وسجل أوامر sudo على جميع الخوادم المُدارة للنشاط المريب
4. تعطيل نقطة النهاية /config/*/find-in-config إذا لم تكن قيد الاستخدام النشط
التصحيح:
1. ترقية Roxy-WI إلى الإصدار 8.2.6.4 أو أحدث على الفور
2. اختبار التصحيحات في بيئة غير الإنتاج أولاً
3. التحقق من تطبيق التصحيح بالتحقق من الإصدار في لوحة إدارة Roxy-WI
الضوابط البديلة (إذا لم يكن التصحيح الفوري ممكناً):
1. تنفيذ قواعد جدار تطبيقات الويب (WAF) لحظر الطلبات التي تحتوي على أحرف metacharacters (|, ;, &, $, `, >, <, \n) في معامل 'words'
2. تكوين المصادقة القائمة على مفتاح SSH فقط (تعطيل مصادقة كلمة المرور)
3. تنفيذ تدقيق الأوامر على الخوادم المُدارة: auditctl -w /usr/bin/sudo -p x
4. استخدام قيود sudo: حد من حساب خدمة Roxy-WI إلى أوامر محددة فقط
5. تفعيل MFA للوصول الإداري إلى Roxy-WI
قواعد الكشف:
1. مراقبة طلبات HTTP إلى /config/*/find-in-config بأحرف خاصة في المعاملات
2. تنبيه على تنفيذ أوامر sudo غير متوقعة من حساب خدمة Roxy-WI
3. مراقبة جلسات SSH من خادم Roxy-WI لأنماط حقن الأوامر
4. تسجيل والتنبيه على أي تعديل على تكوينات الخادم المُدار خارج نوافذ التغيير العادية