A flaw has been found in D-Link DNS-120, DNR-202L, DNS-315L, DNS-320, DNS-320L, DNS-320LW, DNS-321, DNR-322L, DNS-323, DNS-325, DNS-326, DNS-327L, DNR-326, DNS-340L, DNS-343, DNS-345, DNS-726-4, DNS-1100-4, DNS-1200-05 and DNS-1550-04 up to 20260205. This vulnerability affects the function UPnP_AV_Server_Path_Del of the file /cgi-bin/app_mgr.cgi. Executing a manipulation of the argument f_dir can lead to stack-based buffer overflow. The attack can be executed remotely. The exploit has been published and may be used.
A critical stack-based buffer overflow vulnerability exists in D-Link NAS devices (DNS and DNR series) affecting the UPnP AV Server functionality through the /cgi-bin/app_mgr.cgi endpoint. The flaw allows remote attackers to execute arbitrary code by manipulating the f_dir parameter, with public exploits already available. This poses an immediate threat to organizations using these devices for network storage and backup operations.
IMMEDIATE ACTIONS:
1. Identify and inventory all D-Link DNS/DNR series devices in your environment using network scanning tools
2. Isolate affected devices from internet-facing networks immediately; restrict access to trusted internal networks only
3. Disable UPnP functionality if not operationally required via device web interface
4. Implement network segmentation to limit lateral movement from compromised devices
COMPENSATING CONTROLS (until patch available):
5. Deploy Web Application Firewall (WAF) rules to block requests to /cgi-bin/app_mgr.cgi with suspicious f_dir parameters
6. Implement strict input validation rules: block requests containing path traversal sequences (../, ..\ ) in f_dir parameter
7. Monitor for exploitation attempts using IDS/IPS signatures detecting buffer overflow patterns
8. Enable detailed logging on affected devices and forward logs to SIEM for analysis
9. Restrict administrative access to device management interfaces using IP whitelisting
10. Consider replacing affected devices with patched alternatives from D-Link or alternative vendors
DETECTION RULES:
- Monitor HTTP POST requests to /cgi-bin/app_mgr.cgi with f_dir parameter exceeding 256 bytes
- Alert on UPnP_AV_Server_Path_Del function calls with abnormal parameter lengths
- Track failed authentication attempts and unusual process execution on NAS devices
- Monitor for reverse shell indicators and unexpected outbound connections from NAS devices
الإجراءات الفورية:
1. تحديد وحصر جميع أجهزة D-Link DNS/DNR في بيئتك باستخدام أدوات المسح الشبكي
2. عزل الأجهزة المتأثرة عن الشبكات المتصلة بالإنترنت فوراً؛ تقييد الوصول إلى الشبكات الداخلية الموثوقة فقط
3. تعطيل وظيفة UPnP إذا لم تكن مطلوبة تشغيلياً عبر واجهة الويب للجهاز
4. تنفيذ تقسيم الشبكة لتحديد الحركة الجانبية من الأجهزة المخترقة
الضوابط البديلة (حتى توفر التصحيح):
5. نشر قواعد جدار حماية تطبيقات الويب (WAF) لحجب الطلبات إلى /cgi-bin/app_mgr.cgi بمعاملات f_dir مريبة
6. تنفيذ قواعد التحقق من صحة الإدخال الصارمة: حجب الطلبات التي تحتوي على تسلسلات اجتياز المسار (../, ..\ ) في معامل f_dir
7. مراقبة محاولات الاستغلال باستخدام توقيعات IDS/IPS التي تكتشف أنماط تجاوز المخزن المؤقت
8. تفعيل السجلات التفصيلية على الأجهزة المتأثرة وإعادة توجيه السجلات إلى SIEM للتحليل
9. تقييد الوصول الإداري إلى واجهات إدارة الجهاز باستخدام القائمة البيضاء للعناوين
10. النظر في استبدال الأجهزة المتأثرة بأجهزة معدلة من D-Link أو بدائل من بائعين آخرين