An OS Command Injection vulnerability in the CLI processing of Juniper Networks Junos OS and Junos OS Evolved allows a local, high-privileged attacker executing specific, crafted CLI commands to inject arbitrary shell commands as root, leading to a complete compromise of the system.
Certain 'set system' commands, when executed with crafted arguments, are not properly sanitized, allowing for arbitrary shell injection. These shell commands are executed as root, potentially allowing for complete control of the vulnerable system.
This issue affects:
Junos OS:
* all versions before 22.4R3-S8,
* from 23.2 before 23.2R2-S5,
* from 23.4 before 23.4R2-S7,
* from 24.2 before 24.2R2-S2,
* from 24.4 before 24.4R2,
* from 25.2 before 25.2R2;
Junos OS Evolved:
* all versions before 22.4R3-S8-EVO,
* from 23.2 before 23.2R2-S5-EVO,
* from 23.4 before 23.4R2-S7-EVO,
* from 24.2 before 24.2R2-S2-EVO,
* from 24.4 before 24.4R2-EVO,
* from 25.2 before 25.2R1-S1-EVO, 25.2R2-EVO.
A critical OS command injection vulnerability in Juniper Junos OS and Junos OS Evolved allows local high-privileged attackers to execute arbitrary shell commands as root through crafted 'set system' CLI commands. This vulnerability affects multiple versions across all major release branches and could lead to complete system compromise. While no public exploit is currently available, the attack requires local access with elevated privileges, making it a significant risk for organizations managing Juniper network infrastructure.
IMMEDIATE ACTIONS:
1. Inventory all Juniper Junos OS and Junos OS Evolved devices in your environment and document current versions
2. Restrict CLI access to 'set system' commands to only essential personnel with documented business justification
3. Implement strict privileged access management (PAM) controls limiting who can execute high-privilege CLI commands
4. Enable comprehensive CLI command logging and audit trails for all 'set system' commands
5. Monitor for suspicious 'set system' command patterns in logs
PATCHING GUIDANCE:
1. Prioritize patching in this order: (a) Junos OS versions before 22.4R3-S8, (b) 23.2 before 23.2R2-S5, (c) 23.4 before 23.4R2-S7, (d) 24.2 before 24.2R2-S2, (e) 24.4 before 24.4R2, (f) 25.2 before 25.2R2
2. Apply equivalent patches for Junos OS Evolved versions
3. Test patches in non-production environment first
4. Schedule maintenance windows for patching critical devices
COMPENSATING CONTROLS (if patching delayed):
1. Implement network-based access controls restricting CLI access to authorized management networks only
2. Deploy intrusion detection signatures for command injection patterns in 'set system' commands
3. Implement role-based access control (RBAC) limiting 'set system' command execution to specific roles
4. Use configuration management tools to prevent unauthorized CLI command execution
5. Implement real-time alerting on any 'set system' command execution
DETECTION RULES:
1. Alert on 'set system' commands containing shell metacharacters (|, ;, &, $, `, >, <, newlines)
2. Monitor for 'set system' commands with unusual argument lengths or patterns
3. Track failed 'set system' command attempts followed by successful execution
4. Alert on 'set system' commands executed outside normal maintenance windows
5. Monitor for privilege escalation attempts following 'set system' command execution
الإجراءات الفورية:
1. قم بحصر جميع أجهزة Juniper Junos OS و Junos OS Evolved في بيئتك وتوثيق الإصدارات الحالية
2. قيد الوصول إلى أوامر 'set system' على الموظفين الأساسيين فقط مع توثيق تبرير العمل
3. تطبيق ضوابط إدارة الوصول المميز (PAM) الصارمة التي تحد من يمكنه تنفيذ أوامر CLI عالية الامتياز
4. تفعيل تسجيل أوامر CLI الشامل ومسارات التدقيق لجميع أوامر 'set system'
5. مراقبة أنماط أوامر 'set system' المريبة في السجلات
إرشادات التصحيح:
1. أولويات التصحيح: (أ) إصدارات Junos OS قبل 22.4R3-S8، (ب) 23.2 قبل 23.2R2-S5، (ج) 23.4 قبل 23.4R2-S7، (د) 24.2 قبل 24.2R2-S2، (هـ) 24.4 قبل 24.4R2، (و) 25.2 قبل 25.2R2
2. تطبيق التصحيحات المكافئة لإصدارات Junos OS Evolved
3. اختبار التصحيحات في بيئة غير الإنتاج أولاً
4. جدولة نوافذ الصيانة لتصحيح الأجهزة الحرجة
الضوابط البديلة (إذا تأخر التصحيح):
1. تطبيق ضوابط الوصول المستندة إلى الشبكة التي تقيد وصول CLI إلى شبكات الإدارة المصرح بها فقط
2. نشر توقيعات كشف الاختراق لأنماط حقن الأوامر في أوامر 'set system'
3. تطبيق التحكم في الوصول المستند إلى الأدوار (RBAC) الذي يحد من تنفيذ أوامر 'set system' إلى أدوار محددة
4. استخدام أدوات إدارة التكوين لمنع تنفيذ أوامر CLI غير المصرح بها
5. تطبيق التنبيهات في الوقت الفعلي على أي تنفيذ أوامر 'set system'
قواعد الكشف:
1. تنبيه على أوامر 'set system' التي تحتوي على أحرف shell خاصة (|، ;، &، $، `، >، <، أسطر جديدة)
2. مراقبة أوامر 'set system' بأطوال أو أنماط حجج غير عادية
3. تتبع محاولات أوامر 'set system' الفاشلة متبوعة بالتنفيذ الناجح
4. تنبيه على أوامر 'set system' المنفذة خارج نوافذ الصيانة العادية
5. مراقبة محاولات تصعيد الامتيازات بعد تنفيذ أوامر 'set system'