WordPress Plugin WPGraphQL 1.3.5 contains a denial of service vulnerability that allows unauthenticated attackers to exhaust server resources by sending batched GraphQL queries with duplicated fields. Attackers can send POST requests to the GraphQL endpoint with amplified field duplication payloads to trigger server out-of-memory conditions and MySQL connection errors.
CVE-2021-47959 is a denial of service vulnerability in WPGraphQL 1.3.5 that allows unauthenticated attackers to exhaust server resources through batched GraphQL queries with duplicated fields, potentially causing out-of-memory conditions and database connection failures. This vulnerability poses significant risk to WordPress-based web applications across Saudi Arabia, particularly those hosting critical business operations. The lack of available patches requires immediate implementation of compensating controls and rate limiting measures.
Immediate Actions:
1. Disable or remove WPGraphQL plugin version 1.3.5 if not actively required
2. If WPGraphQL is essential, upgrade to version 1.3.6 or later when available
3. Implement Web Application Firewall (WAF) rules to detect and block GraphQL queries with excessive field duplication patterns
Compensating Controls:
1. Implement rate limiting on GraphQL endpoint: limit POST requests to /graphql to 10-20 requests per minute per IP address
2. Configure query complexity analysis: reject GraphQL queries exceeding complexity threshold of 1000 points
3. Set MySQL max_connections and PHP memory_limit to prevent cascading failures
4. Implement request size limits: restrict POST body size to 1MB maximum
5. Deploy DDoS mitigation service (Cloudflare, AWS Shield) for external-facing WordPress instances
Detection Rules:
1. Monitor for POST requests to /graphql endpoint with repeated field names in query payload
2. Alert on MySQL connection pool exhaustion or "too many connections" errors
3. Track PHP out-of-memory errors correlated with GraphQL endpoint access
4. Monitor server CPU and memory spikes during GraphQL query processing
5. Log and analyze batched GraphQL queries (multiple queries in single request)
الإجراءات الفورية:
1. تعطيل أو إزالة مكون WPGraphQL الإصدار 1.3.5 إذا لم يكن مطلوباً بشكل نشط
2. إذا كان WPGraphQL ضرورياً، قم بالترقية إلى الإصدار 1.3.6 أو أحدث عند توفره
3. تنفيذ قواعد جدار حماية تطبيقات الويب (WAF) للكشف عن حجب استعلامات GraphQL ذات تكرار الحقول المفرط
الضوابط البديلة:
1. تنفيذ تحديد معدل الطلبات على نقطة نهاية GraphQL: تحديد طلبات POST إلى /graphql بـ 10-20 طلب في الدقيقة لكل عنوان IP
2. تكوين تحليل تعقيد الاستعلام: رفض استعلامات GraphQL التي تتجاوز حد التعقيد 1000 نقطة
3. تعيين max_connections و PHP memory_limit لمنع الأعطال المتسلسلة
4. تنفيذ حدود حجم الطلب: تقييد حجم نص POST إلى 1 ميجابايت كحد أقصى
5. نشر خدمة تخفيف هجمات DDoS (Cloudflare، AWS Shield) لمثيلات WordPress الموجهة للخارج
قواعد الكشف:
1. مراقبة طلبات POST إلى نقطة نهاية /graphql مع أسماء حقول مكررة في حمولة الاستعلام
2. التنبيه عند استنزاف مجموعة اتصالات MySQL أو أخطاء "عدد كبير جداً من الاتصالات"
3. تتبع أخطاء نقص الذاكرة في PHP المرتبطة بوصول نقطة نهاية GraphQL
4. مراقبة ارتفاعات CPU والذاكرة على الخادم أثناء معالجة استعلام GraphQL
5. تسجيل وتحليل استعلامات GraphQL المجمعة (استعلامات متعددة في طلب واحد)