Exhibit 5.2

| | | | | | |
UBS AG Bahnhofstrasse 45 8001 Zurich Switzerland | | | | Homburger AG Prime Tower Hardstrasse 201 CH–8005 Zurich T +41 43 222 10 00 F +41 43 222 15 00 lawyers@homburger.ch | | |
Zurich, May 28, 2024
UBS AG
UBS AG – Registration Statement on Form F-3
We, Homburger AG, have acted as special Swiss counsel to UBS AG in connection with the registration statement on Form F-3 to be filed by UBS AG under the United States Securities Act of 1933, as amended (the Securities Act), with the U.S. Securities and Exchange Commission (the SEC) on or around May 31, 2024 (excluding the documents incorporated by reference therein and as amended through such date, the Registration Statement), for purposes, among other things, of registering on or after the Registration Statement Effective Date (as defined below) offerings by UBS AG, acting through either its head offices or one of its non-Swiss branches (any such branch, an Issuing Branch), of one or more series of senior debt securities to be issued by it on or after the Registration Statement Effective Date under the Indenture (as defined below) as supplemented by the Fourth Supplemental Indenture (as defined below) (any such debt securities, Debt Securities). As such counsel, we have been requested to give our opinion as to certain matters of Swiss law relating to the Registration Statement and the Debt Securities.
This opinion is confined to and given on the basis of the laws of Switzerland in force at the date hereof. Such laws and the interpretation thereof are subject to change. This opinion is also confined to the matters stated herein and the Documents (as defined below), and is not to be read as extending, by implication or otherwise, to any agreement or other document referred to in any of the Documents or any other matter.
For purposes of this opinion, we have not conducted any due diligence or similar investigation as to factual circumstances that are or may be referred to in the Documents, and we express no opinion as to the accuracy of representations and warranties of facts set out in the Documents or the factual background assumed therein.
1/8
