Apache HTTP Server-Side Request Forgery (SSRF) — A crafted request uri-path can cause mod_proxy to forward the request to an origin server choosen by the remote user. This issue affects Apache HTTP Server 2.4.48 and earlier.
CVE-2021-40438 is a critical Server-Side Request Forgery (SSRF) vulnerability in Apache HTTP Server versions 2.4.48 and earlier that allows remote attackers to manipulate mod_proxy into forwarding requests to arbitrary origin servers. With a CVSS score of 9.0 and publicly available exploits, this vulnerability poses an immediate threat to organizations using vulnerable Apache configurations. Attackers can bypass network controls, access internal resources, and potentially pivot to backend systems.
IMMEDIATE ACTIONS:
1. Identify all Apache HTTP Server instances running versions 2.4.48 or earlier using: httpd -v
2. Disable mod_proxy on non-essential systems immediately
3. Implement network segmentation to restrict proxy target destinations
PATCHING:
1. Upgrade to Apache HTTP Server 2.4.49 or later (released September 2021)
2. For RHEL/CentOS: yum update httpd
3. For Debian/Ubuntu: apt-get update && apt-get install apache2
4. For Windows: Download from apache.org and reinstall
COMPENSATING CONTROLS (if immediate patching impossible):
1. Disable mod_proxy: a2dismod proxy && systemctl restart apache2
2. Implement strict URL validation using mod_rewrite to whitelist allowed proxy destinations
3. Configure ProxyRequests Off and restrict ProxyPass directives to specific internal hosts only
4. Apply firewall rules to prevent Apache from initiating outbound connections to unauthorized destinations
DETECTION:
1. Monitor Apache access logs for suspicious URI patterns containing unusual hostnames or IP addresses in proxy requests
2. Alert on ProxyPass directives being modified or new proxy routes being added
3. Implement IDS signatures for SSRF exploitation attempts
4. Monitor outbound connections from Apache processes to unexpected destinations
الإجراءات الفورية:
1. تحديد جميع نسخ خادم Apache HTTP التي تعمل بالإصدار 2.4.48 أو أقدم باستخدام: httpd -v
2. تعطيل mod_proxy على الأنظمة غير الأساسية فوراً
3. تنفيذ تقسيم الشبكة لتقييد وجهات الوكيل
التصحيح:
1. الترقية إلى Apache HTTP Server 2.4.49 أو أحدث (صدر سبتمبر 2021)
2. لـ RHEL/CentOS: yum update httpd
3. لـ Debian/Ubuntu: apt-get update && apt-get install apache2
4. لـ Windows: تحميل من apache.org وإعادة التثبيت
الضوابط البديلة (إذا كان التصحيح الفوري مستحيلاً):
1. تعطيل mod_proxy: a2dismod proxy && systemctl restart apache2
2. تنفيذ التحقق الصارم من عناوين URL باستخدام mod_rewrite لإدراج وجهات الوكيل المسموحة فقط
3. تكوين ProxyRequests Off وتقييد توجيهات ProxyPass على مضيفين داخليين محددين فقط
4. تطبيق قواعد جدار الحماية لمنع Apache من بدء اتصالات صادرة غير مصرح بها
الكشف:
1. مراقبة سجلات وصول Apache للأنماط المريبة التي تحتوي على أسماء مضيفين أو عناوين IP غير عادية في طلبات الوكيل
2. التنبيه عند تعديل توجيهات ProxyPass أو إضافة مسارات وكيل جديدة
3. تنفيذ توقيعات IDS لمحاولات استغلال SSRF
4. مراقبة الاتصالات الصادرة من عمليات Apache إلى وجهات غير متوقعة