RARLAB UnRAR Directory Traversal Vulnerability — RARLAB UnRAR on Linux and UNIX contains a directory traversal vulnerability, allowing an attacker to write to files during an extract (unpack) operation.
CVE-2022-30333 is a critical directory traversal vulnerability in RARLAB UnRAR affecting Linux and UNIX systems, allowing attackers to write arbitrary files outside the intended extraction directory during unpack operations. With a CVSS score of 9.0 and publicly available exploits, this vulnerability poses an immediate threat to organizations using UnRAR for automated archive processing. Successful exploitation could lead to system compromise, malware injection, and unauthorized file modification across Saudi critical infrastructure.
IMMEDIATE ACTIONS:
1. Identify all systems running RARLAB UnRAR using: find / -name 'unrar' -o -name 'unar' 2>/dev/null and rpm -qa | grep unrar (RHEL/CentOS) or dpkg -l | grep unrar (Debian/Ubuntu)
2. Disable automated archive extraction services immediately if not critical
3. Implement strict file upload restrictions and validate archive sources
PATCHING GUIDANCE:
1. Update RARLAB UnRAR to version 6.1.7 or later from official sources (www.rarlab.com)
2. For RHEL/CentOS: yum update unrar
3. For Debian/Ubuntu: apt-get update && apt-get install --only-upgrade unrar
4. Verify patch installation: unrar -v | grep version
COMPENSATING CONTROLS (if immediate patching not possible):
1. Run UnRAR in isolated containers/chroot jails with restricted filesystem permissions
2. Extract archives to dedicated temporary directories with strict ownership (chmod 700)
3. Implement AppArmor/SELinux profiles restricting UnRAR write operations to designated directories
4. Use file integrity monitoring (AIDE, Tripwire) on critical system directories
5. Disable UnRAR processing of archives from untrusted sources
DETECTION RULES:
1. Monitor for UnRAR processes with unusual file write patterns outside extraction directories
2. Alert on UnRAR writing to /etc, /usr/bin, /usr/lib, /root, /home directories
3. Log all UnRAR invocations with source archive path and extraction destination
4. Detect symlink creation within RAR archives using: strings archive.rar | grep -E '^\.\./'
5. Monitor system calls: strace -e openat,write unrar x archive.rar
الإجراءات الفورية:
1. تحديد جميع الأنظمة التي تقوم بتشغيل RARLAB UnRAR باستخدام: find / -name 'unrar' -o -name 'unar' 2>/dev/null و rpm -qa | grep unrar (RHEL/CentOS) أو dpkg -l | grep unrar (Debian/Ubuntu)
2. تعطيل خدمات استخراج الأرشيفات الآلية فوراً إذا لم تكن حرجة
3. تنفيذ قيود صارمة على تحميل الملفات والتحقق من مصادر الأرشيفات
إرشادات التصحيح:
1. تحديث RARLAB UnRAR إلى الإصدار 6.1.7 أو أحدث من المصادر الرسمية (www.rarlab.com)
2. لـ RHEL/CentOS: yum update unrar
3. لـ Debian/Ubuntu: apt-get update && apt-get install --only-upgrade unrar
4. التحقق من تثبيت التصحيح: unrar -v | grep version
الضوابط البديلة (إذا لم يكن التصحيح الفوري ممكناً):
1. تشغيل UnRAR في حاويات معزولة/chroot مع أذونات نظام ملفات مقيدة
2. استخراج الأرشيفات إلى دلائل مؤقتة مخصصة بملكية صارمة (chmod 700)
3. تنفيذ ملفات تعريف AppArmor/SELinux تقيد عمليات كتابة UnRAR إلى الدلائل المعينة
4. استخدام مراقبة سلامة الملفات (AIDE, Tripwire) على الدلائل الحرجة للنظام
5. تعطيل معالجة UnRAR للأرشيفات من مصادر غير موثوقة
قواعد الكشف:
1. مراقبة عمليات UnRAR بأنماط كتابة ملفات غير عادية خارج دلائل الاستخراج
2. التنبيه على UnRAR الكتابة إلى دلائل /etc و /usr/bin و /usr/lib و /root و /home
3. تسجيل جميع استدعاءات UnRAR مع مسار الأرشيف المصدر ودليل الاستخراج
4. الكشف عن إنشاء الروابط الرمزية داخل أرشيفات RAR باستخدام: strings archive.rar | grep -E '^\.\./'
5. مراقبة استدعاءات النظام: strace -e openat,write unrar x archive.rar