Apache Log4j2 Remote Code Execution Vulnerability — Apache Log4j2 contains a vulnerability where JNDI features do not protect against attacker-controlled JNDI-related endpoints, allowing for remote code execution.
Apache Log4j2 CVE-2021-44228 is a critical remote code execution vulnerability affecting millions of systems globally, including critical infrastructure in Saudi Arabia. The vulnerability allows unauthenticated attackers to execute arbitrary code through JNDI injection in log messages, requiring immediate patching across all affected systems. This vulnerability has been actively exploited in the wild and poses an existential threat to Saudi banking, government, and energy sectors.
IMMEDIATE ACTIONS:
1. Identify all systems running Apache Log4j2 versions 2.0-beta9 through 2.14.1 using vulnerability scanning tools
2. Isolate affected systems from production networks if patching cannot be completed within 24 hours
3. Implement network segmentation to restrict outbound connections from affected systems
4. Enable enhanced logging and monitoring for suspicious JNDI-related activities
PATCHING GUIDANCE:
1. Upgrade Apache Log4j2 to version 2.15.0 or later immediately
2. For systems unable to patch immediately, upgrade to 2.12.2 (for Log4j 2.12.x branch)
3. Verify patch application by checking Log4j2 version in all deployed applications
4. Test patches in non-production environments before production deployment
COMPENSATING CONTROLS (if patching delayed):
1. Set system property: -Dlog4j2.formatMsgNoLookups=true
2. Remove JndiLookup class from classpath: zip -q -d log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class
3. Implement WAF rules to block JNDI injection patterns in HTTP requests
4. Restrict outbound DNS and network connections from application servers
DETECTION RULES:
1. Monitor for log entries containing ${jndi: patterns
2. Alert on outbound LDAP/RMI connections from application servers
3. Track Java process spawning unusual child processes
4. Monitor for ClassPathXmlApplicationContext instantiation in logs
الإجراءات الفورية:
1. تحديد جميع الأنظمة التي تقوم بتشغيل إصدارات Apache Log4j2 من 2.0-beta9 إلى 2.14.1 باستخدام أدوات فحص الثغرات
2. عزل الأنظمة المتأثرة عن شبكات الإنتاج إذا لم يتمكن من إصلاح الثغرات خلال 24 ساعة
3. تطبيق تقسيم الشبكة لتقييد الاتصالات الصادرة من الأنظمة المتأثرة
4. تفعيل السجلات المحسنة والمراقبة للأنشطة المريبة المتعلقة بـ JNDI
إرشادات التصحيح:
1. ترقية Apache Log4j2 إلى الإصدار 2.15.0 أو أحدث فوراً
2. للأنظمة التي لا يمكن إصلاحها فوراً، قم بالترقية إلى 2.12.2
3. التحقق من تطبيق التصحيح بفحص إصدار Log4j2 في جميع التطبيقات المنشورة
4. اختبار التصحيحات في بيئات غير الإنتاج قبل نشرها في الإنتاج
الضوابط البديلة (إذا تأخر التصحيح):
1. تعيين خاصية النظام: -Dlog4j2.formatMsgNoLookups=true
2. إزالة فئة JndiLookup من المسار: zip -q -d log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class
3. تطبيق قواعد WAF لحظر أنماط حقن JNDI في طلبات HTTP
4. تقييد الاتصالات الصادرة DNS والشبكة من خوادم التطبيقات
قواعد الكشف:
1. مراقبة إدخالات السجل التي تحتوي على أنماط ${jndi:
2. تنبيه الاتصالات الصادرة LDAP/RMI من خوادم التطبيقات
3. تتبع عمليات Java التي تولد عمليات فرعية غير عادية
4. مراقبة إنشاء ClassPathXmlApplicationContext في السجلات