A container privilege escalation flaw was found in certain Multicluster Engine for Kubernetes images. This issue stems from the /etc/passwd file being created with group-writable permissions during build time. In certain conditions, an attacker who can execute commands within an affected container, even as a non-root user, can leverage their membership in the root group to modify the /etc/passwd file. This could allow the attacker to add a new user with any arbitrary UID, including UID 0, leading to full root privileges within the container.
CVE-2025-57851 is a container privilege escalation vulnerability in Multicluster Engine for Kubernetes where /etc/passwd is created with group-writable permissions during build time. Non-root users in the root group can modify this file to add arbitrary users with UID 0, achieving full root privileges within containers. With no patch currently available and medium CVSS score of 6.4, this poses significant risk to containerized deployments in Saudi organizations running Kubernetes infrastructure.
Immediate Actions:
1. Audit all Multicluster Engine for Kubernetes deployments to identify affected versions
2. Implement strict container image scanning policies to detect group-writable /etc/passwd permissions
3. Review container runtime security policies and enforce read-only root filesystems where possible
Compensating Controls (until patch available):
1. Restrict container execution to specific non-root users and prevent root group membership
2. Implement Pod Security Standards (PSS) with restricted profile to limit container capabilities
3. Use securityContext in Kubernetes manifests: set fsGroup restrictions and readOnlyRootFilesystem: true
4. Deploy network policies to isolate container traffic and limit lateral movement
5. Enable audit logging for all container privilege escalation attempts
6. Implement runtime security monitoring (Falco, Sysdig) to detect /etc/passwd modifications
Detection Rules:
1. Monitor for write operations to /etc/passwd from non-root processes
2. Alert on UID 0 user creation attempts within containers
3. Track group membership changes in root group
4. Monitor container escape attempts and privilege escalation patterns
Patching Guidance:
1. Monitor Red Hat and Kubernetes security advisories for official patches
2. Prepare container image rebuild procedures with corrected file permissions (644 for /etc/passwd)
3. Implement image signing and verification to prevent unauthorized modifications
الإجراءات الفورية:
1. تدقيق جميع نشرات Multicluster Engine for Kubernetes لتحديد الإصدارات المتأثرة
2. تنفيذ سياسات فحص صور الحاويات الصارمة للكشف عن أذونات /etc/passwd القابلة للكتابة من قبل المجموعة
3. مراجعة سياسات أمان وقت تشغيل الحاويات وفرض أنظمة ملفات الجذر للقراءة فقط حيث أمكن
الضوابط التعويضية (حتى توفر التصحيح):
1. تقييد تنفيذ الحاويات لمستخدمين غير جذر محددين ومنع عضوية مجموعة الجذر
2. تنفيذ معايير أمان Pod (PSS) مع ملف تعريف مقيد لتحديد قدرات الحاويات
3. استخدام securityContext في بيانات Kubernetes: تعيين قيود fsGroup و readOnlyRootFilesystem: true
4. نشر سياسات الشبكة لعزل حركة الحاويات وتحديد الحركة الجانبية
5. تفعيل تسجيل التدقيق لجميع محاولات تصعيد امتيازات الحاويات
6. تنفيذ مراقبة أمان وقت التشغيل (Falco, Sysdig) للكشف عن تعديلات /etc/passwd
قواعد الكشف:
1. مراقبة عمليات الكتابة إلى /etc/passwd من عمليات غير جذر
2. تنبيهات محاولات إنشاء مستخدم UID 0 داخل الحاويات
3. تتبع تغييرات عضوية المجموعة في مجموعة الجذر
4. مراقبة محاولات الهروب من الحاويات وأنماط تصعيد الامتيازات
إرشادات التصحيح:
1. مراقبة استشارات أمان Red Hat و Kubernetes للحصول على التصحيحات الرسمية
2. تحضير إجراءات إعادة بناء صور الحاويات برمز أذونات مصحح (644 لـ /etc/passwd)
3. تنفيذ التوقيع على الصور والتحقق منها لمنع التعديلات غير المصرح بها