Sudo Heap-Based Buffer Overflow Vulnerability — Sudo contains an off-by-one error that can result in a heap-based buffer overflow, which allows for privilege escalation.
CVE-2021-3156 is a critical heap-based buffer overflow vulnerability in Sudo affecting versions before 1.9.5p2, allowing local attackers to escalate privileges to root. With a CVSS score of 9.0 and publicly available exploits, this poses an immediate threat to all Linux-based systems across Saudi organizations. Patching is urgent as the vulnerability requires only local access and can be exploited without user interaction.
IMMEDIATE ACTIONS:
1. Identify all systems running Sudo versions before 1.9.5p2 using: sudo --version
2. Restrict local access to systems with vulnerable Sudo versions until patching is complete
3. Monitor for exploitation attempts using process monitoring tools
PATCHING GUIDANCE:
1. Update Sudo to version 1.9.5p2 or later immediately
2. For RHEL/CentOS: yum update sudo
3. For Ubuntu/Debian: apt-get update && apt-get install sudo
4. For SLES: zypper update sudo
5. Verify patch installation: sudo --version (should show 1.9.5p2 or later)
COMPENSATING CONTROLS (if immediate patching not possible):
1. Restrict sudo access via /etc/sudoers to essential users only
2. Implement AppArmor or SELinux profiles to restrict Sudo capabilities
3. Disable sudo for non-essential service accounts
4. Monitor /var/log/auth.log for sudo execution attempts
DETECTION RULES:
1. Monitor for segmentation faults in sudo process: grep 'sudo.*segfault' /var/log/syslog
2. Alert on unexpected privilege escalation: auditctl -w /etc/sudoers -p wa -k sudoers_changes
3. Monitor for heap corruption patterns in core dumps
4. Track failed sudo attempts: grep 'sudo.*command not allowed' /var/log/auth.log
الإجراءات الفورية:
1. تحديد جميع الأنظمة التي تقوم بتشغيل إصدارات Sudo السابقة للإصدار 1.9.5p2 باستخدام: sudo --version
2. تقييد الوصول المحلي للأنظمة التي تحتوي على إصدارات Sudo الضعيفة حتى يتم إكمال التصحيح
3. مراقبة محاولات الاستغلال باستخدام أدوات مراقبة العمليات
إرشادات التصحيح:
1. تحديث Sudo إلى الإصدار 1.9.5p2 أو أحدث على الفور
2. لـ RHEL/CentOS: yum update sudo
3. لـ Ubuntu/Debian: apt-get update && apt-get install sudo
4. لـ SLES: zypper update sudo
5. التحقق من تثبيت التصحيح: sudo --version (يجب أن يظهر 1.9.5p2 أو أحدث)
الضوابط البديلة (إذا لم يكن التصحيح الفوري ممكناً):
1. تقييد وصول sudo عبر /etc/sudoers للمستخدمين الأساسيين فقط
2. تنفيذ ملفات تعريف AppArmor أو SELinux لتقييد قدرات Sudo
3. تعطيل sudo للحسابات الخدمية غير الأساسية
4. مراقبة /var/log/auth.log لمحاولات تنفيذ sudo
قواعد الكشف:
1. مراقبة أخطاء التجزئة في عملية sudo: grep 'sudo.*segfault' /var/log/syslog
2. تنبيه على تصعيد الامتيازات غير المتوقع: auditctl -w /etc/sudoers -p wa -k sudoers_changes
3. مراقبة أنماط تلف الذاكرة في ملفات core dumps
4. تتبع محاولات sudo الفاشلة: grep 'sudo.*command not allowed' /var/log/auth.log