Windmill prior to 1.703.2 contains an incorrect default permissions vulnerability in nsjail sandbox configuration files where /etc is bind-mounted without read-write restrictions, allowing authenticated users to write arbitrary entries to /etc/hosts, /etc/resolv.conf, and /etc/ssl/certs/ca-certificates.crt from within script execution sandboxes. Attackers can exploit persistent poisoned entries across all subsequent script executions on the same worker pod to redirect hostnames, intercept DNS queries, perform transparent HTTPS man-in-the-middle attacks, and intercept WM_TOKEN JWTs to gain workspace-admin access to other users' workspaces.
Windmill versions prior to 1.703.2 contain a critical sandbox escape vulnerability allowing authenticated users to modify system configuration files (/etc/hosts, /etc/resolv.conf, /etc/ssl/certs) within script execution environments. This enables DNS poisoning, HTTPS man-in-the-middle attacks, and token interception to compromise workspace security. The vulnerability affects all subsequent script executions on compromised worker pods, creating persistent attack vectors.
IMMEDIATE ACTIONS:
1. Audit all Windmill deployments to identify version < 1.703.2
2. Restrict network access to Windmill worker pods to trusted networks only
3. Implement pod security policies to prevent /etc bind-mount modifications
4. Review audit logs for suspicious /etc file modifications within script execution contexts
5. Rotate all WM_TOKEN JWTs and workspace admin credentials immediately
COMPENSATING CONTROLS (until patch available):
1. Deploy read-only filesystem enforcement at container runtime level using seccomp/AppArmor profiles
2. Implement network policies to restrict egress from worker pods to DNS/HTTPS services
3. Use immutable container images with verified /etc/hosts, /etc/resolv.conf, /etc/ssl/certs checksums
4. Enable audit logging for all file access within /etc directories
5. Implement certificate pinning for critical HTTPS connections
6. Deploy network-based DNS query monitoring to detect poisoning attempts
DETECTION RULES:
1. Monitor for write operations to /etc/hosts, /etc/resolv.conf, /etc/ssl/certs from within container namespaces
2. Alert on DNS query anomalies or resolution changes for critical hostnames
3. Detect TLS certificate validation failures or unexpected CA certificate additions
4. Monitor for WM_TOKEN usage from unexpected source IPs or workspaces
5. Track failed authentication attempts following token interception patterns
الإجراءات الفورية:
1. تدقيق جميع نشرات Windmill لتحديد الإصدار < 1.703.2
2. تقييد الوصول إلى شبكة حاويات عمل Windmill للشبكات الموثوقة فقط
3. تنفيذ سياسات أمان الحاويات لمنع تعديلات ربط /etc
4. مراجعة سجلات التدقيق للتعديلات المريبة على ملفات /etc داخل سياقات تنفيذ البرامج النصية
5. تدوير جميع رموز WM_TOKEN وبيانات اعتماد مسؤول مساحة العمل فوراً
الضوابط التعويضية (حتى توفر التصحيح):
1. نشر فرض نظام الملفات للقراءة فقط على مستوى وقت تشغيل الحاوية باستخدام ملفات تعريف seccomp/AppArmor
2. تنفيذ سياسات الشبكة لتقييد الخروج من حاويات العمل إلى خدمات DNS/HTTPS
3. استخدام صور حاويات ثابتة مع مجاميع تحقق من /etc/hosts و /etc/resolv.conf و /etc/ssl/certs
4. تفعيل تسجيل التدقيق لجميع عمليات الوصول إلى الملفات داخل دلائل /etc
5. تنفيذ تثبيت الشهادات للاتصالات HTTPS الحرجة
6. نشر مراقبة استعلامات DNS على مستوى الشبكة للكشف عن محاولات التسميم
قواعد الكشف:
1. مراقبة عمليات الكتابة إلى /etc/hosts و /etc/resolv.conf و /etc/ssl/certs من داخل مساحات أسماء الحاويات
2. التنبيه على شذوذ استعلامات DNS أو تغييرات الدقة للأسماء المضيفة الحرجة
3. الكشف عن فشل التحقق من شهادة TLS أو إضافات شهادات CA غير المتوقعة
4. مراقبة استخدام WM_TOKEN من عناوين IP أو مساحات عمل غير متوقعة
5. تتبع محاولات المصادقة الفاشلة بعد أنماط اعتراض الرموز