Apache Tomcat on Windows Remote Code Execution Vulnerability — When running Apache Tomcat on Windows with HTTP PUTs enabled, it is possible to upload a JSP file to the server via a specially crafted request. This JSP could then be requested and any code it contained would be executed by the server.
CVE-2017-12615 is a critical remote code execution vulnerability in Apache Tomcat running on Windows systems with HTTP PUT method enabled. An attacker can upload a malicious JSP file via a specially crafted PUT request, which is then executed by the server, leading to full system compromise. This vulnerability has a CVSS score of 9.0, known public exploits are available, and it has been actively exploited in the wild. Despite being discovered in 2017, unpatched Tomcat instances remain a significant risk, particularly in legacy environments.
Immediate Actions:
1. Identify all Apache Tomcat instances running on Windows across your environment using asset discovery tools
2. Disable HTTP PUT method immediately if not required by setting 'readonly' parameter to 'true' in the default servlet configuration (web.xml)
3. Implement WAF rules to block PUT requests containing .jsp extensions or trailing special characters
Patching Guidance:
4. Upgrade Apache Tomcat to patched versions: 7.0.81+, 8.0.46+, 8.5.22+, or 9.0.1+
5. For latest security, upgrade to the most current stable release of Tomcat
Compensating Controls:
6. Restrict network access to Tomcat management interfaces using firewall rules
7. Implement file integrity monitoring on Tomcat webapps directories to detect unauthorized JSP uploads
8. Deploy IDS/IPS signatures for CVE-2017-12615 exploitation attempts
9. Run Tomcat with least-privilege accounts, not as SYSTEM or Administrator
Detection Rules:
10. Monitor HTTP PUT requests to Tomcat servers, especially those targeting .jsp, .jspx files or using trailing spaces/slashes
11. Alert on new .jsp file creation in webapps directories
12. Search logs for patterns: PUT requests with filenames ending in %20, ::$DATA, or trailing slash
الإجراءات الفورية:
1. تحديد جميع خوادم Apache Tomcat العاملة على Windows في بيئتكم باستخدام أدوات اكتشاف الأصول
2. تعطيل طريقة HTTP PUT فوراً إذا لم تكن مطلوبة عبر ضبط معامل 'readonly' إلى 'true' في إعدادات السيرفلت الافتراضي (web.xml)
3. تطبيق قواعد جدار حماية تطبيقات الويب لحظر طلبات PUT التي تحتوي على امتدادات .jsp أو أحرف خاصة
إرشادات التحديث:
4. ترقية Apache Tomcat إلى الإصدارات المصححة: 7.0.81+ أو 8.0.46+ أو 8.5.22+ أو 9.0.1+
5. للحصول على أحدث الحماية، الترقية إلى أحدث إصدار مستقر من Tomcat
الضوابط التعويضية:
6. تقييد الوصول الشبكي لواجهات إدارة Tomcat باستخدام قواعد جدار الحماية
7. تطبيق مراقبة سلامة الملفات على مجلدات تطبيقات Tomcat لاكتشاف رفع ملفات JSP غير المصرح بها
8. نشر توقيعات أنظمة كشف ومنع التسلل لمحاولات استغلال CVE-2017-12615
9. تشغيل Tomcat بحسابات ذات صلاحيات محدودة وليس كمسؤول نظام
قواعد الكشف:
10. مراقبة طلبات HTTP PUT لخوادم Tomcat خاصة تلك التي تستهدف ملفات .jsp أو .jspx
11. التنبيه عند إنشاء ملفات .jsp جديدة في مجلدات التطبيقات
12. البحث في السجلات عن أنماط طلبات PUT بأسماء ملفات تنتهي بـ %20 أو ::$DATA أو شرطة مائلة