n8n is an open source workflow automation platform. Prior to versions 1.123.32, 2.17.4, and 2.18.1, an authenticated user with permission to create or modify workflows containing a Python Code Node could escape the sandbox and achieve arbitrary code execution on the task runner container. This issue only affects instances where the Python Task Runner is enabled. This issue has been patched in versions 1.123.32, 2.17.4, and 2.18.1.
n8n workflow automation platform versions prior to 1.123.32, 2.17.4, and 2.18.1 contain a critical sandbox escape vulnerability in Python Code Nodes that allows authenticated users to execute arbitrary code on task runner containers. This vulnerability requires Python Task Runner to be enabled and affects enterprise deployments. The high CVSS score of 8.8 indicates significant risk to organizations using n8n for critical automation workflows.
IMMEDIATE ACTIONS:
1. Identify all n8n instances in your environment and document their versions
2. Disable Python Task Runner if not critical to operations
3. Restrict workflow creation/modification permissions to trusted administrators only
4. Monitor Python Code Node usage in existing workflows
5. Review audit logs for suspicious workflow modifications
PATCHING GUIDANCE:
1. Upgrade to patched versions: 1.123.32, 2.17.4, or 2.18.1 immediately
2. Test patches in non-production environments first
3. Plan maintenance windows for production upgrades
4. Verify Python Task Runner functionality post-patch
COMPENSATING CONTROLS (if patching delayed):
1. Implement network segmentation isolating task runner containers
2. Apply principle of least privilege to workflow permissions
3. Disable Python Code Node functionality if not essential
4. Implement container runtime security monitoring
5. Use read-only file systems for task runner containers where possible
DETECTION RULES:
1. Monitor for Python Code Node creation/modification by non-admin users
2. Alert on Python Code Node execution with suspicious imports (os, subprocess, socket)
3. Track container escape attempts (unusual system calls, privilege escalation)
4. Monitor outbound connections from task runner containers
5. Log all workflow modifications with user attribution
الإجراءات الفورية:
1. حدد جميع مثيلات n8n في بيئتك وقثق إصداراتها
2. عطل Python Task Runner إذا لم يكن حرجاً للعمليات
3. قيد صلاحيات إنشاء/تعديل سير العمل للمسؤولين الموثوقين فقط
4. راقب استخدام عقد Python Code في سير العمل الموجود
5. راجع سجلات التدقيق للتعديلات المريبة على سير العمل
إرشادات التصحيح:
1. قم بالترقية إلى الإصدارات المصححة: 1.123.32 أو 2.17.4 أو 2.18.1 فوراً
2. اختبر التصحيحات في بيئات غير الإنتاج أولاً
3. خطط نوافذ الصيانة لترقيات الإنتاج
4. تحقق من وظيفة Python Task Runner بعد التصحيح
الضوابط البديلة (إذا تأخر التصحيح):
1. طبق تقسيم الشبكة لعزل حاويات مشغل المهام
2. طبق مبدأ أقل امتياز لصلاحيات سير العمل
3. عطل وظيفة عقدة Python Code إذا لم تكن ضرورية
4. طبق مراقبة أمان وقت التشغيل للحاويات
5. استخدم أنظمة الملفات للقراءة فقط لحاويات مشغل المهام حيث أمكن
قواعد الكشف:
1. راقب إنشاء/تعديل عقدة Python Code من قبل المستخدمين غير الإداريين
2. نبه على تنفيذ عقدة Python Code مع استيراد مريب (os, subprocess, socket)
3. تتبع محاولات الهروب من الحاويات (استدعاءات نظام غير عادية، تصعيد الامتيازات)
4. راقب الاتصالات الصادرة من حاويات مشغل المهام
5. سجل جميع تعديلات سير العمل مع نسبة المستخدم