OpenClaw is a personal AI assistant. In versions 2026.2.13 and below, when using macOS, the Claude CLI keychain credential refresh path constructed a shell command to write the updated JSON blob into Keychain via security add-generic-password -w .... Because OAuth tokens are user-controlled data, this created an OS command injection risk. This issue has been fixed in version 2026.2.14.
OpenClaw AI assistant versions 2026.2.13 and below contain an OS command injection vulnerability in macOS keychain credential handling. User-controlled OAuth tokens are improperly sanitized when constructing shell commands for credential storage, allowing potential arbitrary command execution with user privileges. This vulnerability affects developers and organizations using OpenClaw for AI-assisted development workflows. Patch to version 2026.2.14 is available and should be applied immediately.
IMMEDIATE ACTIONS:
1. Identify all macOS systems running OpenClaw versions 2026.2.13 or below using inventory management tools
2. Isolate affected development machines from production networks if handling sensitive credentials
3. Audit keychain entries for suspicious modifications or unauthorized access attempts
4. Review OAuth token usage logs for anomalous command patterns
PATCHING:
1. Update OpenClaw to version 2026.2.14 or later immediately
2. Verify patch installation: openclaw --version
3. Regenerate all OAuth tokens and credentials used with vulnerable versions
4. Clear cached credentials from macOS Keychain: security delete-generic-password -a openclaw
COMPENSATING CONTROLS (if immediate patching delayed):
1. Restrict OpenClaw usage to non-production development environments
2. Implement application-level input validation for OAuth token handling
3. Use environment variables instead of keychain storage where possible
4. Monitor system logs for suspicious security add-generic-password commands
DETECTION:
1. Monitor for: security add-generic-password commands with unusual parameters or special characters
2. Alert on: Keychain modifications outside normal OpenClaw operations
3. Log all OAuth token refresh events and correlate with shell command execution
4. Implement EDR rules: Process execution from security command with injected payloads
الإجراءات الفورية:
1. تحديد جميع أنظمة macOS التي تقوم بتشغيل إصدارات OpenClaw 2026.2.13 أو أقدم باستخدام أدوات إدارة المخزون
2. عزل أجهزة التطوير المتأثرة عن شبكات الإنتاج إذا كانت تتعامل مع بيانات اعتماد حساسة
3. تدقيق إدخالات سلسلة المفاتيح للتعديلات المريبة أو محاولات الوصول غير المصرح بها
4. مراجعة سجلات استخدام رموز OAuth للأنماط الشاذة
التصحيح:
1. تحديث OpenClaw إلى الإصدار 2026.2.14 أو أحدث فوراً
2. التحقق من تثبيت التصحيح: openclaw --version
3. إعادة إنشاء جميع رموز OAuth وبيانات الاعتماد المستخدمة مع الإصدارات الضعيفة
4. مسح بيانات الاعتماد المخزنة مؤقتاً من سلسلة مفاتيح macOS: security delete-generic-password -a openclaw
الضوابط البديلة:
1. تقييد استخدام OpenClaw على بيئات التطوير غير الإنتاجية
2. تنفيذ التحقق من صحة المدخلات على مستوى التطبيق لمعالجة رموز OAuth
3. استخدام متغيرات البيئة بدلاً من تخزين سلسلة المفاتيح حيث أمكن
4. مراقبة سجلات النظام للأوامر المريبة security add-generic-password
الكشف:
1. مراقبة: أوامر security add-generic-password بمعاملات غير عادية أو أحرف خاصة
2. التنبيه على: تعديلات سلسلة المفاتيح خارج عمليات OpenClaw العادية
3. تسجيل جميع أحداث تحديث رموز OAuth والربط مع تنفيذ أوامر shell
4. تنفيذ قواعد EDR: تنفيذ العملية من أمر الأمان برموز مدرجة