Grafana Path Traversal Vulnerability — Grafana contains a path traversal vulnerability that could allow access to local files.
Grafana versions prior to 8.0.3, 7.5.11, and 7.4.3 contain a critical path traversal vulnerability (CVE-2021-43798) allowing unauthenticated attackers to read arbitrary files from the server. With a CVSS score of 9.0 and publicly available exploits, this vulnerability poses an immediate threat to organizations using Grafana for monitoring and analytics. Immediate patching is essential to prevent unauthorized access to sensitive configuration files, credentials, and system data.
IMMEDIATE ACTIONS:
1. Identify all Grafana instances in your environment and document their versions
2. Isolate or restrict network access to Grafana instances immediately
3. Review access logs for suspicious file access patterns (look for ../ sequences)
4. Check for unauthorized access to /etc/passwd, /etc/shadow, configuration files
PATCHING GUIDANCE:
1. Upgrade to Grafana 8.0.3, 7.5.11, 7.4.3 or later immediately
2. For air-gapped environments, download patches from Grafana Labs official repository
3. Test patches in non-production environment first
4. Schedule emergency maintenance windows for production upgrades
COMPENSATING CONTROLS (if immediate patching not possible):
1. Implement Web Application Firewall (WAF) rules blocking requests containing "../" or URL-encoded equivalents
2. Restrict Grafana access to trusted IP ranges only
3. Disable public internet access to Grafana instances
4. Implement reverse proxy authentication in front of Grafana
5. Monitor for exploitation attempts in real-time
DETECTION RULES:
1. Monitor HTTP requests to Grafana for patterns: GET /api/datasources/proxy/*/..%2f or similar path traversal attempts
2. Alert on any successful file reads from /etc/ directories through Grafana
3. Track failed authentication attempts followed by path traversal attempts
4. Monitor Grafana logs for 'unauthorized file access' or similar error messages
الإجراءات الفورية:
1. حدد جميع مثيلات Grafana في بيئتك وقم بتوثيق إصداراتها
2. عزل أو تقييد الوصول إلى شبكة مثيلات Grafana فوراً
3. راجع سجلات الوصول للأنماط المريبة في الوصول إلى الملفات (ابحث عن تسلسلات ../)
4. تحقق من الوصول غير المصرح إلى /etc/passwd و /etc/shadow وملفات التكوين
إرشادات التصحيح:
1. قم بالترقية إلى Grafana 8.0.3 أو 7.5.11 أو 7.4.3 أو أحدث فوراً
2. للبيئات المعزولة، قم بتنزيل التصحيحات من مستودع Grafana Labs الرسمي
3. اختبر التصحيحات في بيئة غير الإنتاج أولاً
4. جدول نوافذ صيانة طارئة لترقيات الإنتاج
الضوابط البديلة (إذا لم يكن التصحيح الفوري ممكناً):
1. تطبيق قواعد جدار حماية تطبيقات الويب (WAF) تحجب الطلبات التي تحتوي على "../" أو ما يعادلها المشفرة
2. تقييد الوصول إلى Grafana على نطاقات IP موثوقة فقط
3. تعطيل الوصول العام إلى الإنترنت لمثيلات Grafana
4. تطبيق مصادقة الوكيل العكسي أمام Grafana
5. مراقبة محاولات الاستغلال في الوقت الفعلي
قواعد الكشف:
1. مراقبة طلبات HTTP إلى Grafana للأنماط: GET /api/datasources/proxy/*/..%2f أو محاولات اجتياز مسار مماثلة
2. تنبيه على أي قراءات ملفات ناجحة من أدلة /etc/ من خلال Grafana
3. تتبع محاولات المصادقة الفاشلة متبوعة بمحاولات اجتياز المسار
4. مراقبة سجلات Grafana للرسائل المتعلقة بـ 'الوصول غير المصرح إلى الملفات' أو رسائل خطأ مماثلة