OpenClaw before 2026.3.28 loads the current working directory .env file before trusted state-dir configuration, allowing environment variable injection. Attackers can place a malicious .env file in a repository or workspace to override runtime configuration and security-sensitive environment settings during OpenClaw startup.
CVE-2026-41294 is a high-severity environment variable injection vulnerability in OpenClaw that allows attackers to override critical runtime and security configurations by placing malicious .env files in repositories or workspaces. The vulnerability affects OpenClaw versions before 2026.3.28 and has a CVSS score of 8.6, making it a significant threat to organizations using this tool for development and deployment workflows. No patch is currently available, requiring immediate compensating controls and monitoring.
IMMEDIATE ACTIONS:
1. Audit all repositories and workspaces for presence of .env files, particularly in shared or public repositories
2. Implement file system monitoring to detect creation of .env files in unexpected locations
3. Restrict OpenClaw execution to trusted directories only using OS-level access controls
4. Review all environment variables currently set during OpenClaw initialization for unauthorized modifications
COMPENSATING CONTROLS:
1. Enforce read-only file system permissions on production deployment directories
2. Use environment variable whitelisting - only allow explicitly approved variables to be loaded
3. Implement code review requirements for any .env file changes before merge to main branches
4. Deploy secrets management solutions (HashiCorp Vault, AWS Secrets Manager) instead of .env files
5. Use container-based deployments with immutable configurations to prevent runtime .env injection
6. Implement strict RBAC to limit who can modify workspace configurations
DETECTION RULES:
1. Monitor for .env file creation in current working directories before OpenClaw startup
2. Alert on environment variable changes that deviate from baseline configurations
3. Log all OpenClaw initialization events with environment variable snapshots
4. Detect suspicious environment variables containing credentials, API keys, or security tokens
5. Monitor for .env files in version control systems and block commits containing them
PATCHING GUIDANCE:
1. Upgrade to OpenClaw 2026.3.28 or later when available
2. Until patch is available, disable OpenClaw in untrusted environments
3. If upgrade is not immediately possible, run OpenClaw in isolated containers with minimal environment variable exposure
الإجراءات الفورية:
1. تدقيق جميع المستودعات ومساحات العمل للتحقق من وجود ملفات .env، خاصة في المستودعات المشتركة أو العامة
2. تنفيذ مراقبة نظام الملفات للكشف عن إنشاء ملفات .env في مواقع غير متوقعة
3. تقييد تنفيذ OpenClaw للمجلدات الموثوقة فقط باستخدام ضوابط الوصول على مستوى نظام التشغيل
4. مراجعة جميع متغيرات البيئة المعينة حالياً أثناء تهيئة OpenClaw للتحقق من التعديلات غير المصرح بها
الضوابط التعويضية:
1. فرض أذونات نظام الملفات للقراءة فقط على مجلدات النشر الإنتاجي
2. استخدام قائمة بيضاء لمتغيرات البيئة - السماح فقط بتحميل المتغيرات المعتمدة صراحة
3. تنفيذ متطلبات مراجعة الكود لأي تغييرات على ملفات .env قبل الدمج في الفروع الرئيسية
4. نشر حلول إدارة الأسرار (HashiCorp Vault، AWS Secrets Manager) بدلاً من ملفات .env
5. استخدام النشر القائم على الحاويات مع التكوينات غير القابلة للتغيير لمنع حقن .env في وقت التشغيل
6. تنفيذ RBAC صارم لتحديد من يمكنه تعديل تكوينات مساحة العمل
قواعد الكشف:
1. مراقبة إنشاء ملفات .env في مجلدات العمل الحالية قبل بدء تشغيل OpenClaw
2. التنبيه على تغييرات متغيرات البيئة التي تنحرف عن التكوينات الأساسية
3. تسجيل جميع أحداث تهيئة OpenClaw مع لقطات متغيرات البيئة
4. الكشف عن متغيرات البيئة المريبة التي تحتوي على بيانات اعتماد أو مفاتيح API أو رموز أمان
5. مراقبة ملفات .env في أنظمة التحكم بالإصدارات وحظر الالتزامات التي تحتويها
إرشادات التصحيح:
1. الترقية إلى OpenClaw 2026.3.28 أو إصدار أحدث عند توفره
2. حتى يتوفر التصحيح، قم بتعطيل OpenClaw في البيئات غير الموثوقة
3. إذا لم يكن الترقية ممكنة على الفور، قم بتشغيل OpenClaw في حاويات معزولة مع الحد الأدنى من تعريض متغيرات البيئة