Linux Kernel Improper Ownership Management Vulnerability — Linux Kernel contains an improper ownership management vulnerability, where unauthorized access to the execution of the setuid file with capabilities was found in the Linux kernel’s OverlayFS subsystem in how a user copies a capable file from a nosuid mount into another mount. This uid mapping bug allows a local user to escalate their privileges on the system.
CVE-2023-0386 is a critical privilege escalation vulnerability in Linux Kernel's OverlayFS subsystem affecting versions prior to 6.2.1. An unprivileged local user can exploit improper UID mapping when copying setuid files with capabilities across mounts to gain root-level privileges. With CVSS 9.0 and active exploits available, this poses immediate risk to all Linux-based infrastructure in Saudi Arabia.
تتعلق الثغرة بآلية إدارة الملكية في نظام ملفات OverlayFS بنواة لينكس، حيث يمكن لمستخدم محلي استغلال خريطة UID غير صحيحة لنسخ ملفات setuid مع قدرات من عمليات تحميل nosuid إلى عمليات تحميل أخرى. يؤدي هذا الاستغلال إلى تنفيذ ملفات بامتيازات مرتفعة دون التحقق الصحيح من الملكية والأذونات. المهاجم المحلي يمكنه الحصول على امتيازات جذر (root) على النظام المتأثر.
CVE-2023-0386 عبارة عن ثغرة حرجة في نواة لينكس تؤثر على نظام OverlayFS وتسمح لمستخدم محلي غير مميز باستغلال خلل في إدارة معرفات المستخدمين (UID) لتصعيد الامتيازات إلى مستوى الجذر. مع درجة CVSS 9.0 وتوفر استغلالات نشطة، تشكل هذه الثغرة خطراً فورياً على جميع البنية التحتية المستندة إلى لينكس في المملكة العربية السعودية.
IMMEDIATE ACTIONS:
1. Identify all Linux systems in your environment using 'uname -r' and inventory kernel versions
2. Disable OverlayFS if not required: add 'overlay' to /etc/modprobe.d/blacklist.conf and reboot
3. Restrict local user access and monitor for suspicious privilege escalation attempts
PATCHING GUIDANCE:
1. Update Linux kernel to version 6.2.1 or later immediately
2. For RHEL/CentOS: yum update kernel && reboot
3. For Ubuntu/Debian: apt update && apt upgrade linux-image-generic && reboot
4. For SLES: zypper update kernel-default && reboot
5. Verify patch application: uname -r should show patched version
COMPENSATING CONTROLS (if immediate patching impossible):
1. Implement strict file system permissions: chmod 000 on setuid binaries if unused
2. Use AppArmor/SELinux to restrict OverlayFS mount operations
3. Deploy kernel module signing and secure boot to prevent unauthorized module loading
4. Implement container runtime security policies (restrict privileged containers)
5. Monitor /proc/sys/kernel/unprivileged_userns_clone and disable if not required
DETECTION RULES:
1. Monitor for OverlayFS mount operations: auditctl -w /proc/sys/fs/overlay -p wa
2. Alert on setuid file copies across mounts: monitor inotify events on /tmp and /var/tmp
3. Track privilege escalation attempts: monitor /var/log/auth.log for 'sudo' and 'su' failures
4. Watch for suspicious capability changes: getcap /usr/bin/* | grep cap_setuid
5. Implement HIDS rules for local privilege escalation patterns
الإجراءات الفورية:
1. تحديد جميع أنظمة لينكس في بيئتك باستخدام 'uname -r' وحصر إصدارات النواة
2. تعطيل OverlayFS إذا لم تكن مطلوبة: أضف 'overlay' إلى /etc/modprobe.d/blacklist.conf وأعد التشغيل
3. تقييد وصول المستخدمين المحليين ومراقبة محاولات تصعيد الامتيازات المريبة
إرشادات التصحيح:
1. تحديث نواة لينكس إلى الإصدار 6.2.1 أو أحدث فوراً
2. لـ RHEL/CentOS: yum update kernel && reboot
3. لـ Ubuntu/Debian: apt update && apt upgrade linux-image-generic && reboot
4. لـ SLES: zypper update kernel-default && reboot
5. التحقق من تطبيق التصحيح: يجب أن يظهر uname -r الإصدار المصحح
الضوابط البديلة (إذا كان التصحيح الفوري غير ممكن):
1. تطبيق أذونات نظام الملفات الصارمة: chmod 000 على الملفات الثنائية setuid إذا لم تكن مستخدمة
2. استخدام AppArmor/SELinux لتقييد عمليات تثبيت OverlayFS
3. تطبيق توقيع وحدات النواة والتشغيل الآمن لمنع تحميل الوحدات غير المصرح بها
4. تطبيق سياسات أمان وقت تشغيل الحاويات (تقييد الحاويات المميزة)
5. مراقبة /proc/sys/kernel/unprivileged_userns_clone وتعطيله إذا لم يكن مطلوباً
قواعد الكشف:
1. مراقبة عمليات تثبيت OverlayFS: auditctl -w /proc/sys/fs/overlay -p wa
2. تنبيه نسخ ملفات setuid عبر التثبيتات: مراقبة أحداث inotify على /tmp و /var/tmp
3. تتبع محاولات تصعيد الامتيازات: مراقبة /var/log/auth.log للفشل في 'sudo' و 'su'
4. مراقبة التغييرات المريبة في الإمكانيات: getcap /usr/bin/* | grep cap_setuid
5. تطبيق قواعد HIDS لأنماط تصعيد الامتيازات المحلية