PEAR Archive_Tar Improper Link Resolution Vulnerability — PEAR Archive_Tar Tar.php allows write operations with directory traversal due to inadequate checking of symbolic links. PEAR stands for PHP Extension and Application Repository and it is an open-source framework and distribution system for reusable PHP components with known usage in third-party products such as Drupal Core and Red Hat Linux.
CVE-2020-36193 is a critical directory traversal vulnerability in PEAR Archive_Tar that allows attackers to write files outside intended directories through improper symbolic link validation. With a CVSS score of 9.0 and publicly available exploits, this vulnerability poses severe risk to Saudi organizations using affected PHP applications, particularly those running Drupal-based systems. Immediate patching is essential as the vulnerability enables arbitrary file write operations that could lead to complete system compromise.
IMMEDIATE ACTIONS:
1. Identify all systems running PEAR Archive_Tar, particularly Drupal installations and PHP applications
2. Disable file upload functionality if not critical until patching is complete
3. Implement strict file access controls and disable symbolic link following in web server configuration
PATCHING GUIDANCE:
1. Update PEAR Archive_Tar to version 1.4.14 or later
2. For Drupal installations, update to patched versions (Drupal 7.x and 8.x have security updates available)
3. Apply patches from Red Hat if using RHEL-based systems
4. Test patches in non-production environments before deployment
COMPENSATING CONTROLS (if immediate patching unavailable):
1. Disable symbolic link following: Set 'FollowSymLinks Off' in Apache .htaccess or nginx configuration
2. Implement strict input validation on all file upload operations
3. Restrict write permissions to specific directories outside web root
4. Use Web Application Firewall (WAF) rules to block directory traversal patterns (../, ..\ sequences)
5. Monitor file system for unauthorized file creation in sensitive directories
DETECTION RULES:
1. Monitor for tar/archive extraction operations with symbolic links
2. Alert on file write operations outside designated upload directories
3. Track creation of files in system directories (/etc, /var, /usr/bin) from web processes
4. Monitor for suspicious .tar, .tar.gz, .tgz file uploads containing symlink entries
5. Log and alert on PHP processes attempting to follow symbolic links during archive operations
الإجراءات الفورية:
1. تحديد جميع الأنظمة التي تعمل بـ PEAR Archive_Tar، خاصة تثبيتات Drupal والتطبيقات المستندة إلى PHP
2. تعطيل وظيفة تحميل الملفات إذا لم تكن حرجة حتى يتم التصحيح
3. تنفيذ عناصر تحكم صارمة في الوصول إلى الملفات وتعطيل متابعة الروابط الرمزية في إعدادات خادم الويب
إرشادات التصحيح:
1. تحديث PEAR Archive_Tar إلى الإصدار 1.4.14 أو أحدث
2. لتثبيتات Drupal، قم بالتحديث إلى الإصدارات المصححة (Drupal 7.x و 8.x لديها تحديثات أمان متاحة)
3. تطبيق التصحيحات من Red Hat إذا كنت تستخدم أنظمة قائمة على RHEL
4. اختبر التصحيحات في بيئات غير الإنتاج قبل النشر
عناصر التحكم البديلة (إذا لم يكن التصحيح الفوري متاحاً):
1. تعطيل متابعة الروابط الرمزية: اضبط 'FollowSymLinks Off' في Apache .htaccess أو إعدادات nginx
2. تنفيذ التحقق الصارم من المدخلات على جميع عمليات تحميل الملفات
3. تقييد أذونات الكتابة على دلائل محددة خارج جذر الويب
4. استخدام قواعد جدار حماية تطبيقات الويب (WAF) لحظر أنماط المسار المتقاطع
5. مراقبة نظام الملفات للكشف عن إنشاء ملفات غير مصرح بها في الدلائل الحساسة
قواعد الكشف:
1. مراقبة عمليات استخراج tar/archive مع الروابط الرمزية
2. تنبيهات على عمليات كتابة الملفات خارج دلائل التحميل المخصصة
3. تتبع إنشاء الملفات في دلائل النظام من عمليات الويب
4. مراقبة وتنبيهات على تحميلات ملفات .tar المريبة التي تحتوي على إدخالات symlink
5. تسجيل وتنبيهات على عمليات PHP التي تحاول متابعة الروابط الرمزية أثناء عمليات الأرشيف