FastNetMon Community Edition through 1.2.9 is vulnerable to a local symlink attack via predictable file paths in /tmp. The statistics file path defaults to '/tmp/fastnetmon.dat' (src/fastnetmon.cpp line 159). The print_screen_contents_into_file() function (src/fastnetmon_logic.cpp line 2186) opens this path with std::ios::trunc without checking for symlinks or using O_NOFOLLOW. Additionally, the chmod() call on line 2190 always operates on cli_stats_file_path regardless of which file_path parameter was passed (a bug that applies wrong permissions), and the umask is set to 0 during daemonization (src/fastnetmon.cpp line 1821), making all created files world-writable. A local attacker can exploit this to overwrite arbitrary files as the FastNetMon process user (typically root).
FastNetMon Community Edition versions through 1.2.9 contain a critical local privilege escalation vulnerability via symlink attacks on predictable /tmp file paths. An authenticated local attacker can overwrite arbitrary files with root privileges by exploiting insecure file handling, predictable paths, and world-writable permissions. This vulnerability is particularly severe in Saudi telecom and ISP environments where FastNetMon is commonly deployed for DDoS detection and network monitoring.
IMMEDIATE ACTIONS:
1. Audit all systems running FastNetMon Community Edition ≤1.2.9 and document deployment locations
2. Restrict local access to systems running FastNetMon using OS-level access controls
3. Implement file integrity monitoring (FIM) on /tmp and FastNetMon configuration directories
4. Monitor for suspicious symlink creation in /tmp using auditd rules
COMPENSATING CONTROLS (until patch available):
1. Deploy FastNetMon in isolated containers/VMs with restricted local access
2. Use AppArmor or SELinux to restrict FastNetMon process capabilities
3. Mount /tmp with nofollow,nosuid,nodev options: mount -o remount,nofollow,nosuid,nodev /tmp
4. Implement strict file permissions: umask 0077 for FastNetMon process
5. Use dedicated non-root user for FastNetMon execution instead of root
6. Implement network segmentation to limit local access to FastNetMon systems
DETECTION RULES:
1. auditd rule: -w /tmp/fastnetmon.dat -p wa -k fastnetmon_writes
2. Monitor for symlink creation: auditctl -a always,exit -F arch=b64 -S symlinkat,symlink -F dir=/tmp -k symlink_creation
3. Alert on FastNetMon process running as root with unusual file operations
4. Monitor /tmp for files with world-writable permissions created by FastNetMon
PATCHING STRATEGY:
1. Contact FastNetMon developers for security patch timeline
2. Prepare migration plan to alternative DDoS detection solutions (Suricata, Zeek)
3. Evaluate commercial FastNetMon versions if available
4. Test any patches in isolated lab environment before production deployment
الإجراءات الفورية:
1. تدقيق جميع الأنظمة التي تقوم بتشغيل FastNetMon Community Edition ≤1.2.9 وتوثيق مواقع النشر
2. تقييد الوصول المحلي للأنظمة التي تقوم بتشغيل FastNetMon باستخدام عناصر التحكم في الوصول على مستوى نظام التشغيل
3. تنفيذ مراقبة سلامة الملفات (FIM) على /tmp وأدلة تكوين FastNetMon
4. مراقبة إنشاء الروابط الرمزية المريبة في /tmp باستخدام قواعد auditd
عناصر التحكم التعويضية (حتى توفر الرقعة):
1. نشر FastNetMon في حاويات/أجهزة افتراضية معزولة مع وصول محلي مقيد
2. استخدام AppArmor أو SELinux لتقييد قدرات عملية FastNetMon
3. تثبيت /tmp مع خيارات nofollow,nosuid,nodev: mount -o remount,nofollow,nosuid,nodev /tmp
4. تنفيذ أذونات ملفات صارمة: umask 0077 لعملية FastNetMon
5. استخدام مستخدم غير جذر مخصص لتنفيذ FastNetMon بدلاً من الجذر
6. تنفيذ تقسيم الشبكة لتقييد الوصول المحلي لأنظمة FastNetMon
قواعد الكشف:
1. قاعدة auditd: -w /tmp/fastnetmon.dat -p wa -k fastnetmon_writes
2. مراقبة إنشاء الروابط الرمزية: auditctl -a always,exit -F arch=b64 -S symlinkat,symlink -F dir=/tmp -k symlink_creation
3. تنبيه على عملية FastNetMon التي تعمل كجذر مع عمليات ملفات غير عادية
4. مراقبة /tmp للملفات ذات الأذونات القابلة للكتابة عالميًا التي أنشأتها FastNetMon
استراتيجية الترقيع:
1. الاتصال بمطوري FastNetMon لجدول زمني لرقعة الأمان
2. تحضير خطة الهجرة إلى حلول كشف DDoS بديلة (Suricata, Zeek)
3. تقييم إصدارات FastNetMon التجارية إن توفرت
4. اختبار أي رقع في بيئة معملية معزولة قبل نشر الإنتاج