An Execution with Unnecessary Privileges vulnerability in the User Interface (UI) of Juniper Networks Junos OS and Junos OS Evolved allows a local, low-privileged attacker to gain root privileges, thus compromising the system.
When a configuration that allows unsigned Python op scripts is present on the device, a non-root user is able to execute malicious op scripts as a root-equivalent user, leading to privilege escalation.
This issue affects Junos OS:
* All versions before 22.4R3-S7,
* from 23.2 before 23.2R2-S4,
* from 23.4 before 23.4R2-S6,
* from 24.2 before 24.2R1-S2, 24.2R2,
* from 24.4 before 24.4R1-S2, 24.4R2;
Junos OS Evolved:
* All versions before 22.4R3-S7-EVO,
* from 23.2 before 23.2R2-S4-EVO,
* from 23.4 before 23.4R2-S6-EVO,
* from 24.2 before 24.2R2-EVO,
* from 24.4 before 24.4R1-S1-EVO, 24.4R2-EVO.
A privilege escalation vulnerability in Juniper Networks Junos OS allows local, low-privileged users to execute arbitrary Python op scripts with root privileges when unsigned script execution is enabled. This critical flaw affects multiple Junos OS versions and could enable complete system compromise. Immediate configuration review and version upgrades are essential for Saudi organizations operating Juniper network infrastructure.
IMMEDIATE ACTIONS:
1. Audit all Juniper Junos devices for unsigned Python op script configurations — disable if not operationally required
2. Restrict local user access to devices via SSH/console to authorized personnel only
3. Implement strong authentication (SSH keys, MFA) for all local accounts
4. Review user privilege levels and apply principle of least privilege
PATCHING GUIDANCE:
1. Upgrade to patched versions: 22.4R3-S7+, 23.2R2-S4+, 23.4R2-S6+, 24.2R1-S2/24.2R2+, 24.4R1-S2/24.4R2+ (or EVO equivalents)
2. Prioritize devices in banking, government, and telecom sectors
3. Test patches in lab environment before production deployment
4. Schedule maintenance windows with minimal network impact
COMPENSATING CONTROLS (if patching delayed):
1. Disable unsigned Python op script execution via configuration: set system scripts op file <filename> signed
2. Implement network segmentation to limit local access to management interfaces
3. Deploy host-based intrusion detection on management networks
4. Monitor for suspicious op script execution attempts
DETECTION RULES:
1. Alert on any op script execution by non-root users
2. Monitor for Python script files in /var/db/scripts/op/ directory
3. Track privilege escalation attempts in system logs
4. Flag unsigned script execution attempts
5. Monitor for unexpected root process spawning from UI/op script contexts
الإجراءات الفورية:
1. تدقيق جميع أجهزة Juniper Junos للتحقق من إعدادات سكريبتات Python غير الموقعة — تعطيلها إن لم تكن مطلوبة تشغيلياً
2. تقييد الوصول المحلي للأجهزة عبر SSH/console للموظفين المصرح لهم فقط
3. تطبيق المصادقة القوية (مفاتيح SSH، المصادقة متعددة العوامل) لجميع الحسابات المحلية
4. مراجعة مستويات امتيازات المستخدمين وتطبيق مبدأ الحد الأدنى من الامتيازات
إرشادات التصحيح:
1. الترقية إلى الإصدارات المصححة: 22.4R3-S7+، 23.2R2-S4+، 23.4R2-S6+، 24.2R1-S2/24.2R2+، 24.4R1-S2/24.4R2+ (أو ما يعادلها EVO)
2. إعطاء الأولوية للأجهزة في قطاعات البنوك والحكومة والاتصالات
3. اختبار التصحيحات في بيئة المختبر قبل النشر الإنتاجي
4. جدولة نوافذ الصيانة بأقل تأثير على الشبكة
الضوابط البديلة (إذا تأخر التصحيح):
1. تعطيل تنفيذ سكريبتات Python غير الموقعة عبر الإعدادات: set system scripts op file <filename> signed
2. تطبيق تقسيم الشبكة لتقييد الوصول المحلي لواجهات الإدارة
3. نشر كشف الاختراق على مستوى المضيف على شبكات الإدارة
4. مراقبة محاولات تنفيذ سكريبتات op المريبة
قواعد الكشف:
1. تنبيه عند تنفيذ أي سكريبت op من قبل مستخدمين غير جذر
2. مراقبة ملفات سكريبتات Python في دليل /var/db/scripts/op/
3. تتبع محاولات تصعيد الامتيازات في سجلات النظام
4. وضع علامة على محاولات تنفيذ السكريبتات غير الموقعة
5. مراقبة توليد عمليات جذر غير متوقعة من سياقات UI/op script