{"id":25925,"date":"2022-06-19T23:29:35","date_gmt":"2022-06-19T19:29:35","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/167466\/SA-20220607-0.txt"},"modified":"2022-06-26T09:51:56","modified_gmt":"2022-06-26T05:21:56","slug":"infiray-iray-a8z3-1-0-957-code-execution-overflow-hardcoded-credentials","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/infiray-iray-a8z3-1-0-957-code-execution-overflow-hardcoded-credentials\/","title":{"rendered":"Infiray IRAY-A8Z3 1.0.957 Code Execution \/ Overflow \/ Hardcoded Credentials"},"content":{"rendered":"<p dir=\"ltr\">SEC Consult Vulnerability Lab Security Advisory &lt; 20220607-0 &gt;<br \/>\n=======================================================================<br \/>\ntitle: Multiple Vulnerabilities<br \/>\nproduct: Infiray IRAY-A8Z3 thermal camera<br \/>\nvulnerable version: V1.0.957<br \/>\nfixed version: None<br \/>\nCVE number: CVE-2022-31208, CVE-2022-31209, CVE-2022-31210,<br \/>\nCVE-2022-31211<br \/>\nimpact: Critical<br \/>\nhomepage: http:\/\/www.infiray.com\/<br \/>\nfound: 2021-02<br \/>\nby: S. Robertz (Office Vienna)<br \/>\nF. Lienhart<br \/>\nSEC Consult Vulnerability Lab<\/p>\n<p dir=\"ltr\">An integrated part of SEC Consult, an Atos company<br \/>\nEurope | Asia | North America<\/p>\n<p dir=\"ltr\">https:\/\/www.sec-consult.com<\/p>\n<p dir=\"ltr\">=======================================================================<\/p>\n<p dir=\"ltr\">Vendor description:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n&#8220;IRay Technology Co., Ltd. is a wholly-owned subsidiary of Raytron Technology<br \/>\nCo., Ltd. (SSE: 688002). As a high-tech enterprise, IRay Technology develops<br \/>\nand manufactures infrared FPA detectors, thermal imaging modules, and other<br \/>\nproducts, with completely independent intellectual property rights. We are<br \/>\ncommitted to providing global customers with professional thermal imaging<br \/>\nproducts and solutions. The main products include IRFPA detectors, thermal<br \/>\nimaging cores, and terminal products for application.&#8221;<\/p>\n<p dir=\"ltr\">Source: http:\/\/www.infiray.com\/about.html<\/p>\n<p dir=\"ltr\">Business recommendation:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\nThe vendor was unresponsive during the disclosure process. Hence it is unclear<br \/>\nwhether patches are available. Customers are urged to approach their vendor<br \/>\ncontact and request security reviews and updates.<\/p>\n<p dir=\"ltr\">SEC Consult recommends to perform a thorough security review of these<br \/>\nproducts conducted by security professionals to identify and resolve all<br \/>\nsecurity issues.<\/p>\n<p dir=\"ltr\">Vulnerability overview\/description:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n1) Hardcoded Web Credentials (CVE-2022-31210)<br \/>\nThe binary file &#8220;\/usr\/local\/sbin\/webproject\/set_param.cgi&#8221; contains hardcoded<br \/>\ncredentials to the web application. As these accounts cannot be deactivated<br \/>\nor change their passwords, they are considered to be backdoor accounts.<\/p>\n<p dir=\"ltr\">2) Authenticated Remote Code Execution (CVE-2022-31208)<br \/>\nThe webserver contains an endpoint that can execute arbitrary commands by<br \/>\nmanipulating the &#8220;cmd_string&#8221; URL parameter. The user can login using one<br \/>\nof the backdoor accounts from issue 1.<\/p>\n<p dir=\"ltr\">3) Potential Buffer Overflow (CVE-2022-31209)<br \/>\nThe firmware contains a potential buffer overflow by calling strcpy() without<br \/>\nchecking the string length beforehand.<\/p>\n<p dir=\"ltr\">4) Telnet Root Shell without Password (CVE-2022-31211)<br \/>\nThe camera offers a shell through a telnet connection. The root user does not<br \/>\nrequire a password per default. Thus, anyone on the local network can<br \/>\nexecute arbitrary commands as root on the camera.<\/p>\n<p dir=\"ltr\">5) Multiple Outdated Software Components<br \/>\nMultiple outdated software components containing vulnerabilities were found by<br \/>\nthe IoT Inspector (ONEKEY) firmware analysis platform.<\/p>\n<p dir=\"ltr\">Proof of concept:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n1) Hardcoded Web Credentials (CVE-2022-31210)<br \/>\nThe following cgi program will be executed during the login process:<\/p>\n<p dir=\"ltr\">http:\/\/&lt;my_ip&gt;:8080\/set_param.cgi?&amp;group_tag=hash_param_bridge<br \/>\n&amp;set_cmd=loading&amp;length=35&amp;name=&lt;user&gt;&amp;password=&lt;password&gt;&amp;access=0<br \/>\n&amp;0.3543773172371312<\/p>\n<p dir=\"ltr\">The following de-compilation shows the code flow with the hardcoded passwords:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n[ PoC removed ]\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nThe authentication works by comparing the URL supplied username with the string<br \/>\n&#8220;[removed]&#8221;. Afterwards it will compare the password parameter to &#8220;[removed]&#8221; as well. If both<br \/>\nstring parameters match, a message will be removed from the messaging queue.<br \/>\nOtherwise the function will just return. The same comparison holds for the admin account.<\/p>\n<p dir=\"ltr\">Furthermore, string comparisons are made without checking the case. Hence,<br \/>\ndrastically improving the chances of brute-force attacks.<\/p>\n<p dir=\"ltr\">2) Authenticated Remote Code Execution (CVE-2022-31208)<br \/>\nThe web application offers an option to view the device log. Opening following URL while<br \/>\nlogged in as admin (e.g. with hardcoded password from section 1) will trigger the request:<\/p>\n<p dir=\"ltr\">http:\/\/&lt;my_ip&gt;:8080\/cmd.cgi?cmd_tag=cmd_passthrough&#038;cmd_string=[removed]\n<p dir=\"ltr\">By changing the &#8220;cmd_string&#8221; parameter, arbitrary commands can be executed with<br \/>\nthe rights of the webserver (www-data). The de-compiled code can be seen in following<br \/>\nsnippet:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n[ PoC removed ]\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nThe &#8220;cmd_string&#8221; parameter is directly passed into popen() and hence executed.<\/p>\n<p dir=\"ltr\">3) Potential Buffer-Overflow (CVE-2022-31209)<br \/>\nThe firmware contains a potential buffer overflow vulnerability:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n[ PoC removed ]\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nA pointer to the &#8220;next_url&#8221; parameter is supplied. A buffer of 64 bytes is<br \/>\nallocated and the parameter value copied to it without checking the string<br \/>\nlength. Hence, a &#8220;next_url&#8221; parameter with more than 64 bytes could be<br \/>\nsupplied in order to overflow the buffer.<br \/>\nPlease note that this vulnerability is only based on firmware analysis and thus<br \/>\nwas not tested in a live scenario.<\/p>\n<p dir=\"ltr\">4) Telnet Root Shell without Password (CVE-2022-31211)<br \/>\nThe camera has a telnetd server running on port 23 per default. The root<br \/>\npassword is empty. If the telnet port is exposed to the internet, an attacker<br \/>\ncould easily connect to the device and gain root access. The telnet server<br \/>\ncannot be deactivated and the root password cannot be changed through the<br \/>\nweb interface.<\/p>\n<p dir=\"ltr\">5) Multiple Outdated Software Components<br \/>\nIoT Inspector (ONEKEY) recognized multiple outdated software components<br \/>\nwith known vulnerabilities:<\/p>\n<p dir=\"ltr\">BusyBox 1.25.0: 6 CVEs<br \/>\ncurl 7.54.0: 13 CVEs<br \/>\nDnsmasq 2.76: 9 CVEs<br \/>\nlighttpd 1.4.41: 2 CVEs<br \/>\nLinux Kernel 3.10.104: 1004 CVEs<br \/>\nhostapd 2.5: 22 CVEs<br \/>\nwpa_supplicant 2.5-devel_rtw_r17190.20160415: 12 CVEs<\/p>\n<p dir=\"ltr\">Vulnerable \/ tested versions:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nThe following product\/firmware version has been tested:<br \/>\n* Infiray IRAY-A8Z3 V1.0.957<\/p>\n<p dir=\"ltr\">It has to be assumed that further products or firmware versions are affected as well.<\/p>\n<p dir=\"ltr\">Vendor contact timeline:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n2021-02-24: Contacting vendor through email address found on their website<br \/>\n(sales@infiray.com)<br \/>\n2021-03-11: Contacted vendor again through sales@infiray.com<br \/>\n2021-04-12: Contacting vendor through sales@infiray.com and InfiRay.CS@iraytek.com<br \/>\n2021-04-12: Response from Sales Director, does not understand what to do with the information<br \/>\n2021-04-12: Requesting a contact to the product owner or developer<br \/>\n2021-04-13: Sending unencrypted security advisory to two provided email addresses.<br \/>\n2021-04-29: Requesting status from vendor, no reply.<br \/>\n2022-04-05: Requested status from vendor, no reply.<br \/>\n2022-06-07: Release of security advisory.<\/p>\n<p dir=\"ltr\">Solution:<br \/>\n&#8212;&#8212;&#8212;<br \/>\nThe vendor was unresponsive during the disclosure process. Hence it is unclear<br \/>\nwhether patches are available. Customers are urged to approach their vendor<br \/>\ncontact and request security reviews and updates.<\/p>\n<p dir=\"ltr\">Workaround:<br \/>\n&#8212;&#8212;&#8212;&#8211;<br \/>\nNone<\/p>\n<p dir=\"ltr\">Advisory URL:<br \/>\n&#8212;&#8212;&#8212;&#8212;-<br \/>\nhttps:\/\/sec-consult.com\/vulnerability-lab\/<\/p>\n<p dir=\"ltr\">~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<\/p>\n<p dir=\"ltr\">SEC Consult Vulnerability Lab<\/p>\n<p dir=\"ltr\">SEC Consult, an Atos company<br \/>\nEurope | Asia | North America<\/p>\n<p dir=\"ltr\">About SEC Consult Vulnerability Lab<br \/>\nThe SEC Consult Vulnerability Lab is an integrated part of SEC Consult, an<br \/>\nAtos company. It ensures the continued knowledge gain of SEC Consult in the<br \/>\nfield of network and application security to stay ahead of the attacker. The<br \/>\nSEC Consult Vulnerability Lab supports high-quality penetration testing and<br \/>\nthe evaluation of new offensive and defensive technologies for our customers.<br \/>\nHence our customers obtain the most current information about vulnerabilities<br \/>\nand valid recommendation about the risk profile of new technologies.<\/p>\n<p dir=\"ltr\">~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br \/>\nInterested to work with the experts of SEC Consult?<br \/>\nSend us your application https:\/\/sec-consult.com\/career\/<\/p>\n<p dir=\"ltr\">Interested in improving your cyber security with the experts of SEC Consult?<br \/>\nContact our local offices https:\/\/sec-consult.com\/contact\/<br \/>\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<\/p>\n<p dir=\"ltr\">Mail: security-research at sec-consult dot com<br \/>\nWeb: https:\/\/www.sec-consult.com<br \/>\nBlog: http:\/\/blog.sec-consult.com<br \/>\nTwitter: https:\/\/twitter.com\/sec_consult<\/p>\n<p dir=\"ltr\">EOF S. Robertz, F. Lienhart \/ @2022<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SEC Consult Vulnerability Lab Security Advisory &lt; 20220607-0 &gt; ======================================================================= title: Multiple Vulnerabilities product: Infiray IRAY-A8Z3 thermal camera vulnerable version: V1.0.957 fixed version: None CVE number: CVE-2022-31208, CVE-2022-31209, CVE-2022-31210, CVE-2022-31211 impact: Critical homepage: http:\/\/www.infiray.com\/ found: 2021-02 by: S. Robertz (Office Vienna) F. Lienhart SEC Consult Vulnerability Lab An integrated part of SEC Consult, an Atos &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-25925","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/25925","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=25925"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/25925\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=25925"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=25925"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=25925"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}