Jenkins Remote Code Execution Vulnerability — Jenkins contains a remote code execution vulnerability. This vulnerability that could allowed attackers to transfer a serialized Java SignedObject object to the remoting-based Jenkins CLI, that would be deserialized using a new ObjectInputStream, bypassing the existing blocklist-based protection mechanism.
CVE-2017-1000353 is a critical remote code execution vulnerability in Jenkins that allows unauthenticated attackers to execute arbitrary code by exploiting Java deserialization flaws in the remoting-based CLI. The vulnerability bypasses existing blocklist protections by using a serialized Java SignedObject. Public exploits are readily available, making this highly dangerous for any exposed Jenkins instance. Despite being from 2017, unpatched Jenkins servers remain actively targeted in the wild.
Immediate Actions:
1. Identify all Jenkins instances in your environment, especially those exposed to the internet
2. Upgrade Jenkins to version 2.54 or later (LTS: 2.46.2 or later) which patches this vulnerability
3. If immediate patching is not possible, disable the Jenkins CLI remoting protocol by navigating to Manage Jenkins > Configure Global Security > CLI and selecting 'Disable remoting'
Compensating Controls:
- Restrict network access to Jenkins instances using firewall rules — never expose Jenkins directly to the internet
- Implement reverse proxy with authentication in front of Jenkins
- Enable Jenkins security realm and authorization strategy
- Monitor for suspicious deserialization attempts in Jenkins logs
Detection Rules:
- Monitor for unusual POST requests to Jenkins CLI endpoint (/cli)
- Alert on unexpected Java process spawning from Jenkins
- Deploy network IDS signatures for Java deserialization exploit patterns
- Monitor for outbound connections from Jenkins to unusual destinations
الإجراءات الفورية:
1. تحديد جميع مثيلات Jenkins في بيئتك، خاصة المكشوفة على الإنترنت
2. ترقية Jenkins إلى الإصدار 2.54 أو أحدث (LTS: 2.46.2 أو أحدث) الذي يصحح هذه الثغرة
3. إذا لم يكن التحديث الفوري ممكناً، قم بتعطيل بروتوكول الاتصال عن بُعد لواجهة سطر الأوامر من خلال إدارة Jenkins > تكوين الأمان العام > CLI واختيار 'تعطيل الاتصال عن بُعد'
الضوابط التعويضية:
- تقييد الوصول الشبكي لمثيلات Jenkins باستخدام قواعد جدار الحماية — لا تعرض Jenkins مباشرة على الإنترنت
- تنفيذ وكيل عكسي مع مصادقة أمام Jenkins
- تفعيل نطاق أمان Jenkins واستراتيجية التفويض
- مراقبة محاولات إلغاء التسلسل المشبوهة في سجلات Jenkins
قواعد الكشف:
- مراقبة طلبات POST غير العادية لنقطة نهاية CLI في Jenkins
- التنبيه عند إنشاء عمليات Java غير متوقعة من Jenkins
- نشر توقيعات IDS للشبكة لأنماط استغلال إلغاء تسلسل Java
- مراقبة الاتصالات الصادرة من Jenkins إلى وجهات غير معتادة