Apache Struts Deserialization of Untrusted Data Vulnerability — Apache Struts REST Plugin uses an XStreamHandler with an instance of XStream for deserialization without any type filtering, which can lead to remote code execution when deserializing XML payloads.
CVE-2017-9805 is a critical remote code execution vulnerability in the Apache Struts REST plugin caused by unsafe deserialization of XML payloads using XStream without type filtering. This vulnerability has a CVSS score of 9.0 and active exploits are publicly available, making it extremely dangerous for any organization running affected versions of Apache Struts. The vulnerability was famously exploited in the wild and was associated with major breaches including the Equifax data breach. Immediate patching is essential as exploitation requires no authentication and can lead to full system compromise.
IMMEDIATE ACTIONS:
1. Identify all Apache Struts installations across your environment, particularly those using the REST plugin (struts2-rest-plugin)
2. Upgrade Apache Struts to version 2.5.13 or later immediately
3. If immediate patching is not possible, remove or disable the Struts REST plugin if not required
COMPENSATING CONTROLS:
1. Implement Web Application Firewall (WAF) rules to block malicious XML deserialization payloads targeting Struts REST endpoints
2. Block Content-Type headers containing 'application/xml' at the WAF level for Struts REST endpoints if XML is not required
3. Restrict network access to Struts-based applications using network segmentation
4. Monitor for exploitation attempts using IDS/IPS signatures (Snort SID: 44315, 44316)
DETECTION RULES:
1. Monitor for unusual POST requests with XML payloads to Struts REST endpoints
2. Look for process spawning from Java/Tomcat processes (potential RCE indicator)
3. Monitor for outbound connections from web application servers to unusual destinations
4. Check for indicators of XStream deserialization attacks in application logs
5. Deploy YARA rules for known Struts exploitation tools
الإجراءات الفورية:
1. تحديد جميع تثبيتات Apache Struts في بيئتكم، خاصة تلك التي تستخدم إضافة REST (struts2-rest-plugin)
2. ترقية Apache Struts إلى الإصدار 2.5.13 أو أحدث فوراً
3. إذا لم يكن التصحيح الفوري ممكناً، قم بإزالة أو تعطيل إضافة Struts REST إذا لم تكن مطلوبة
الضوابط التعويضية:
1. تطبيق قواعد جدار حماية تطبيقات الويب (WAF) لحظر حمولات إلغاء التسلسل الخبيثة التي تستهدف نقاط نهاية Struts REST
2. حظر رؤوس Content-Type التي تحتوي على 'application/xml' على مستوى WAF لنقاط نهاية Struts REST إذا لم يكن XML مطلوباً
3. تقييد الوصول الشبكي لتطبيقات Struts باستخدام تجزئة الشبكة
4. مراقبة محاولات الاستغلال باستخدام توقيعات IDS/IPS
قواعد الكشف:
1. مراقبة طلبات POST غير العادية مع حمولات XML لنقاط نهاية Struts REST
2. البحث عن عمليات تنشأ من عمليات Java/Tomcat (مؤشر محتمل لتنفيذ التعليمات البرمجية عن بُعد)
3. مراقبة الاتصالات الصادرة من خوادم تطبيقات الويب إلى وجهات غير عادية
4. التحقق من مؤشرات هجمات إلغاء تسلسل XStream في سجلات التطبيق