The ElementCamp plugin for WordPress is vulnerable to time-based SQL Injection via the 'meta_query[compare]' parameter in the 'tcg_select2_search_post' AJAX action in all versions up to, and including, 2.3.6. This is due to the user-supplied compare value being placed as an SQL operator in the query without validation against an allowlist of comparison operators. The value is passed through esc_sql(), but since the payload operates as an operator (not inside quotes), esc_sql() has no effect on payloads that don't contain quote characters. This makes it possible for authenticated attackers, with Author-level access and above, to append additional SQL queries into already existing queries that can be used to extract sensitive information from the database.
The ElementCamp WordPress plugin versions up to 2.3.6 contain a time-based SQL injection vulnerability in the AJAX 'tcg_select2_search_post' action. Authenticated users with Author-level privileges can exploit the unvalidated 'meta_query[compare]' parameter to extract sensitive database information. While currently unpatched, the vulnerability requires authentication and elevated privileges, reducing immediate risk but requiring urgent attention for organizations using this plugin.
IMMEDIATE ACTIONS:
1. Audit all WordPress installations using ElementCamp plugin version 2.3.6 or earlier across your organization
2. Review user access logs for the 'tcg_select2_search_post' AJAX action to identify suspicious activity
3. Restrict Author-level and above user accounts to trusted personnel only
4. Disable the ElementCamp plugin if not actively used
PATCHING GUIDANCE:
1. Contact ElementCamp developers for security updates or timeline
2. Monitor official plugin repository for patch releases
3. Implement version control to track plugin updates
COMPENSATING CONTROLS (until patch available):
1. Implement Web Application Firewall (WAF) rules to block requests containing SQL operators in 'meta_query[compare]' parameter
2. Apply principle of least privilege: audit and reduce Author-level accounts
3. Implement database activity monitoring (DAM) to detect unusual SQL queries
4. Enable WordPress security logging and centralize logs to SIEM
5. Restrict AJAX endpoint access via IP whitelisting if possible
DETECTION RULES:
1. Monitor POST requests to wp-admin/admin-ajax.php with action=tcg_select2_search_post
2. Alert on meta_query[compare] parameters containing SQL operators (=, <>, <, >, <=, >=, LIKE, IN, BETWEEN, EXISTS)
3. Detect time-based SQL injection patterns: SLEEP(), BENCHMARK(), WAITFOR DELAY
4. Monitor database query logs for UNION SELECT, subqueries, or unusual WHERE clauses from WordPress user
5. Track failed database authentication attempts and query timeouts
الإجراءات الفورية:
1. تدقيق جميع تثبيتات WordPress التي تستخدم مكون ElementCamp الإصدار 2.3.6 أو أقدم عبر المنظمة
2. مراجعة سجلات الوصول للمستخدمين لإجراء AJAX 'tcg_select2_search_post' لتحديد النشاط المريب
3. تقييد حسابات المستخدمين من مستوى المؤلف وما فوق للموظفين الموثوقين فقط
4. تعطيل مكون ElementCamp إذا لم يكن قيد الاستخدام النشط
إرشادات التصحيح:
1. التواصل مع مطوري ElementCamp للحصول على تحديثات الأمان أو الجدول الزمني
2. مراقبة مستودع المكون الرسمي للإصدارات المصححة
3. تنفيذ التحكم في الإصدارات لتتبع تحديثات المكون
الضوابط البديلة (حتى توفر التصحيح):
1. تنفيذ قواعد جدار حماية تطبيقات الويب (WAF) لحظر الطلبات التي تحتوي على عوامل SQL في معامل 'meta_query[compare]'
2. تطبيق مبدأ أقل امتياز: تدقيق وتقليل حسابات مستوى المؤلف
3. تنفيذ مراقبة نشاط قاعدة البيانات (DAM) للكشف عن استعلامات SQL غير العادية
4. تفعيل تسجيل أمان WordPress وتجميع السجلات في SIEM
5. تقييد الوصول إلى نقطة نهاية AJAX عبر القائمة البيضاء للعناوين إن أمكن
قواعد الكشف:
1. مراقبة طلبات POST إلى wp-admin/admin-ajax.php مع action=tcg_select2_search_post
2. التنبيه على معاملات meta_query[compare] التي تحتوي على عوامل SQL (=، <>، <، >، <=، >=، LIKE، IN، BETWEEN، EXISTS)
3. الكشف عن أنماط حقن SQL القائمة على الوقت: SLEEP()، BENCHMARK()، WAITFOR DELAY
4. مراقبة سجلات استعلامات قاعدة البيانات عن UNION SELECT والاستعلامات الفرعية أو شروط WHERE غير العادية من مستخدم WordPress
5. تتبع محاولات المصادقة الفاشلة في قاعدة البيانات وانتهاء مهلة الاستعلام