The Enable Media Replace plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the ‘location_dir’ parameter in all versions up to, and including, 4.1.8 due to insufficient input sanitization and output escaping. This makes it possible for authenticated attackers, with Author-level access and above, to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page.
The Enable Media Replace WordPress plugin (versions ≤4.1.8) contains a Stored XSS vulnerability in the 'location_dir' parameter that allows authenticated users with Author-level privileges to inject malicious scripts. While requiring authentication, this vulnerability poses significant risk to WordPress installations commonly used by Saudi organizations for web presence and content management. No patch is currently available, requiring immediate compensating controls.
IMMEDIATE ACTIONS:
1. Audit all WordPress installations using Enable Media Replace plugin and document versions
2. Restrict Author-level access to only trusted personnel; review user roles and capabilities
3. Disable the 'location_dir' parameter functionality if not critical to operations
4. Implement Web Application Firewall (WAF) rules to block XSS payloads in location_dir parameter
COMPENSATING CONTROLS:
5. Deploy Content Security Policy (CSP) headers to prevent inline script execution
6. Enable WordPress security plugins (Wordfence, Sucuri) with XSS detection
7. Implement input validation: whitelist allowed directory paths, reject special characters
8. Apply output encoding: use wp_kses_post() for any location_dir display
9. Regular security audits of plugin code and database for injected scripts
DETECTION:
10. Monitor WordPress logs for location_dir parameter modifications
11. Search database for script tags in post/page metadata
12. Alert on Author-level user account creation or privilege escalation
13. Implement SIEM rules: detect <script>, javascript:, onerror= in location_dir values
الإجراءات الفورية:
1. تدقيق جميع تثبيتات ووردبريس التي تستخدم مكون Enable Media Replace وتوثيق الإصدارات
2. تقييد الوصول على مستوى المؤلف للموظفين الموثوقين فقط؛ مراجعة أدوار وقدرات المستخدمين
3. تعطيل وظيفة معامل 'location_dir' إذا لم تكن حرجة للعمليات
4. تطبيق قواعد جدار الحماية لتطبيقات الويب (WAF) لحجب حمولات XSS في معامل location_dir
الضوابط التعويضية:
5. نشر رؤوس سياسة أمان المحتوى (CSP) لمنع تنفيذ النصوص البرمجية المضمنة
6. تفعيل مكونات أمان ووردبريس (Wordfence, Sucuri) مع كشف XSS
7. تطبيق التحقق من الإدخال: إدراج مسارات الدليل المسموحة، رفض الأحرف الخاصة
8. تطبيق ترميز الإخراج: استخدام wp_kses_post() لأي عرض location_dir
9. عمليات تدقيق أمان منتظمة لكود المكون وقاعدة البيانات للنصوص المحقونة
الكشف:
10. مراقبة سجلات ووردبريس لتعديلات معامل location_dir
11. البحث في قاعدة البيانات عن علامات النصوص البرمجية في بيانات وصفية للمنشورات/الصفحات
12. التنبيه عند إنشاء حساب مستخدم على مستوى المؤلف أو تصعيد الامتيازات
13. تطبيق قواعد SIEM: كشف <script>، javascript:، onerror= في قيم location_dir