A container privilege escalation flaw was found in certain OpenShift Update Service (OSUS) 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, may be able to 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-57854 is a container privilege escalation vulnerability in OpenShift Update Service images where /etc/passwd is created with group-writable permissions, allowing non-root users in the root group to modify it and gain root privileges. With a CVSS score of 6.4 and no patch currently available, this poses a moderate but significant risk to organizations running affected OSUS containers. The vulnerability requires container access but enables complete container compromise, making it critical for Saudi organizations using Red Hat OpenShift infrastructure.
Immediate Actions:
1. Inventory all OpenShift Update Service (OSUS) deployments and identify affected image versions
2. Implement strict container runtime security policies restricting group membership modifications
3. Apply principle of least privilege: remove non-root users from root group membership
4. Enable Pod Security Standards (PSS) with restricted profile to limit container capabilities
Compensating Controls (until patch available):
1. Implement read-only root filesystem (readOnlyRootFilesystem: true) in pod security context
2. Use SecurityContext to drop CAP_SETUID and CAP_SETGID capabilities
3. Deploy runtime security monitoring (Falco, Sysdig) to detect /etc/passwd modifications
4. Implement network segmentation to limit container-to-container communication
5. Use image scanning tools to detect and prevent deployment of affected OSUS images
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 running containers
4. Monitor for container escape attempts via privilege escalation
Patching Strategy:
1. Monitor Red Hat security advisories for OSUS patch releases
2. Establish testing environment to validate patches before production deployment
3. Plan phased rollout of patched images across OpenShift clusters
الإجراءات الفورية:
1. حصر جميع نشرات خدمة تحديث OpenShift وتحديد إصدارات الصور المتأثرة
2. تطبيق سياسات أمان وقت تشغيل الحاوية الصارمة التي تقيد تعديلات عضوية المجموعة
3. تطبيق مبدأ أقل امتياز: إزالة المستخدمين غير الجذر من عضوية مجموعة الجذر
4. تفعيل معايير أمان Pod (PSS) بملف تعريف مقيد لتحديد قدرات الحاوية
الضوابط التعويضية (حتى توفر التصحيح):
1. تطبيق نظام ملفات الجذر للقراءة فقط (readOnlyRootFilesystem: true)
2. استخدام SecurityContext لإسقاط قدرات CAP_SETUID و CAP_SETGID
3. نشر مراقبة أمان وقت التشغيل (Falco, Sysdig) للكشف عن تعديلات /etc/passwd
4. تطبيق تقسيم الشبكة لتحديد الاتصال بين الحاويات
5. استخدام أدوات فحص الصور للكشف ومنع نشر صور OSUS المتأثرة
قواعد الكشف:
1. مراقبة عمليات الكتابة إلى /etc/passwd من العمليات غير الجذر
2. تنبيهات محاولات إنشاء مستخدم UID 0 داخل الحاويات
3. تتبع تغييرات عضوية المجموعة في الحاويات قيد التشغيل
4. مراقبة محاولات الهروب من الحاوية عبر تصعيد الامتيازات