A container privilege escalation flaw was found in certain Web Terminal 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-57853 is a container privilege escalation vulnerability affecting Web Terminal images where /etc/passwd is created with group-writable permissions during build time. Non-root users who are members of the root group can modify /etc/passwd to create arbitrary users with UID 0, achieving full root privileges within containers. With no patch currently available and no public exploits, this represents a medium-risk vulnerability requiring immediate compensating controls in containerized environments.
Immediate Actions:
1. Audit all Web Terminal container images in use and identify those with group-writable /etc/passwd permissions
2. Review container build processes and Dockerfiles to identify vulnerable image creation patterns
3. Implement container runtime security policies to restrict group membership modifications
Compensating Controls (until patch available):
1. Rebuild affected container images with /etc/passwd created with 0644 permissions (non-group-writable)
2. Implement Pod Security Standards (PSS) or Pod Security Policies (PSP) to enforce read-only root filesystems
3. Use securityContext in Kubernetes deployments: readOnlyRootFilesystem: true, runAsNonRoot: true
4. Deploy runtime security tools (Falco, Sysdig) to detect /etc/passwd modification attempts
5. Restrict container execution to specific UIDs/GIDs, preventing root group membership for non-root users
6. Implement network segmentation to limit lateral movement from compromised containers
Detection Rules:
1. Monitor for open() syscalls targeting /etc/passwd with write flags from non-root processes
2. Alert on any modification to /etc/passwd file permissions or content
3. Track process execution with UID 0 spawned from non-root parent processes
4. Monitor group membership changes within containers
الإجراءات الفورية:
1. تدقيق جميع صور حاويات Web Terminal المستخدمة وتحديد تلك التي تحتوي على أذونات /etc/passwd قابلة للكتابة من المجموعة
2. مراجعة عمليات بناء الحاويات و Dockerfiles لتحديد أنماط إنشاء الصور الضعيفة
3. تنفيذ سياسات أمان وقت تشغيل الحاويات لتقييد تعديلات عضوية المجموعة
الضوابط التعويضية (حتى توفر التصحيح):
1. إعادة بناء صور الحاويات المتأثرة مع إنشاء /etc/passwd برمز 0644 (غير قابل للكتابة من المجموعة)
2. تنفيذ معايير أمان Pod (PSS) أو سياسات أمان Pod (PSP) لفرض أنظمة ملفات الجذر للقراءة فقط
3. استخدام securityContext في نشرات Kubernetes: readOnlyRootFilesystem: true, runAsNonRoot: true
4. نشر أدوات أمان وقت التشغيل (Falco, Sysdig) للكشف عن محاولات تعديل /etc/passwd
5. تقييد تنفيذ الحاويات على UIDs/GIDs محددة، منع عضوية مجموعة الجذر للمستخدمين غير الجذر
6. تنفيذ تقسيم الشبكة لتحديد الحركة الجانبية من الحاويات المخترقة
قواعد الكشف:
1. مراقبة استدعاءات open() syscalls التي تستهدف /etc/passwd برايات الكتابة من عمليات غير جذر
2. تنبيهات على أي تعديل لأذونات أو محتوى ملف /etc/passwd
3. تتبع تنفيذ العملية مع UID 0 المنبثقة من عمليات الوالد غير الجذر
4. مراقبة تغييرات عضوية المجموعة داخل الحاويات