Juniper Junos OS EX Series PHP External Variable Modification Vulnerability — Juniper Junos OS on EX Series contains a PHP external variable modification vulnerability that allows an unauthenticated, network-based attacker to control certain, important environment variables. Using a crafted request an attacker is able to modify certain PHP environment variables, leading to partial loss of integrity, which may allow chaining to other vulnerabilities.
CVE-2023-36844 is a critical PHP external variable modification vulnerability in Juniper Junos OS on EX Series switches, scoring 9.0 CVSS. An unauthenticated, network-based attacker can manipulate critical PHP environment variables through crafted HTTP requests without any authentication. This vulnerability is particularly dangerous as it can be chained with other vulnerabilities (notably CVE-2023-36845, CVE-2023-36846, CVE-2023-36847) to achieve unauthenticated remote code execution on the J-Web management interface. Active exploits are confirmed in the wild, making immediate patching an urgent priority for all organizations running Juniper EX Series switches.
IMMEDIATE ACTIONS (within 24 hours):
1. Identify all Juniper EX Series devices running Junos OS with J-Web enabled across your environment.
2. Disable J-Web interface immediately if not operationally required: 'delete system services web-management' or restrict access via firewall filters.
3. Implement ACLs to restrict J-Web access (port 80/443) to trusted management IP ranges only.
4. Review firewall policies to ensure J-Web is not exposed to the internet or untrusted networks.
PATCHING GUIDANCE:
5. Apply Juniper security advisory JSA72300 patches immediately. Patched versions include:
- Junos OS 20.4R3-S9, 21.1R3-S5, 21.2R3-S5, 21.3R3-S4, 21.4R3-S4, 22.1R3-S3, 22.2R3-S1, 22.3R2-S2, 22.3R3, 22.4R2-S1, 22.4R3, 23.2R1, and later releases.
6. Prioritize internet-facing and management-plane exposed devices first.
7. Test patches in staging before production deployment where operationally feasible.
COMPENSATING CONTROLS (if patching is delayed):
8. Deploy a Web Application Firewall (WAF) or reverse proxy in front of J-Web to filter malicious PHP variable injection attempts.
9. Enable out-of-band management (dedicated management VRF/interface) and disable in-band J-Web access.
10. Implement network segmentation to isolate management interfaces.
DETECTION RULES:
11. Monitor for anomalous HTTP requests to J-Web containing PHP variable manipulation patterns (e.g., PHPRC, PHP_INI_SCAN_DIR in request parameters).
12. Enable Junos OS logging for J-Web access and forward to SIEM.
13. Create SIEM alerts for repeated unauthenticated access attempts to J-Web endpoints.
14. Deploy IDS/IPS signatures for CVE-2023-36844 (available in Snort/Suricata community rulesets).
15. Monitor for unusual process spawning from J-Web PHP processes on affected devices.
الإجراءات الفورية (خلال 24 ساعة):
1. تحديد جميع أجهزة Juniper EX Series التي تعمل بنظام Junos OS مع تفعيل J-Web في بيئتك.
2. تعطيل واجهة J-Web فوراً إذا لم تكن ضرورية تشغيلياً: 'delete system services web-management' أو تقييد الوصول عبر مرشحات جدار الحماية.
3. تطبيق قوائم التحكم بالوصول (ACL) لتقييد الوصول إلى J-Web (المنفذ 80/443) على نطاقات IP الإدارية الموثوقة فقط.
4. مراجعة سياسات جدار الحماية للتأكد من عدم تعرض J-Web للإنترنت أو الشبكات غير الموثوقة.
إرشادات التصحيح:
5. تطبيق تصحيحات Juniper الأمنية JSA72300 فوراً. الإصدارات المُصححة تشمل:
- Junos OS 20.4R3-S9، 21.1R3-S5، 21.2R3-S5، 21.3R3-S4، 21.4R3-S4، 22.1R3-S3، 22.2R3-S1، 22.3R2-S2، 22.3R3، 22.4R2-S1، 22.4R3، 23.2R1 والإصدارات الأحدث.
6. إعطاء الأولوية للأجهزة المعرضة للإنترنت وتلك المكشوفة في مستوى الإدارة أولاً.
7. اختبار التصحيحات في بيئة التجهيز قبل النشر في الإنتاج حيثما أمكن.
ضوابط التعويض (في حالة تأخر التصحيح):
8. نشر جدار حماية تطبيقات الويب (WAF) أو وكيل عكسي أمام J-Web لتصفية محاولات حقن متغيرات PHP الضارة.
9. تفعيل الإدارة خارج النطاق (VRF/واجهة إدارة مخصصة) وتعطيل وصول J-Web داخل النطاق.
10. تطبيق تجزئة الشبكة لعزل واجهات الإدارة.
قواعد الكشف:
11. مراقبة طلبات HTTP غير الطبيعية إلى J-Web التي تحتوي على أنماط التلاعب بمتغيرات PHP (مثل PHPRC، PHP_INI_SCAN_DIR في معاملات الطلب).
12. تفعيل تسجيل Junos OS لوصول J-Web وإرساله إلى نظام SIEM.
13. إنشاء تنبيهات SIEM لمحاولات الوصول غير المصادق المتكررة إلى نقاط نهاية J-Web.
14. نشر توقيعات IDS/IPS لـ CVE-2023-36844 (متاحة في مجموعات قواعد Snort/Suricata المجتمعية).
15. مراقبة عمليات إنشاء العمليات غير المعتادة من عمليات PHP الخاصة بـ J-Web على الأجهزة المتأثرة.