Jenkins Script Security Plugin Sandbox Bypass Vulnerability — Jenkins Script Security Plugin contains a protection mechanism failure, allowing an attacker to bypass the sandbox.
CVE-2019-1003029 is a critical sandbox bypass vulnerability in the Jenkins Script Security Plugin with a CVSS score of 9.0. An authenticated attacker can escape the Groovy sandbox restrictions, enabling arbitrary code execution on the Jenkins server. This vulnerability poses severe risk to CI/CD pipelines and DevOps infrastructure, potentially allowing full system compromise. Active exploits are publicly available, making immediate patching essential.
Immediate Actions:
1. Identify all Jenkins instances running Script Security Plugin versions prior to 1.52 and prioritize them for emergency patching.
2. Restrict access to Jenkins to trusted internal networks and VPN only — block external exposure immediately.
3. Audit all Pipeline and Job DSL scripts for suspicious Groovy code that may indicate exploitation attempts.
Patching Guidance:
4. Update Jenkins Script Security Plugin to version 1.52 or later via Jenkins Plugin Manager (Manage Jenkins > Manage Plugins > Updates).
5. Also update Pipeline: Groovy Plugin and Pipeline: Shared Groovy Libraries Plugin as they share the same sandbox mechanism.
Compensating Controls (if patching is delayed):
6. Disable Groovy sandbox-based scripts entirely and require administrator approval for all scripts.
7. Implement role-based access control (RBAC) using the Role Strategy Plugin to limit who can create/modify pipelines.
8. Enable Jenkins audit logging and forward logs to SIEM for anomaly detection.
Detection Rules:
9. Monitor for unusual process spawning from Jenkins (java.exe or jenkins.war spawning cmd, bash, powershell, curl, wget).
10. Create SIEM alerts for Jenkins API calls to /script or /scriptText endpoints from non-admin accounts.
11. Search logs for ClassLoader, Runtime.exec, ProcessBuilder patterns in Groovy script submissions.
الإجراءات الفورية:
1. تحديد جميع نسخ Jenkins التي تعمل بإصدارات Script Security Plugin أقدم من 1.52 وإعطاؤها الأولوية للتصحيح الطارئ.
2. تقييد الوصول إلى Jenkins على الشبكات الداخلية الموثوقة والـ VPN فقط، وحجب أي تعرض خارجي فوراً.
3. مراجعة جميع سكريبتات Pipeline وJob DSL بحثاً عن أكواد Groovy مشبوهة قد تدل على محاولات استغلال.
إرشادات التصحيح:
4. تحديث Jenkins Script Security Plugin إلى الإصدار 1.52 أو أحدث عبر مدير الإضافات (Manage Jenkins > Manage Plugins > Updates).
5. تحديث إضافات Pipeline: Groovy وPipeline: Shared Groovy Libraries أيضاً لأنها تشترك في آلية الصندوق الأمني ذاتها.
ضوابط تعويضية (في حال تأخر التصحيح):
6. تعطيل سكريبتات Groovy المعتمدة على الصندوق الأمني وإلزام موافقة المسؤول على جميع السكريبتات.
7. تطبيق التحكم في الوصول المبني على الأدوار (RBAC) باستخدام Role Strategy Plugin للحد من صلاحيات إنشاء وتعديل الـ Pipelines.
8. تفعيل تسجيل التدقيق في Jenkins وإرسال السجلات إلى نظام SIEM لرصد الشذوذات.
قواعد الكشف:
9. مراقبة عمليات غير معتادة تنبثق من Jenkins مثل تشغيل cmd أو bash أو powershell أو curl أو wget.
10. إنشاء تنبيهات SIEM لاستدعاءات Jenkins API على نقاط /script أو /scriptText من حسابات غير إدارية.
11. البحث في السجلات عن أنماط ClassLoader وRuntime.exec وProcessBuilder في طلبات سكريبتات Groovy.