{"id":17727,"date":"2022-01-31T17:34:22","date_gmt":"2022-01-31T16:34:22","guid":{"rendered":"https:\/\/herolab.usd.de\/?page_id=17727"},"modified":"2022-02-01T11:02:02","modified_gmt":"2022-02-01T10:02:02","slug":"usd-2021-0024","status":"publish","type":"page","link":"https:\/\/herolab.usd.de\/en\/security-advisories\/usd-2021-0024\/","title":{"rendered":"usd-2021-0024"},"content":{"rendered":"\n\n\n\n[et_pb_section fb_built=\"1\" _builder_version=\"4.9.4\" _module_preset=\"default\" background_color=\"#2E353D\" custom_padding=\"||0px|||\" global_colors_info=\"{}\"][et_pb_row _builder_version=\"4.9.4\" _module_preset=\"default\" global_colors_info=\"{}\"][et_pb_column type=\"4_4\" _builder_version=\"4.9.4\" _module_preset=\"default\" global_colors_info=\"{}\"][et_pb_text _builder_version=\"4.13.1\" _module_preset=\"cc5ac6f4-ebbd-4b3f-bc92-4dfc1f15fe2c\" global_colors_info=\"{}\"]<h1>usd-2021-0024 | Grafana<\/h1>\n<p><strong>Advisory ID<\/strong>: usd-2021-0024<br \/><strong>Affected Product<\/strong>: Grafana<br \/><strong>Affected Version<\/strong>: &lt; v8.1.3<br \/><strong>Vulnerability Type<\/strong>: CWE-20: Improper Input Validation (https:\/\/cwe.mitre.org\/data\/definitions\/20.html)<br \/><strong>Security Risk<\/strong>: Low<br \/><strong>Vendor URL<\/strong>: <a href=\"https:\/\/grafana.com\/\" target=\"_blank\" rel=\"noopener\">https:\/\/grafana.com\/\u00a0<\/a> <br \/><strong>Vendor Status<\/strong>: Fixed<\/p>\n<p><span><\/span><\/p>\n<h3>Description<\/h3>\n<p>Grafana before v8.1.3 is vulnerable to Directory Traversal in its Link-Shortener.<\/p>\n<p>If the Grafana instance is deployed alongside multiple applications on the same domain, this directory traversal allows to reference arbitrary files within the web root.<\/p>\n<p>Grafana allows users to shorten their sharing links using a link shortener functionality. There is a filter in place that only allows relative URLs. In doing so, meta characters like\u00a0 <strong><span>\u2215<\/span>.. <span>\u2215<\/span><\/strong>\u00a0are allowed, resulting in the possiblity to reference arbitrary resources outside of Grafana's base path.<\/p>\n<p><span><\/span><\/p>\n<h3>Proof of Concept (PoC)<\/h3>\n<p><em>Note: the setup that was analyzed consisted of multiple applications that were deployed to different paths of the same domain (usd.de\/a\/, usd.de\/b\/, ...).<\/em><\/p>\n<p>An exemplary request including a directory traversal is given in the following:<\/p>[\/et_pb_text][et_pb_text _builder_version=\"4.9.4\" _module_preset=\"9e260d37-0be2-4a12-a10e-3ed7e27b6ac6\" global_colors_info=\"{}\"]<p>POST \/monitoring\/api\/short-urls HTTP\/2<br \/>Host: usd.de<br \/>[...]<\/p>\n<p>{<br \/>\"path\":\"pentest\/..<span>\u2215<\/span>..<span>\u2215<\/span>test\"<br \/>}<\/p>[\/et_pb_text][et_pb_text _builder_version=\"4.13.1\" _module_preset=\"cc5ac6f4-ebbd-4b3f-bc92-4dfc1f15fe2c\" global_colors_info=\"{}\"]<p>The API responds with a shortened URL. If this URL is then opened, there is a redirect to arbitrary paths on the domain:<\/p>[\/et_pb_text][et_pb_text _builder_version=\"4.9.4\" _module_preset=\"9e260d37-0be2-4a12-a10e-3ed7e27b6ac6\" global_colors_info=\"{}\"]<p>HTTP\/2 302 Found<br \/>Content-Length: 76<br \/>Location: https:\/\/usd.de\/monitoring\/pentest\/..<span>\u2215<\/span>..<span>\u2215<\/span>test<br \/>Cache-Control: no-cache<br \/>[...]<\/p>\n<p>&lt;a href=\"https:\/\/usd.de\/monitoring\/pentest\/..<span>\u2215<\/span>..<span>\u2215<\/span>test\"&gt;Found&lt;\/a&gt;.<\/p>[\/et_pb_text][et_pb_text _builder_version=\"4.13.1\" _module_preset=\"cc5ac6f4-ebbd-4b3f-bc92-4dfc1f15fe2c\" global_colors_info=\"{}\"]<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 harden the link shortener implementation. In doing so, consider all user input to the application as potentially malicious. All input to the application should be verified and if necessary replaced. Meta characters should be treated with care. It is recommended to use whitelisting wherever possible.<\/p>\n<h3><\/h3>\n<h3>References<\/h3>\n<ul>\n<li><a href=\"https:\/\/cwe.mitre.org\/data\/definitions\/20.html\" target=\"_blank\" rel=\"noopener\">https:\/\/cwe.mitre.org\/data\/definitions\/20.html<\/a>\u00a0<\/li>\n<\/ul>\n<h3>Timeline<\/h3>\n<ul>\n<li>2021-08-11: This vulnerability was identified by Tobias Hamann and Lauritz Holtmann.<\/li>\n<li>2021-08-11: Advisory submitted to vendor via e-mail.<\/li>\n<li>2021-10-15: Patch is released with Grafana v8.1.3: <a href=\"https:\/\/grafana.com\/docs\/grafana\/latest\/release-notes\/release-notes-8-1-3\/\" target=\"_blank\" rel=\"noopener\">https:\/\/grafana.com\/docs\/grafana\/latest\/release-notes\/release-notes-8-1-3\/<\/a><\/li>\n<li>2022-01-31: Security advisory published by usd AG.<\/li>\n<\/ul>\n<h3><\/h3>\n<h3>Credits<\/h3>\n<p>This security vulnerability was found by Tobias Hamann and Lauritz Holtmann of usd AG.<\/p>\n<\/div>\n<\/div>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]\n\n\n\n","protected":false},"excerpt":{"rendered":"<p>usd-2021-0024 | Grafana Advisory ID: usd-2021-0024Affected Product: GrafanaAffected Version: &lt; v8.1.3Vulnerability Type: CWE-20: Improper Input Validation (https:\/\/cwe.mitre.org\/data\/definitions\/20.html)Security Risk: LowVendor URL: https:\/\/grafana.com\/\u00a0 Vendor Status: Fixed Description Grafana before v8.1.3 is vulnerable to Directory Traversal in its Link-Shortener. If the Grafana instance is deployed alongside multiple applications on the same domain, this directory traversal allows to reference [&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-17727","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/17727","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=17727"}],"version-history":[{"count":0,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/17727\/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=17727"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}