Cockpit CMS through version 2.14.0, patched in commit 72a83fc, contains a stored cross-site scripting vulnerability in the Set field type's Display template option, where the template string is processed by the $interpolate function using new Function() and rendered via Vue's v-html directive without sanitization. An attacker with content/:models/manage permission can inject arbitrary JavaScript into the Display template, which executes in the browser of any user viewing the collection items list.
Cockpit CMS versions through 2.14.0 contain a stored cross-site scripting (XSS) vulnerability in the Set field type's Display template option. An authenticated attacker with content management permissions can inject malicious JavaScript that executes in the browsers of users viewing collection lists. While requiring authentication and specific permissions, this vulnerability poses a significant risk to organizations using Cockpit CMS for content management, particularly in multi-user environments.
Immediate Actions:
1. Identify all Cockpit CMS instances in your environment running version 2.14.0 or earlier
2. Restrict access to content/:models/manage permissions to trusted administrators only
3. Implement input validation and output encoding for all template fields
4. Review audit logs for suspicious template modifications in the Set field type
Patching Guidance:
1. Apply commit 72a83fc or upgrade to the next available patched version when released
2. Until patch is available, disable the Display template option in Set field types if not critical
3. Implement Web Application Firewall (WAF) rules to detect and block JavaScript injection patterns in template parameters
Compensating Controls:
1. Implement Content Security Policy (CSP) headers to restrict inline script execution
2. Use Vue.js security best practices: replace v-html with v-text where possible
3. Sanitize all user inputs using DOMPurify or similar library before rendering
4. Implement strict role-based access control (RBAC) limiting template editing capabilities
5. Enable comprehensive audit logging for all template modifications
6. Conduct regular security reviews of custom templates and field configurations
Detection Rules:
1. Monitor for suspicious JavaScript patterns in Set field Display templates (e.g., 'script', 'onerror', 'onclick')
2. Alert on modifications to Display template fields by non-administrative accounts
3. Track execution of new Function() calls with user-supplied input
4. Monitor for v-html directive usage with unsanitized variables
الإجراءات الفورية:
1. حدد جميع مثيلات Cockpit CMS في بيئتك التي تعمل بالإصدار 2.14.0 أو أقدم
2. قيد الوصول إلى صلاحيات content/:models/manage للمسؤولين الموثوقين فقط
3. طبق التحقق من صحة الإدخال والترميز الناتج لجميع حقول القالب
4. راجع سجلات التدقيق للتعديلات المريبة على القالب في نوع حقل Set
إرشادات التصحيح:
1. طبق commit 72a83fc أو قم بالترقية إلى الإصدار المصحح التالي عند توفره
2. حتى يتوفر التصحيح، عطل خيار Display template في أنواع حقول Set إذا لم تكن حرجة
3. طبق قواعد جدار الحماية لتطبيقات الويب (WAF) للكشف عن أنماط حقن JavaScript وحجبها
الضوابط البديلة:
1. طبق رؤوس سياسة أمان المحتوى (CSP) لتقييد تنفيذ البرامج النصية المضمنة
2. استخدم أفضل الممارسات الأمنية لـ Vue.js: استبدل v-html بـ v-text حيث أمكن
3. قم بتنظيف جميع مدخلات المستخدم باستخدام DOMPurify أو مكتبة مماثلة قبل العرض
4. طبق التحكم في الوصول القائم على الأدوار (RBAC) الصارم لتحديد قدرات تحرير القالب
5. فعل تسجيل التدقيق الشامل لجميع تعديلات القالب
6. أجر مراجعات أمان منتظمة للقوالب المخصصة وتكوينات الحقول
قواعد الكشف:
1. راقب الأنماط المريبة للـ JavaScript في قوالب Display لحقول Set (مثل 'script'، 'onerror'، 'onclick')
2. أصدر تنبيهات عند تعديل حقول Display template بواسطة حسابات غير إدارية
3. تتبع تنفيذ استدعاءات new Function() مع إدخال يوفره المستخدم
4. راقب استخدام توجيه v-html مع متغيرات غير معقمة