Wazuh wazuh-agent and wazuh-manager versions 2.1.0 before 4.8.0 contain multiple shell injection and untrusted search path vulnerabilities that allow attackers to execute arbitrary commands through various components including logcollector configuration, maild SMTP server tags, and Kaspersky AR script parameters. Attackers can exploit these vulnerabilities by injecting malicious commands through configuration files, SMTP server settings, and custom flags to achieve remote code execution on affected systems.
Wazuh agent and manager versions 2.1.0 through 4.7.x contain multiple shell injection vulnerabilities (CWE-94) allowing arbitrary command execution through configuration files, SMTP settings, and script parameters. While no public exploit is available, the vulnerability affects security monitoring infrastructure critical to Saudi organizations. Immediate upgrade to version 4.8.0 or later is essential to prevent compromise of security operations centers.
IMMEDIATE ACTIONS:
1. Identify all Wazuh agent and manager deployments running versions 2.1.0-4.7.x
2. Restrict access to Wazuh configuration files (/var/ossec/etc/) to authorized administrators only
3. Implement file integrity monitoring on Wazuh configuration directories
4. Review and audit all logcollector configurations, maild SMTP settings, and custom scripts for suspicious content
5. Disable unused Wazuh modules (maild, custom AR scripts) if not required
PATCHING:
6. Upgrade to Wazuh 4.8.0 or later immediately (patch available)
7. Test patches in non-production environment first
8. Plan phased rollout for manager and agent upgrades
COMPENSATING CONTROLS (if immediate patching delayed):
9. Implement strict input validation on all configuration file sources
10. Use configuration management tools (Ansible, Puppet) with change tracking
11. Monitor Wazuh process execution for suspicious child processes
12. Implement network segmentation isolating Wazuh infrastructure
13. Enable Wazuh audit logging for all configuration changes
DETECTION:
14. Monitor for shell metacharacters in Wazuh config files: $(), ``, |, &, ;, >, <
15. Alert on unexpected child processes spawned by wazuh-agent/wazuh-manager
16. Track modifications to /var/ossec/etc/ossec.conf and related configs
17. Monitor SMTP server tag modifications in maild configuration
الإجراءات الفورية:
1. تحديد جميع نشرات وكيل وزوه ومدير تعمل بالإصدارات 2.1.0-4.7.x
2. تقييد الوصول إلى ملفات تكوين وزوه (/var/ossec/etc/) للمسؤولين المصرحين فقط
3. تنفيذ مراقبة سلامة الملفات على أدلة تكوين وزوه
4. مراجعة وتدقيق جميع تكوينات logcollector وإعدادات SMTP للبريد والبرامج النصية المخصصة
5. تعطيل وحدات وزوه غير المستخدمة (maild، البرامج النصية المخصصة) إذا لم تكن مطلوبة
التصحيح:
6. الترقية إلى وزوه 4.8.0 أو أحدث فورًا (التصحيح متاح)
7. اختبار التصحيحات في بيئة غير الإنتاج أولاً
8. التخطيط للتطبيق المرحلي لترقيات المدير والوكيل
الضوابط البديلة (إذا تأخر التصحيح الفوري):
9. تنفيذ التحقق الصارم من المدخلات على جميع مصادر ملفات التكوين
10. استخدام أدوات إدارة التكوين (Ansible، Puppet) مع تتبع التغييرات
11. مراقبة تنفيذ عملية وزوه للعمليات الفرعية المريبة
12. تنفيذ تقسيم الشبكة لعزل البنية التحتية لوزوه
13. تفعيل تسجيل تدقيق وزوه لجميع تغييرات التكوين
الكشف:
14. مراقبة أحرف الأوامر في ملفات تكوين وزوه: $()، ``، |، &، ;، >، <
15. التنبيه على العمليات الفرعية غير المتوقعة التي يتم إطلاقها بواسطة wazuh-agent/wazuh-manager
16. تتبع التعديلات على /var/ossec/etc/ossec.conf والتكوينات ذات الصلة
17. مراقبة تعديلات علامات خادم SMTP في تكوين البريد