Debian-specific Redis Server Lua Sandbox Escape Vulnerability — Redis is prone to a (Debian-specific) Lua sandbox escape, which could result in remote code execution.
CVE-2022-0543 is a critical Debian-specific Lua sandbox escape vulnerability in Redis that allows unauthenticated remote code execution with a CVSS score of 9.0. Attackers can exploit this flaw through Lua scripting capabilities to break out of the sandbox and execute arbitrary commands on affected systems. This vulnerability poses an immediate threat to organizations running Redis on Debian-based systems, particularly those exposed to untrusted networks.
IMMEDIATE ACTIONS:
1. Identify all Redis instances running on Debian-based systems using: redis-cli INFO server | grep os
2. Restrict network access to Redis ports (default 6379) using firewall rules - allow only trusted internal IPs
3. Disable Lua scripting if not required: Set 'disable-protected-mode no' and implement ACLs
4. Enable Redis AUTH with strong passwords (minimum 32 characters) and rotate immediately
PATCHING:
5. Update Redis to version 6.2.7, 7.0.0 or later on all Debian systems
6. For Debian/Ubuntu: apt-get update && apt-get upgrade redis-server
7. Verify patch installation: redis-server --version
COMPENSATING CONTROLS (if immediate patching not possible):
8. Implement network segmentation - isolate Redis to internal networks only
9. Deploy WAF/IPS rules to block Lua script injection patterns
10. Monitor for suspicious EVAL/EVALSHA commands in Redis logs
11. Implement Redis module restrictions and disable dangerous commands
DETECTION:
12. Monitor Redis logs for: EVAL, EVALSHA, SCRIPT LOAD commands from untrusted sources
13. Alert on any connection attempts to port 6379 from external networks
14. Track process execution spawned by redis-server process
15. Implement SIEM rules for Redis command anomalies
الإجراءات الفورية:
1. تحديد جميع مثيلات Redis التي تعمل على أنظمة قائمة على Debian باستخدام: redis-cli INFO server | grep os
2. تقييد الوصول إلى منافذ Redis (الافتراضي 6379) باستخدام قواعد جدار الحماية - السماح فقط بعناوين IP الداخلية الموثوقة
3. تعطيل البرمجة النصية Lua إذا لم تكن مطلوبة: تعيين 'disable-protected-mode no' وتنفيذ ACLs
4. تفعيل مصادقة Redis بكلمات مرور قوية (32 حرفاً على الأقل) والتناوب فوراً
التصحيح:
5. تحديث Redis إلى الإصدار 6.2.7 أو 7.0.0 أو أحدث على جميع أنظمة Debian
6. لـ Debian/Ubuntu: apt-get update && apt-get upgrade redis-server
7. التحقق من تثبيت التصحيح: redis-server --version
الضوابط البديلة (إذا لم يكن التصحيح الفوري ممكناً):
8. تنفيذ تقسيم الشبكة - عزل Redis إلى الشبكات الداخلية فقط
9. نشر قواعد WAF/IPS لحجب أنماط حقن Lua
10. مراقبة أوامر EVAL/EVALSHA المريبة في سجلات Redis
11. تنفيذ قيود وحدة Redis وتعطيل الأوامر الخطرة
الكشف:
12. مراقبة سجلات Redis بحثاً عن: أوامر EVAL و EVALSHA و SCRIPT LOAD من مصادر غير موثوقة
13. التنبيه على أي محاولات اتصال بالمنفذ 6379 من شبكات خارجية
14. تتبع تنفيذ العمليات التي يتم إطلاقها بواسطة عملية redis-server
15. تنفيذ قواعد SIEM لشذوذ أوامر Redis