MikroTik RouterOS Stack-Based Buffer Overflow Vulnerability — In MikroTik RouterOS, a stack-based buffer overflow occurs when processing NetBIOS session request messages. Remote attackers with access to the service can exploit this vulnerability and gain code execution on the system.
CVE-2018-7445 is a critical stack-based buffer overflow vulnerability in MikroTik RouterOS that allows remote code execution through malicious NetBIOS session request messages. With a CVSS score of 9.0 and publicly available exploits, this vulnerability enables unauthenticated attackers to gain full control of affected routers. MikroTik devices are widely deployed across Saudi Arabia in enterprise, ISP, and government networks, making this a high-priority threat. Organizations should immediately patch or restrict access to the SMB/NetBIOS service on all MikroTik devices.
Immediate Actions:
1. Identify all MikroTik RouterOS devices in your network using asset inventory and network scanning tools
2. Disable the SMB/NetBIOS service immediately if not required: /ip smb set enabled=no
3. Restrict access to port 139 (NetBIOS) using firewall rules to trusted management IPs only
Patching Guidance:
4. Update MikroTik RouterOS to version 6.41.3 or later (stable) or 6.42rc27 or later (release candidate)
5. Verify the update was applied successfully by checking /system resource print
Compensating Controls:
6. Implement network segmentation to isolate management interfaces from untrusted networks
7. Deploy IDS/IPS signatures to detect NetBIOS buffer overflow exploitation attempts
8. Block port 139 at perimeter firewalls for all MikroTik devices
9. Enable logging on MikroTik devices and forward logs to SIEM for monitoring
Detection Rules:
10. Monitor for unusual NetBIOS traffic patterns targeting MikroTik devices
11. Alert on any SMB/NetBIOS connections from external IP addresses to router management interfaces
12. Check for indicators of compromise including unauthorized configuration changes and new user accounts
الإجراءات الفورية:
1. تحديد جميع أجهزة MikroTik RouterOS في شبكتك باستخدام أدوات جرد الأصول ومسح الشبكة
2. تعطيل خدمة SMB/NetBIOS فوراً إذا لم تكن مطلوبة: /ip smb set enabled=no
3. تقييد الوصول إلى المنفذ 139 (NetBIOS) باستخدام قواعد جدار الحماية لعناوين IP الإدارية الموثوقة فقط
إرشادات التصحيح:
4. تحديث نظام MikroTik RouterOS إلى الإصدار 6.41.3 أو أحدث (مستقر) أو 6.42rc27 أو أحدث
5. التحقق من تطبيق التحديث بنجاح عبر فحص /system resource print
الضوابط التعويضية:
6. تنفيذ تجزئة الشبكة لعزل واجهات الإدارة عن الشبكات غير الموثوقة
7. نشر توقيعات IDS/IPS للكشف عن محاولات استغلال تجاوز سعة NetBIOS
8. حظر المنفذ 139 على جدران الحماية المحيطية لجميع أجهزة MikroTik
9. تفعيل التسجيل على أجهزة MikroTik وإعادة توجيه السجلات إلى نظام SIEM للمراقبة
قواعد الكشف:
10. مراقبة أنماط حركة NetBIOS غير العادية التي تستهدف أجهزة MikroTik
11. التنبيه على أي اتصالات SMB/NetBIOS من عناوين IP خارجية إلى واجهات إدارة أجهزة التوجيه
12. التحقق من مؤشرات الاختراق بما في ذلك تغييرات التكوين غير المصرح بها وحسابات المستخدمين الجديدة