CI4MS is a CodeIgniter 4-based CMS skeleton that delivers a production-ready, modular architecture with RBAC authorization and theme support. Prior to version 0.31.0.0, the application fails to immediately revoke active user sessions when an account is deleted. Due to a logic flaw in the backend design, account state changes are enforced only during authentication (login), not for already-established sessions. The system implicitly assumes that authenticated users remain trusted for the lifetime of their session. There is no session expiration or account expiration mechanism in place, causing deleted accounts to retain indefinite access until the user manually logs out. This behavior breaks the intended access control policy and results in persistent unauthorized access. This issue has been patched in version 0.31.0.0.
CI4MS versions prior to 0.31.0.0 fail to revoke active sessions when user accounts are deleted, allowing deleted users to maintain indefinite access until manual logout. This critical access control flaw (CWE-284) affects any organization using CI4MS for internal systems, particularly those managing sensitive business processes. The vulnerability is exploitable and poses significant risk to Saudi enterprises relying on this CodeIgniter 4-based CMS for administrative and operational functions.
IMMEDIATE ACTIONS:
1. Identify all CI4MS deployments in your organization and document version numbers
2. Implement immediate access control: Disable or terminate all active sessions for any deleted user accounts manually through database intervention
3. Audit user deletion logs for the past 90 days and review access logs for deleted accounts
4. Implement compensating control: Deploy session monitoring to detect and terminate sessions from deleted user accounts
PATCHING GUIDANCE:
1. Upgrade CI4MS to version 0.31.0.0 or later immediately
2. Test patch in non-production environment first
3. Plan maintenance window for production deployment
4. Verify session revocation works post-patch by testing account deletion workflow
COMPENSATING CONTROLS (if immediate upgrade not possible):
1. Implement session timeout mechanism: Set maximum session lifetime to 8 hours or less
2. Deploy middleware to validate user account status on each request
3. Implement real-time session revocation: Create database trigger to invalidate sessions when user.deleted_at is set
4. Enable comprehensive session logging with user account status checks
5. Implement daily batch job to purge sessions for deleted accounts
DETECTION RULES:
1. Monitor for authentication logs showing activity from accounts marked as deleted
2. Alert on session activity where user.deleted_at timestamp is not null
3. Track session creation timestamps vs. account deletion timestamps
4. Monitor for privilege escalation attempts from deleted accounts
5. Implement SIEM rule: Alert if session_user_id exists in deleted_users table
الإجراءات الفورية:
1. حدد جميع نشرات CI4MS في مؤسستك وقم بتوثيق أرقام الإصدارات
2. تطبيق التحكم الفوري بالوصول: تعطيل أو إنهاء جميع الجلسات النشطة لأي حسابات مستخدمين محذوفة يدويًا من خلال التدخل في قاعدة البيانات
3. تدقيق سجلات حذف المستخدمين لآخر 90 يومًا ومراجعة سجلات الوصول للحسابات المحذوفة
4. تطبيق التحكم البديل: نشر مراقبة الجلسة لاكتشاف وإنهاء الجلسات من حسابات المستخدمين المحذوفة
إرشادات التصحيح:
1. ترقية CI4MS إلى الإصدار 0.31.0.0 أو أحدث على الفور
2. اختبار التصحيح في بيئة غير الإنتاج أولاً
3. خطط نافذة الصيانة لنشر الإنتاج
4. تحقق من عمل إلغاء الجلسة بعد التصحيح بواسطة اختبار سير عمل حذف الحساب
الضوابط البديلة (إذا لم يكن الترقية الفورية ممكنة):
1. تطبيق آلية انتهاء صلاحية الجلسة: تعيين أقصى مدة حياة للجلسة إلى 8 ساعات أو أقل
2. نشر البرنامج الوسيط للتحقق من حالة حساب المستخدم في كل طلب
3. تطبيق إلغاء الجلسة في الوقت الفعلي: إنشاء محفز قاعدة البيانات لإبطال الجلسات عند تعيين user.deleted_at
4. تفعيل تسجيل الجلسة الشامل مع فحوصات حالة حساب المستخدم
5. تطبيق مهمة دفعية يومية لتنظيف الجلسات للحسابات المحذوفة
قواعد الكشف:
1. مراقبة سجلات المصادقة التي تظهر نشاطًا من الحسابات المحددة كمحذوفة
2. تنبيه نشاط الجلسة حيث user.deleted_at timestamp ليس فارغًا
3. تتبع طوابع زمن إنشاء الجلسة مقابل طوابع زمن حذف الحساب
4. مراقبة محاولات تصعيد الامتيازات من الحسابات المحذوفة
5. تطبيق قاعدة SIEM: تنبيه إذا كان session_user_id موجودًا في جدول deleted_users