In lunary-ai/lunary version 1.2.2, an account hijacking vulnerability exists due to a password reset token leak. A user with a 'viewer' role can exploit this vulnerability to hijack another user's account by obtaining the password reset token. The vulnerability is triggered when the 'viewer' role user sends a specific request to the server, which responds with a password reset token in the 'recoveryToken' parameter. This token can then be used to reset the password of another user's account without authorization. The issue results from an excessive attack surface, allowing lower-privileged users to escalate their privileges and take over accounts.
CVE-2024-5386 is a critical account hijacking vulnerability in Lunary AI v1.2.2 that allows low-privileged 'viewer' role users to obtain password reset tokens and take over other user accounts. The vulnerability stems from improper access controls that expose sensitive recovery tokens in API responses, enabling privilege escalation and unauthorized account takeover. With an 8.8 CVSS score and publicly available exploits, this poses an immediate threat to organizations using Lunary for AI monitoring and logging. Immediate patching is essential to prevent account compromise and unauthorized access to sensitive AI/ML operations data.
IMMEDIATE ACTIONS:
1. Identify all Lunary instances running version 1.2.2 or earlier in your environment
2. Restrict API access to Lunary endpoints from trusted networks only using firewall/WAF rules
3. Audit all user accounts for unauthorized password changes and suspicious login activity in the past 30 days
4. Force password reset for all users, especially those with administrative or sensitive data access
5. Review and revoke any active sessions for accounts with 'viewer' role
PATCHING GUIDANCE:
1. Upgrade Lunary to version 1.2.3 or later immediately (patch is available)
2. Test patch in non-production environment first to ensure compatibility with existing integrations
3. Apply patch during maintenance window with rollback plan prepared
4. Verify patch effectiveness by confirming 'viewer' role users cannot access recovery tokens
COMPENSATING CONTROLS (if immediate patching delayed):
1. Implement API rate limiting on password reset endpoints (max 5 requests per user per hour)
2. Deploy WAF rules to block requests containing 'recoveryToken' parameter exposure
3. Enable multi-factor authentication (MFA) for all Lunary user accounts
4. Implement IP whitelisting for administrative accounts
5. Monitor API logs for suspicious token requests from 'viewer' role accounts
DETECTION RULES:
1. Alert on any API requests from 'viewer' role accounts accessing password reset endpoints
2. Monitor for multiple failed password reset attempts from single IP address
3. Flag successful password changes without corresponding MFA verification
4. Detect 'recoveryToken' parameter in API responses to non-admin users
5. Alert on privilege escalation attempts (viewer → admin role changes)
الإجراءات الفورية:
1. تحديد جميع مثيلات Lunary التي تعمل بالإصدار 1.2.2 أو أقدم في بيئتك
2. تقييد الوصول إلى واجهة برمجية التطبيقات لنقاط نهاية Lunary من الشبكات الموثوقة فقط باستخدام قواعد جدار الحماية/WAF
3. تدقيق جميع حسابات المستخدمين للتحقق من تغييرات كلمات المرور غير المصرح بها والنشاط المريب في آخر 30 يوماً
4. فرض إعادة تعيين كلمة المرور لجميع المستخدمين، خاصة أولئك الذين لديهم وصول إلى البيانات الحساسة والإدارية
5. مراجعة وإلغاء أي جلسات نشطة لحسابات بدور 'المشاهد'
إرشادات التصحيح:
1. ترقية Lunary إلى الإصدار 1.2.3 أو أحدث على الفور (التصحيح متاح)
2. اختبار التصحيح في بيئة غير الإنتاج أولاً للتأكد من التوافق مع التكاملات الموجودة
3. تطبيق التصحيح أثناء نافذة الصيانة مع تحضير خطة الرجوع
4. التحقق من فعالية التصحيح بتأكيد عدم تمكن مستخدمي دور 'المشاهد' من الوصول إلى رموز الاسترجاع
الضوابط البديلة (إذا تأخر التصحيح الفوري):
1. تطبيق تحديد معدل واجهة برمجية التطبيقات على نقاط نهاية إعادة تعيين كلمة المرور (5 طلبات كحد أقصى لكل مستخدم في الساعة)
2. نشر قواعد WAF لحظر الطلبات التي تحتوي على كشف معامل 'recoveryToken'
3. تفعيل المصادقة متعددة العوامل (MFA) لجميع حسابات مستخدمي Lunary
4. تطبيق القائمة البيضاء للعناوين الخاصة بحسابات المسؤولين
5. مراقبة سجلات واجهة برمجية التطبيقات للطلبات المريبة للرموز من حسابات دور 'المشاهد'
قواعد الكشف:
1. تنبيه على أي طلبات واجهة برمجية تطبيقات من حسابات دور 'المشاهد' تصل إلى نقاط نهاية إعادة تعيين كلمة المرور
2. مراقبة محاولات إعادة تعيين كلمة المرور الفاشلة المتعددة من عنوان IP واحد
3. وضع علامة على تغييرات كلمات المرور الناجحة بدون التحقق المقابل من MFA
4. كشف معامل 'recoveryToken' في استجابات واجهة برمجية التطبيقات للمستخدمين غير الإداريين
5. تنبيه على محاولات تصعيد الامتيازات (المشاهد → تغييرات دور المسؤول)