{"id":56846,"date":"2024-05-15T18:39:48","date_gmt":"2024-05-15T14:39:48","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/178583\/SA-20240513-0.txt"},"modified":"2024-05-15T18:39:48","modified_gmt":"2024-05-15T14:39:48","slug":"sap-cloud-connector-2-16-1-missing-validation","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/sap-cloud-connector-2-16-1-missing-validation\/","title":{"rendered":"SAP Cloud Connector 2.16.1 Missing Validation"},"content":{"rendered":"<p>SEC Consult Vulnerability Lab Security Advisory &lt; 20240513-0 &gt;<br \/>=======================================================================<br \/>title: Tolerating Self-Signed Certificates<br \/>product: SAP\u00ae Cloud Connector<br \/>vulnerable version: 2.15.0 &#8211; 2.16.1 (Portable and Installer)<br \/>fixed version: 2.16.2 (Portable and Installer)<br \/>CVE number: CVE-2024-25642<br \/>impact: high<br \/>homepage: https:\/\/www.sap.com\/about.html<br \/>found: 2023-11-13<br \/>by: Mingshuo Li (Office Munich)<br \/>Fabian Hagg<br \/>SEC Consult Vulnerability Lab<\/p>\n<p>An integrated part of SEC Consult, an Eviden business<br \/>Europe | Asia<\/p>\n<p>https:\/\/www.sec-consult.com<\/p>\n<p>=======================================================================<\/p>\n<p>Vendor description:<br \/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>&#8220;The Cloud Connector is an optional on-premise component that is needed to<br \/>integrate on-demand applications with customer backend services and is the<br \/>counterpart of SAP Connectivity service.&#8221;<\/p>\n<p>Source: https:\/\/tools.hana.ondemand.com\/#cloud<\/p>\n<p>Business recommendation:<br \/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>SEC Consult recommends to implement the security note 3424610, where the<br \/>documented issue is fixed in version 2.16.2 according to the vendor. We<br \/>advise installing the correction as a matter of priority to keep<br \/>business-critical data secured.<\/p>\n<p>Source: https:\/\/support.sap.com\/en\/my-support\/knowledge-base\/security-notes-news\/february-2024.html<\/p>\n<p>Vulnerability overview\/description:<br \/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>1) Tolerating Self-Signed Certificates (CVE-2024-25642)<br \/>As per vendor documentation, the authentication between SCC and SAP BTP is guaranteed<br \/>mutually:<\/p>\n<p>&#8220;The tunnel itself is using TLS with strong encryption of the communication,<br \/>and mutual authentication of both communication sides, the client side<br \/>(Cloud Connector) and the server side (SAP BTP).&#8221;<\/p>\n<p>Source: https:\/\/help.sap.com\/docs\/connectivity\/sap-btp-connectivity-cf\/inbound-connectivity#tls-tunnel<\/p>\n<p>It was however discovered that the SCC trusts self-signed X.509 server certificates<br \/>for transport security to establish outbound connections with cloud-related<br \/>endpoints. Thus, an attacker can impersonate the genuine servers to interact<br \/>with the SCC, hence breaking the mutual authentication promise. Our analysis shows<br \/>furthermore that the product does not implement Certificate Pinning for the<br \/>trusted endpoints.<\/p>\n<p>The security impact of this vulnerability is rated high due to the trust put<br \/>into self-signed certificates, SCC is unable to distinguish between genuine and<br \/>malicious SAP BTP endpoints, rendering trivial adversary-in-the-middle attacks<br \/>possible.<\/p>\n<p>Proof of concept:<br \/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>1) Tolerating Self-Signed Certificates (CVE-2024-25642)<br \/>A &#8220;tunnel&#8221; established between a subaccount of SAP BTP and SCC represents a<br \/>long-lived bi-directional WebSocket over TLS customized by the vendor.<br \/>Such a tunnel is initiated by the SCC, known as reverse invoke approach,<br \/>to give the administrator full control of the tunnel.<\/p>\n<p>Two tunnels established by SCC are protected by TLS with respect to encrypted<br \/>communication. However, SCC does not verify the authenticity of the<br \/>certification authority, hence allowing an attacker to impersonate the target<br \/>server, using self-signed certificates.<\/p>\n<p>In particular, the attack is targeted at the following two endpoints, but not<br \/>limited to the region host us10.<\/p>\n<p>&#8211; connectivitynotification.cf.us10.hana.ondemand.com<br \/>&#8211; connectivity.us10.trial.applicationstudio.cloud.sap<\/p>\n<p>Note that the following endpoint, which is used for the initial certificate<br \/>signing request by SCC and to receive the BTP subaccount credentials, is<br \/>not susceptible to this issue.<\/p>\n<p>&#8211; connectivitycertsigning.cf.us10.hana.ondemand.com<\/p>\n<p>Nonetheless, it suffices to silently eavesdrop and manipulate network traffic<br \/>between SCC and SAP BTP by impersonating the two vulnerable endpoints above.<\/p>\n<p>Without loss of generality, the first endpoint is taken as example to<br \/>demonstrate the issue by the following steps:<\/p>\n<p>1. Add an entry in \/etc\/hosts of the SCC host as below to resolve the host name<br \/>to an attacker-controlled IP address:<\/p>\n<p>192.168.1.100 connectivitynotification.cf.us10.hana.ondemand.com<\/p>\n<p>2. Generate a self-signed certificate with the spoofed hostname as common name<\/p>\n<p>&#8220;`<br \/>$ openssl req -x509 -newkey rsa:4096 -keyout conn-noti-key.pem -out conn-noti-cert.pem -sha256 -days 3650 -nodes -subj &#8220;\/C=DE\/ST=Baden-Wuerttemberg\/L=Walldorf\/O=SAP <br \/>SE\/OU=ITSecurity\/CN=connectivitynotification.cf.us10.hana.ondemand.com&#8221;<br \/>&#8220;`<\/p>\n<p>3. Start an HTTPS server on the attacker machine to receive the connection from<br \/>SCC, using the self-signed certificate created in step 2<\/p>\n<p>The following Python script can be used to start the HTTPS server:<br \/>&#8220;`<br \/>$ cat https-dummy-server.py<br \/>import http.server<br \/>import ssl<\/p>\n<p>server_address = (&#8220;192.168.1.100&#8221;, 443)<br \/>httpd = http.server.HTTPServer(server_address, http.server.SimpleHTTPRequestHandler)<br \/>httpd.socket = ssl.wrap_socket(httpd.socket,<br \/>server_side=True,<br \/>certfile=&#8221;self-signed-cert\/conn-noti-cert.pem&#8221;,<br \/>keyfile=&#8221;self-signed-cert\/conn-noti-key.pem&#8221;,<br \/>ssl_version=ssl.PROTOCOL_TLS)<br \/>httpd.serve_forever()<br \/>&#8220;`<\/p>\n<p>4. Connect to a subaccount of BTP, for example US East AWS, in the SCC<br \/>Administration UI<\/p>\n<p>As soon as the connection is launched, the dummy web server will receive the<br \/>request as shown below:<\/p>\n<p>&#8220;`<br \/>$ python3 https-dummy-server.py<br \/>192.168.1.200 &#8211; &#8211; [10\/Nov\/2023 12:00:00] &#8220;GET \/connectivity HTTP\/1.1&#8221; 200 &#8211;<br \/>&#8220;`<\/p>\n<p>This observation confirms that the TLS connection between SCC and the spoofed<br \/>BTP endpoint operated on the attacker&#8217;s machine has been successfully established<br \/>although the server presented a self-signed certificate. No security warning<br \/>message is being displayed in the Administration UI, making the attack<br \/>surreptitious.<\/p>\n<p>Vulnerable \/ tested versions:<br \/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>The following versions have been tested which were the latest versions available<br \/>at the time of the test:<\/p>\n<p>* SAP Cloud Connector Linux x86_64 Version 2.16.0<br \/>* SAP Cloud Connector Linux (Portable) x86_64 Version 2.16.0<\/p>\n<p>According to the vendor, the vulnerability is a regression and affects the<br \/>versions 2.15.0 &#8211; 2.16.1.<\/p>\n<p>Vendor contact timeline:<br \/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>2023-11-14: Contacting vendor through vulnerability submission web form<br \/>2023-11-17: Vendor confirms receipt and assign SAP security incident numbers to<br \/>the four submitted findings: 2370150975, 2370150977, 2370150994, 2370151022<br \/>2023-11-20: Vendor informs the reported issues be assigned the appropriate<br \/>development teams for analysis<br \/>2023-12-05: Requesting status update<br \/>2023-12-05: Vendor informs that 2370151022 be rejected<br \/>2023-12-05: Issuing rebuttal for 2370151022<br \/>2023-12-06: Vendor contemplates further analysis<br \/>2023-12-14: Vendor decides not to take any action on 2370151022 and rejects<br \/>2370150977 and 2370150975 as well.<br \/>2023-12-15: Vendor accepts 2370150994<br \/>2024-01-05: Asked vendor to comment on the three rejected issues<br \/>2024-01-10: Vendor gives detailed rationale for the rejection of 2370150975<br \/>2024-01-12: Issuing rebuttal for 2370150975<br \/>2024-01-15: Vendor insists on rejection of 2370150975 and closes the ticket.<br \/>Removing three rejected potential security issues from advisory.<br \/>2024-02-13: Release of SAP Security Patch Day, security note #3424610<br \/>2024-02-26: Asking for the disclosure guideline to publish finding 2370150994<br \/>2024-02-26: Vendor confirms the three-month embargo<br \/>2024-05-13: Coordinated release of SEC Consult advisory.<\/p>\n<p>Solution:<br \/>&#8212;&#8212;&#8212;<br \/>The vendor provides a patched version 2.16.2 which can be downloaded from their<br \/>website:<br \/>https:\/\/tools.hana.ondemand.com\/#cloud<\/p>\n<p>Also see the vendor&#8217;s security note #3424610 for further details:<br \/>https:\/\/me.sap.com\/notes\/3424610<\/p>\n<p>Workaround:<br \/>&#8212;&#8212;&#8212;&#8211;<br \/>None<\/p>\n<p>Advisory URL:<br \/>&#8212;&#8212;&#8212;&#8212;-<br \/>https:\/\/sec-consult.com\/vulnerability-lab\/<\/p>\n<p>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<\/p>\n<p>SEC Consult Vulnerability Lab<br \/>An integrated part of SEC Consult, an Eviden business<br \/>Europe | Asia<\/p>\n<p>About SEC Consult Vulnerability Lab<br \/>The SEC Consult Vulnerability Lab is an integrated part of SEC Consult, an<br \/>Eviden business. It ensures the continued knowledge gain of SEC Consult in the<br \/>field of network and application security to stay ahead of the attacker. The<br \/>SEC Consult Vulnerability Lab supports high-quality penetration testing and<br \/>the evaluation of new offensive and defensive technologies for our customers.<br \/>Hence our customers obtain the most current information about vulnerabilities<br \/>and valid recommendation about the risk profile of new technologies.<\/p>\n<p>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br \/>Interested to work with the experts of SEC Consult?<br \/>Send us your application https:\/\/sec-consult.com\/career\/<\/p>\n<p>Interested in improving your cyber security with the experts of SEC Consult?<br \/>Contact our local offices https:\/\/sec-consult.com\/contact\/<br \/>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<\/p>\n<p>Mail: security-research at sec-consult dot com<br \/>Web: https:\/\/www.sec-consult.com<br \/>Blog: https:\/\/blog.sec-consult.com<br \/>Twitter: https:\/\/twitter.com\/sec_consult<\/p>\n<p>EOF M. Li, F. Hagg \/ @2024<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SEC Consult Vulnerability Lab Security Advisory &lt; 20240513-0 &gt;=======================================================================title: Tolerating Self-Signed Certificatesproduct: SAP\u00ae Cloud Connectorvulnerable version: 2.15.0 &#8211; 2.16.1 (Portable and Installer)fixed version: 2.16.2 (Portable and Installer)CVE number: CVE-2024-25642impact: highhomepage: https:\/\/www.sap.com\/about.htmlfound: 2023-11-13by: Mingshuo Li (Office Munich)Fabian HaggSEC Consult Vulnerability Lab An integrated part of SEC Consult, an Eviden businessEurope | Asia https:\/\/www.sec-consult.com ======================================================================= Vendor description:&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#8220;The &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-56846","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/56846","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=56846"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/56846\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=56846"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=56846"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=56846"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}