Moodle 3.10.3 contains a persistent cross-site scripting vulnerability in the calendar event subtitle field that allows attackers to inject malicious scripts. Attackers can craft a calendar event with malicious JavaScript in the subtitle track label to execute arbitrary code when users view the event.
CVE-2021-47857 is a persistent XSS vulnerability in Moodle 3.10.3's calendar event subtitle field that allows attackers to inject malicious JavaScript code. When users view crafted calendar events, the injected scripts execute in their browsers, potentially compromising user sessions and data. This vulnerability poses significant risk to educational institutions and organizations using Moodle for learning management, particularly in Saudi Arabia where Moodle adoption is widespread in universities and government training programs.
Immediate Actions:
1. Identify all Moodle 3.10.3 instances in your organization and document their locations
2. Restrict calendar event creation to trusted administrators only as a temporary measure
3. Audit existing calendar events for suspicious JavaScript patterns in subtitle fields
4. Clear browser caches across all user devices to remove cached malicious scripts
Patching Guidance:
1. Upgrade Moodle to version 3.10.4 or later immediately
2. Apply security patches from Moodle Security Tracker (https://tracker.moodle.org/)
3. Test patches in staging environment before production deployment
4. Implement automated patching procedures for future Moodle updates
Compensating Controls:
1. Implement Content Security Policy (CSP) headers to restrict script execution
2. Enable Moodle's HTML filtering and sanitization features
3. Use Web Application Firewall (WAF) rules to detect XSS patterns in calendar events
4. Implement input validation on subtitle fields to reject special characters
5. Monitor calendar event creation logs for suspicious activity
Detection Rules:
1. Search calendar event database for JavaScript keywords: <script>, javascript:, onerror=, onload=, eval(
2. Monitor HTTP requests containing encoded XSS payloads (%3Cscript%3E, etc.)
3. Alert on calendar events with subtitle field length exceeding normal parameters
4. Track user accounts creating multiple calendar events with similar malicious patterns
الإجراءات الفورية:
1. حدد جميع مثيلات Moodle 3.10.3 في مؤسستك وقم بتوثيق مواقعها
2. قيد إنشاء أحداث التقويم للمسؤولين الموثوقين فقط كإجراء مؤقت
3. تدقيق أحداث التقويم الموجودة للبحث عن أنماط JavaScript المريبة في حقول العناوين الفرعية
4. امسح ذاكرة التخزين المؤقت للمتصفح عبر جميع أجهزة المستخدم لإزالة البرامج النصية الضارة المخزنة مؤقتاً
إرشادات التصحيح:
1. قم بترقية Moodle إلى الإصدار 3.10.4 أو أحدث على الفور
2. تطبيق تصحيحات الأمان من Moodle Security Tracker
3. اختبر التصحيحات في بيئة التدريج قبل نشر الإنتاج
4. تنفيذ إجراءات التصحيح الآلية للتحديثات المستقبلية
الضوابط البديلة:
1. تنفيذ رؤوس سياسة أمان المحتوى (CSP) لتقييد تنفيذ البرامج النصية
2. تفعيل ميزات تصفية وتطهير HTML في Moodle
3. استخدام قواعد جدار حماية تطبيقات الويب (WAF) للكشف عن أنماط XSS
4. تنفيذ التحقق من صحة الإدخال على حقول العناوين الفرعية لرفض الأحرف الخاصة
5. مراقبة سجلات إنشاء أحداث التقويم للنشاط المريب
قواعد الكشف:
1. البحث في قاعدة بيانات أحداث التقويم عن كلمات JavaScript الرئيسية
2. مراقبة طلبات HTTP التي تحتوي على حمولات XSS المشفرة
3. تنبيه على أحداث التقويم التي يتجاوز طول حقل العنوان الفرعي فيها المعاملات العادية
4. تتبع حسابات المستخدمين التي تنشئ أحداث تقويم متعددة بأنماط ضارة مماثلة