{"id":23260,"date":"2024-10-30T09:17:04","date_gmt":"2024-10-30T08:17:04","guid":{"rendered":"https:\/\/herolab.usd.de\/?page_id=23260"},"modified":"2024-11-08T16:15:22","modified_gmt":"2024-11-08T15:15:22","slug":"usd-2023-0040","status":"publish","type":"page","link":"https:\/\/herolab.usd.de\/en\/security-advisories\/usd-2023-0040\/","title":{"rendered":"usd-2023-0040"},"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.25.2\" _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.27.0\" _module_preset=\"default\" custom_padding=\"||13px|||\" global_colors_info=\"{}\"]<\/p>\n<h1>usd-2023-0040 | Missing Authorization in SAP Fiori Travel and Expenses<\/h1>\n<h1><\/h1>\n<p><strong>Advisory ID<\/strong>: usd-2023-0040<br \/><strong>Product<\/strong>: SAP Fiori - My Travel and Expenses<br \/><strong>Affected Version<\/strong>: Component Version: EA-HR 608 0117, Support Package: SAPK-608B7INEAHR<br \/><strong>Vulnerability Type<\/strong>: CWE-862: Missing Authorization<br \/><strong>Security Risk<\/strong>: Medium CVSS:3.1\/AV:N\/AC:L\/PR:L\/UI:R\/S:U\/C:L\/I:L\/A:L<br \/><strong>Vendor URL<\/strong>: <a>https:\/\/www.sap.com<\/a><br \/><strong>Vendor acknowledged vulnerability<\/strong>: Yes<br \/><strong>Vendor Status<\/strong>: Fixed<br \/><strong>CVE number<\/strong>: CVE-2024-32731<br \/><strong>CVE Link<\/strong>: <a>https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2024-32731<\/a><\/p>\n<h3>Affected Component(s)<\/h3>\n<p>SAP Fiori - My Travel and Expenses <a>https:\/\/fioriappslibrary.hana.ondemand.com\/sap\/fix\/externalViewer\/#\/detail\/Apps('F0584')\/W10<\/a><\/p>\n<h3>Desciption<\/h3>\n<p>In business trip requests, there is the option to upload attachments. Through the OData backend, users have access to all attachments as long as they are aware of the respective attachment IDs.<br \/>If arbitrary file formats are accepted, for instance, HTML files with embedded JavaScript code can be uploaded. If a malicious user manages to persuade another person to click on the attachment link, it could lead to a reflected XSS, causing the JavaScript code within it to execute in the context of the invoking user.<\/p>\n<h3>Proof of Concept<\/h3>\n<p>Uploaded files can be retrieved with the following server 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\">\/sap\/opu\/odata\/sap\/ZTV_TRQ_SRV\/Attachments('002049130000050945__FOL32000000000004EXT48000000004962______')\/$value<\/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\">2<br \/><\/span><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\">&lt;sap-fiori-host&gt;<br \/><\/span><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\">python-requests\/2.31.0<br \/><\/span><span class=\"na\" style=\"background: #263238;color: #bb80b3\">Accept-Encoding<\/span><span class=\"o\" style=\"background: #263238;color: #89ddff\">:<\/span> <span class=\"l\" style=\"background: #263238;color: #c3e88d\">gzip, deflate, br<br \/><\/span><span class=\"na\" style=\"background: #263238;color: #bb80b3\">Accept<\/span><span class=\"o\" style=\"background: #263238;color: #89ddff\">:<\/span> <span class=\"l\" style=\"background: #263238;color: #c3e88d\">*\/*<br \/><\/span><span class=\"na\" style=\"background: #263238;color: #bb80b3\">Authorization<\/span><span class=\"o\" style=\"background: #263238;color: #89ddff\">:<\/span> <span class=\"l\" style=\"background: #263238;color: #c3e88d\">Basic [REDACTED]<\/span><\/pre>\n<\/div>\n<p>For example, if it's a PDF, the server will return the PDF:<\/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\">2<\/span> <span class=\"m\" style=\"background: #263238;color: #f78c6c\">200<\/span> <span class=\"ne\" style=\"background: #263238;color: #ffcb6b\">OK<\/span><span class=\"err\" style=\"background: #263238;color: #ff5370\">[...]<\/span>%PDF-1.4[...]<\/pre>\n<\/div>\n<p>As seen in line 6 of the request, Basic Auth can be utilized for user authentication. In this scenario, it is possible for another user, who is not the owner of the file, to access it as long as they know the ID. However, it's worth noting that these IDs are not easily enumerable.<\/p>\n<p>Nevertheless, if the application accepts the upload of various file formats, it is possible to upload an HTML file with embedded JavaScript code and then send the link to any user. If the victim clicks on the link, it may result in the execution of the JavaScript code in the context of the victim.<\/p>\n<p>If the session cookie is not adequately protected, this could additionally lead to the compromise of the active session.<\/p>\n<p>In the following screenshot, a HTML file is being invoked. The file contains the following content:<\/p>\n<div class=\"codehilite\" style=\"background: #263238;color: #eff\">\n<pre style=\"line-height: 125%\"><span style=\"background: #263238\"><\/span><span class=\"nt\" style=\"background: #263238;color: #ff5370\">&lt;html&gt;<\/span><span class=\"w\" style=\"background: #263238;color: #eff\">        <\/span><span class=\"nt\" style=\"background: #263238;color: #ff5370\">&lt;body&gt;<\/span><span class=\"w\" style=\"background: #263238;color: #eff\">                <\/span><span class=\"nt\" style=\"background: #263238;color: #ff5370\">&lt;script&gt;<\/span>alert(document.cookie)<span class=\"nt\" style=\"background: #263238;color: #ff5370\">&lt;\/script&gt;<\/span><span class=\"w\" style=\"background: #263238;color: #eff\">        <\/span><span class=\"nt\" style=\"background: #263238;color: #ff5370\">&lt;\/body&gt;<\/span><span class=\"nt\" style=\"background: #263238;color: #ff5370\">&lt;\/html&gt;<\/span><\/pre>\n<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/herolab.usd.de\/wp-content\/uploads\/sites\/9\/2024\/08\/xss.png\" alt=\"\" class=\"wp-image-23257 alignnone size-full\" width=\"1083\" height=\"416\" srcset=\"https:\/\/herolab.usd.de\/wp-content\/uploads\/sites\/9\/2024\/08\/xss.png 1083w, https:\/\/herolab.usd.de\/wp-content\/uploads\/sites\/9\/2024\/08\/xss-980x376.png 980w, https:\/\/herolab.usd.de\/wp-content\/uploads\/sites\/9\/2024\/08\/xss-480x184.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1083px, 100vw\" \/><\/p>\n<h3>Fix<\/h3>\n<p>It is recommended to restrict access to sensitive functions or information by default.<br \/>Required access privileges should be granted explicitly by a global access control mechanism.<\/p>\n<h3>References<\/h3>\n<p><a>https:\/\/cwe.mitre.org\/data\/definitions\/862.html<\/a><\/p>\n<h3>Timeline<\/h3>\n<ul>\n<li><strong>2023-12-06<\/strong>: First contact request via vulnerability form.<\/li>\n<li><strong>2024-01-24<\/strong>: SAP confirms vulnerability and starts to fix it.<\/li>\n<li><strong>2024-05-14<\/strong>: SAP released the patch in <a href=\"https:\/\/me.sap.com\/notes\/3447467\" target=\"_blank\" rel=\"noopener\">SAP Note 3447467.<\/a><\/li>\n<\/ul>\n<h3>Credits<\/h3>\n<p>This security vulnerability was identified by Ole Wagner 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-2023-0040 | Missing Authorization in SAP Fiori Travel and Expenses Advisory ID: usd-2023-0040Product: SAP Fiori - My Travel and ExpensesAffected Version: Component Version: EA-HR 608 0117, Support Package: SAPK-608B7INEAHRVulnerability Type: CWE-862: Missing AuthorizationSecurity Risk: Medium CVSS:3.1\/AV:N\/AC:L\/PR:L\/UI:R\/S:U\/C:L\/I:L\/A:LVendor URL: https:\/\/www.sap.comVendor acknowledged vulnerability: YesVendor Status: FixedCVE number: CVE-2024-32731CVE Link: https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2024-32731 Affected Component(s) SAP Fiori - My Travel and [&hellip;]<\/p>\n","protected":false},"author":118,"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-23260","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/23260","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\/118"}],"replies":[{"embeddable":true,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/comments?post=23260"}],"version-history":[{"count":5,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/23260\/revisions"}],"predecessor-version":[{"id":23678,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/23260\/revisions\/23678"}],"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=23260"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}