The MW WP Form plugin for WordPress is vulnerable to Arbitrary File Move/Read in all versions up to and including 5.1.1. This is due to insufficient validation of the $name parameter (upload field key) passed to the generate_user_file_dirpath() function, which uses WordPress's path_join() — a function that returns absolute paths unchanged, discarding the intended base directory. The attacker-controlled key is injected via the mwf_upload_files[] POST parameter, which is loaded into the plugin's Data model via _set_request_valiables(). During form processing, regenerate_upload_file_keys() iterates over these keys and calls generate_user_filepath() with the attacker-supplied key as the $name argument — the key survives validation because the targeted file (e.g., wp-config.php) genuinely exists at the absolute path. The _get_attachments() method then re-reads the same surviving keys and passes the resolved file path to move_temp_file_to_upload_dir(), which calls rename() to move the file into the uploads folder. This makes it possible for unauthenticated attackers to move arbitrary files on the server, which can easily lead to remote code execution when the right file is moved (such as wp-config.php). The vulnerability is only exploitable if a file upload field is added to the form and the “Saving inquiry data in database” option is enabled.
CVE-2026-5436 is a critical arbitrary file move vulnerability in MW WP Form plugin affecting WordPress installations. Unauthenticated attackers can move arbitrary files on the server by manipulating upload field parameters, potentially leading to remote code execution through wp-config.php manipulation. The vulnerability requires a form with file upload capability and database storage enabled, making it a significant threat to WordPress-based government and commercial websites in Saudi Arabia.
IMMEDIATE ACTIONS:
1. Identify all WordPress installations using MW WP Form plugin (versions ≤5.1.1) via plugin audit
2. Disable or remove MW WP Form plugin immediately if not actively required
3. If plugin must remain: disable all forms with file upload functionality until patching
4. Review server logs (access.log, error.log) for POST requests to wp-admin/admin-ajax.php containing 'mwf_upload_files' parameter from 2024 onwards
5. Check uploads directory for suspicious files or recently moved system files
PATCHING GUIDANCE:
1. Monitor MW WP Form GitHub/official channels for security patch release
2. When patch becomes available, immediately update to patched version
3. Test in staging environment before production deployment
4. Implement automated plugin update mechanisms
COMPENSATING CONTROLS (until patch available):
1. Implement Web Application Firewall (WAF) rules blocking POST requests containing 'mwf_upload_files' parameter
2. Restrict file upload functionality at web server level (nginx/Apache) - disable POST to wp-admin/admin-ajax.php for non-authenticated users
3. Apply principle of least privilege: ensure WordPress process runs with minimal file system permissions
4. Implement file integrity monitoring (FIM) on wp-config.php and other critical files
5. Enable WordPress security logging and centralized log aggregation
6. Restrict uploads directory permissions (644 for files, 755 for directories)
7. Disable PHP execution in uploads directory via .htaccess or nginx configuration
DETECTION RULES:
1. Monitor for POST requests with parameter pattern: mwf_upload_files[*] containing path traversal sequences (../, absolute paths starting with /)
2. Alert on file move/rename operations involving wp-config.php, .htaccess, wp-settings.php
3. Monitor for unexpected files in wp-content/uploads directory
4. Track failed file access attempts to system files from web server process
5. Implement YARA rule: detect POST payloads with mwf_upload_files containing path traversal indicators
الإجراءات الفورية:
1. تحديد جميع تثبيتات WordPress التي تستخدم إضافة MW WP Form (الإصدارات ≤5.1.1) من خلال تدقيق الإضافات
2. تعطيل أو إزالة إضافة MW WP Form فوراً إذا لم تكن مطلوبة بنشاط
3. إذا كان يجب الاحتفاظ بالإضافة: تعطيل جميع النماذج التي تحتوي على وظيفة تحميل الملفات حتى التصحيح
4. مراجعة سجلات الخادم (access.log, error.log) للبحث عن طلبات POST تحتوي على معامل 'mwf_upload_files' من 2024 فما فوق
5. التحقق من دليل التحميلات للملفات المريبة أو الملفات النظامية المنقولة مؤخراً
إرشادات التصحيح:
1. مراقبة قنوات GitHub الرسمية لإضافة MW WP Form للإصدارات الأمنية
2. عند توفر التصحيح، قم بالتحديث الفوري إلى الإصدار المصحح
3. الاختبار في بيئة التطوير قبل نشر الإنتاج
4. تنفيذ آليات تحديث الإضافات التلقائية
الضوابط البديلة (حتى توفر التصحيح):
1. تنفيذ قواعد جدار حماية تطبيقات الويب (WAF) لحجب طلبات POST التي تحتوي على معامل 'mwf_upload_files'
2. تقييد وظيفة تحميل الملفات على مستوى خادم الويب (nginx/Apache) - تعطيل POST إلى wp-admin/admin-ajax.php للمستخدمين غير المصرحين
3. تطبيق مبدأ أقل امتياز: التأكد من أن عملية WordPress تعمل بأقل صلاحيات نظام الملفات
4. تنفيذ مراقبة سلامة الملفات (FIM) على wp-config.php والملفات الحرجة الأخرى
5. تفعيل تسجيل أمان WordPress والتجميع المركزي للسجلات
6. تقييد صلاحيات دليل التحميلات (644 للملفات، 755 للمجلدات)
7. تعطيل تنفيذ PHP في دليل التحميلات عبر .htaccess أو إعدادات nginx
قواعد الكشف:
1. مراقبة طلبات POST بنمط معامل: mwf_upload_files[*] يحتوي على تسلسلات اجتياز المسار (../, المسارات المطلقة التي تبدأ بـ /)
2. تنبيه عمليات نقل/إعادة تسمية الملفات التي تتضمن wp-config.php, .htaccess, wp-settings.php
3. مراقبة الملفات غير المتوقعة في دليل wp-content/uploads
4. تتبع محاولات الوصول الفاشلة إلى ملفات النظام من عملية خادم الويب
5. تنفيذ قاعدة YARA: الكشف عن حمولات POST مع mwf_upload_files تحتوي على مؤشرات اجتياز المسار