Claude Code is an agentic coding tool. Prior to version 2.0.65, vulnerability in Claude Code's project-load flow allowed malicious repositories to exfiltrate data including Anthropic API keys before users confirmed trust. An attacker-controlled repository could include a settings file that sets ANTHROPIC_BASE_URL to an attacker-controlled endpoint and when the repository was opened, Claude Code would read the configuration and immediately issue API requests before showing the trust prompt, potentially leaking the user's API keys. Users on standard Claude Code auto-update have received this fix already. Users performing manual updates are advised to update to version 2.0.65, which contains a patch, or to the latest version.
Claude Code versions prior to 2.0.65 contain a critical credential exposure vulnerability where malicious repositories can exfiltrate Anthropic API keys before users confirm trust. The vulnerability exploits the project-load flow by manipulating configuration files to redirect API requests to attacker-controlled endpoints. This poses significant risk to Saudi organizations using Claude Code for development, particularly those integrating AI-assisted coding into their software development pipelines.
IMMEDIATE ACTIONS:
1. Audit all Claude Code installations across development teams to identify versions prior to 2.0.65
2. Revoke all Anthropic API keys that may have been exposed or used with vulnerable Claude Code versions
3. Disable Claude Code auto-update if not already enabled and perform manual controlled updates
4. Review repository access logs for suspicious configuration file modifications
PATCHING GUIDANCE:
1. Update Claude Code to version 2.0.65 or latest immediately across all development environments
2. For organizations with auto-update enabled, verify update completion by checking version numbers
3. Implement mandatory update policies for development tools with security implications
COMPENSATING CONTROLS:
1. Implement network-level monitoring to detect API requests to unauthorized ANTHROPIC_BASE_URL endpoints
2. Use API key rotation policies with 30-day maximum key lifetime
3. Implement repository access controls requiring code review before opening untrusted repositories
4. Deploy endpoint detection and response (EDR) solutions to monitor for suspicious API key access patterns
5. Restrict Claude Code usage to approved, internally-vetted repositories only
DETECTION RULES:
1. Monitor for ANTHROPIC_BASE_URL configuration changes in .claude or settings files
2. Alert on API requests from Claude Code to non-standard Anthropic endpoints
3. Track API key usage patterns for anomalous authentication attempts
4. Monitor file system access to credential storage locations during repository load operations
الإجراءات الفورية:
1. تدقيق جميع تثبيتات Claude Code عبر فرق التطوير لتحديد الإصدارات السابقة للإصدار 2.0.65
2. إلغاء جميع مفاتيح Anthropic API التي قد تكون تعرضت للخطر أو تم استخدامها مع إصدارات Claude Code الضعيفة
3. تعطيل تحديث Claude Code التلقائي إن لم يكن مفعلاً بالفعل وإجراء تحديثات يدوية محكومة
4. مراجعة سجلات الوصول إلى المستودع للتعديلات المريبة على ملفات التكوين
إرشادات التصحيح:
1. تحديث Claude Code إلى الإصدار 2.0.65 أو الأحدث فوراً عبر جميع بيئات التطوير
2. للمنظمات التي تم تفعيل التحديث التلقائي فيها، تحقق من اكتمال التحديث بفحص أرقام الإصدارات
3. تنفيذ سياسات التحديث الإلزامية لأدوات التطوير ذات الآثار الأمنية
الضوابط البديلة:
1. تنفيذ المراقبة على مستوى الشبكة للكشف عن طلبات API إلى نقاط نهاية ANTHROPIC_BASE_URL غير المصرح بها
2. استخدام سياسات تدوير مفاتيح API مع حد أقصى لعمر المفتاح 30 يوماً
3. تنفيذ ضوابط الوصول إلى المستودع تتطلب مراجعة الكود قبل فتح المستودعات غير الموثوقة
4. نشر حلول الكشف والاستجابة على نقطة النهاية (EDR) لمراقبة أنماط الوصول المريبة لمفاتيح API
5. تقييد استخدام Claude Code إلى المستودعات المعتمدة والمدققة داخلياً فقط
قواعد الكشف:
1. مراقبة تغييرات تكوين ANTHROPIC_BASE_URL في ملفات .claude أو الإعدادات
2. تنبيهات على طلبات API من Claude Code إلى نقاط نهاية Anthropic غير القياسية
3. تتبع أنماط استخدام مفاتيح API للمحاولات المصادقة الشاذة
4. مراقبة الوصول إلى نظام الملفات لمواقع تخزين بيانات الاعتماد أثناء عمليات تحميل المستودع