OCS Inventory NG Server version 2.12.3 and prior contain a stored cross-site scripting vulnerability that allows unauthenticated attackers to execute arbitrary JavaScript by submitting malicious User-Agent HTTP headers to the /ocsinventory endpoint. Attackers can register rogue agents or craft requests with malicious User-Agent values that are stored without sanitation and rendered with insufficient encoding in the web console, leading to arbitrary JavaScript execution in the browsers of authenticated users viewing the statistics dashboard.
OCS Inventory NG Server versions 2.12.3 and earlier contain a stored cross-site scripting (XSS) vulnerability in the User-Agent header processing at the /ocsinventory endpoint. Unauthenticated attackers can inject malicious JavaScript that persists in the database and executes when authenticated administrators view the statistics dashboard, potentially leading to credential theft, session hijacking, or unauthorized administrative actions. While no patch is currently available and exploit code is not public, the vulnerability poses a significant risk to organizations using this asset inventory management solution.
Immediate Actions:
1. Audit all OCS Inventory NG instances in your environment and document versions
2. Restrict network access to the /ocsinventory endpoint using firewall rules or WAF policies - allow only trusted internal networks
3. Implement input validation on User-Agent headers at the WAF/proxy level to block suspicious patterns
4. Review access logs for suspicious User-Agent submissions (look for script tags, event handlers, encoded payloads)
Compensating Controls:
1. Deploy a Web Application Firewall (WAF) with XSS detection rules to sanitize User-Agent headers before they reach the application
2. Implement Content Security Policy (CSP) headers with strict-dynamic and nonce-based script execution
3. Enable HTTP-only and Secure flags on all session cookies to prevent JavaScript access
4. Restrict administrative dashboard access to specific IP ranges and require multi-factor authentication
5. Implement regular security audits of stored data in OCS database for malicious payloads
Detection Rules:
1. Monitor for User-Agent headers containing: <script, javascript:, onerror=, onload=, eval(, String.fromCharCode
2. Alert on any modifications to the OCS database tables storing User-Agent data
3. Monitor for unusual JavaScript execution in admin dashboard sessions
4. Log all access to /ocsinventory endpoint and correlate with administrative dashboard access
Patching Strategy:
1. Contact OCS Inventory NG project for patch timeline
2. Prepare isolated test environment for patch deployment
3. Plan migration to alternative asset management solutions if patch timeline is unacceptable
الإجراءات الفورية:
1. قم بمراجعة جميع حالات OCS Inventory NG في بيئتك وتوثيق الإصدارات
2. قيد الوصول إلى نقطة النهاية /ocsinventory باستخدام قواعد جدار الحماية أو سياسات WAF - السماح فقط للشبكات الداخلية الموثوقة
3. تطبيق التحقق من صحة الإدخال على رؤوس User-Agent على مستوى WAF/proxy لحجب الأنماط المريبة
4. مراجعة سجلات الوصول للتقديمات المريبة لـ User-Agent (ابحث عن علامات script، معالجات الأحداث، الحمولات المشفرة)
الضوابط البديلة:
1. نشر جدار تطبيقات ويب (WAF) مع قواعد كشف XSS لتنظيف رؤوس User-Agent قبل وصولها للتطبيق
2. تطبيق رؤوس Content Security Policy (CSP) مع strict-dynamic و script execution المستند إلى nonce
3. تفعيل أعلام HTTP-only و Secure على جميع ملفات تعريف الجلسة
4. تقييد الوصول إلى لوحة التحكم الإدارية لنطاقات IP محددة وتطلب المصادقة متعددة العوامل
5. تطبيق عمليات تدقيق أمان منتظمة لبيانات OCS المخزنة للبحث عن حمولات ضارة
قواعد الكشف:
1. مراقبة رؤوس User-Agent التي تحتوي على: <script, javascript:, onerror=, onload=, eval(, String.fromCharCode
2. تنبيهات على أي تعديلات على جداول قاعدة بيانات OCS التي تخزن بيانات User-Agent
3. مراقبة تنفيذ JavaScript غير العادي في جلسات لوحة التحكم الإدارية
4. تسجيل جميع الوصول إلى نقطة النهاية /ocsinventory والربط مع الوصول إلى لوحة التحكم الإدارية
استراتيجية التصحيح:
1. اتصل بمشروع OCS Inventory NG للحصول على جدول زمني للتصحيح
2. تحضير بيئة اختبار معزولة لنشر التصحيح
3. التخطيط للهجرة إلى حلول إدارة أصول بديلة إذا كان جدول التصحيح غير مقبول