{"id":17262,"date":"2021-09-30T16:29:02","date_gmt":"2021-09-30T14:29:02","guid":{"rendered":"https:\/\/herolab.usd.de\/?page_id=17262"},"modified":"2022-05-02T11:41:35","modified_gmt":"2022-05-02T09:41:35","slug":"usd-2021-0002","status":"publish","type":"page","link":"https:\/\/herolab.usd.de\/en\/security-advisories\/usd-2021-0002\/","title":{"rendered":"usd-2021-0002"},"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.16\" _module_preset=\"cc5ac6f4-ebbd-4b3f-bc92-4dfc1f15fe2c\" global_colors_info=\"{}\"]<\/p>\n<h1>usd-2021-0002 | EgoSecure Agent<\/h1>\n<p><span><\/span><br \/><strong>Advisory ID<\/strong><span>: usd-2021-0002<\/span><br \/><strong>Affected Product<\/strong><span>: EgoSecure Agent<\/span><br \/><strong>Affected Version<\/strong><span>: 14.3.937.4<\/span><br \/><strong>Vulnerability Type<\/strong><span>: Symlink Vulnerability<\/span><br \/><strong>Security Risk<\/strong><span>: High<\/span><br \/><strong>Vendor URL<\/strong>: <a href=\"https:\/\/www.egosecure.com\/\" target=\"_blank\" rel=\"noopener\">https:\/\/www.egosecure.com\/<\/a><br \/><strong>Vendor Status<\/strong><span>: Fixed (21.0.1)<br \/><\/span><\/p>\n<p><span><\/span><\/p>\n<h3>Description<\/h3>\n<p>Privileged file write vulnerabilities allow low privileged users to create or overwrite files in arbitrary locations of the file system.<br \/>The impact of these attacks depends largely on the content that is written to the files. If the content is user controlled,<br \/><em>privilege escalations<\/em> are usually possible. Otherwise, the vulnerability can be used to perform <em>Denial of Service<\/em> attacks.<\/p>\n<p><span><\/span><\/p>\n<h3>Proof of Concept (PoC)<\/h3>\n<p>The <em>EgoSecure Agent service<\/em> allows users to request a compacted collection of log files using the <em>EgoSecure tray icon<\/em>. When invoking this operation,<br \/>the <em>EgoSecure Agent<\/em> collects log data and compacts everything into a single <em>.zip<\/em> file. The corresponding folder, where the compressed <em>.zip<\/em> file<br \/>is created, is user controlled, but can only be set to a user writable location. However, by using symbolic links, this restriction can be circumvented<br \/>and the <em>.zip<\/em> file can be written to arbitrary locations of the file system. As the write operations is done with the high privileged service account,<br \/>no write access is required for the invoking user.<\/p>\n<p>In the following screenshot, a low privileged user starts the log compression via the <em>EgoSecure tray icon<\/em> and sets the output folder to a user controlled<br \/>area of the file system:<\/p>\n<p>[\/et_pb_text][et_pb_image src=\"https:\/\/herolab.usd.de\/wp-content\/uploads\/sites\/9\/2021\/09\/01-set-output-folder.png\" title_text=\"01-set-output-folder\" admin_label=\"Bild\" _builder_version=\"4.16\" _module_preset=\"default\" global_colors_info=\"{}\"][\/et_pb_image][et_pb_text _builder_version=\"4.16\" _module_preset=\"cc5ac6f4-ebbd-4b3f-bc92-4dfc1f15fe2c\" custom_padding=\"0px|||||\" global_colors_info=\"{}\"]<\/p>\n<p>Afterwards, the user creates a symbolic link that points to the desired location of the file system. During our tests, only non existing paths could be<br \/>chosen. For the symbolic link creation, we use the <a href=\"https:\/\/github.com\/googleprojectzero\/symboliclink-testing-tools\" target=\"_blank\" rel=\"noopener\">symboliclink-testing-tools<\/a> by <a href=\"https:\/\/twitter.com\/tiraniddo\" target=\"_blank\" rel=\"noopener\">James Forshaw<\/a>.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=\"4.16\" _module_preset=\"9e260d37-0be2-4a12-a10e-3ed7e27b6ac6\" custom_margin=\"20px||20px||false|false\" global_colors_info=\"{}\"]<\/p>\n<p>C:\\&gt;C:\\ProgramData\\CreateSymlink.exe C:\\Linker\\LogFiles_20210131.zip C:\\Windows\\this_should_not_be_here.dll<br \/>Opened Link \\RPC Control\\LogFiles_20210131.zip -&gt; \\??\\C:\\Windows\\this_should_not_be_here.dll: 00000184<br \/>Press ENTER to exit and delete the symlink<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=\"4.16\" _module_preset=\"cc5ac6f4-ebbd-4b3f-bc92-4dfc1f15fe2c\" custom_padding=\"0px|||||\" global_colors_info=\"{}\"]<\/p>\n<p>After starting the export, the <em>.zip<\/em> file is created in the requested destination:<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=\"4.16\" _module_preset=\"9e260d37-0be2-4a12-a10e-3ed7e27b6ac6\" global_colors_info=\"{}\"]<\/p>\n<p>C:\\&gt;dir C:\\Windows\\this_should_not_be_here.dll<br \/>\u00a0Volume in drive C is Windows<br \/>\u00a0Volume Serial Number is F653-D506<\/p>\n<p>Directory of C:\\Windows<\/p>\n<p>31.01.2021 11:53 384.182 this_should_not_be_here.dll<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1 File(s), 384.182 bytes<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0 Dir(s), 461.815.877.632 bytes free<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=\"4.16\" _module_preset=\"cc5ac6f4-ebbd-4b3f-bc92-4dfc1f15fe2c\" global_colors_info=\"{}\"]<\/p>\n<div class=\"e16902-22 x-container max width\">\n<div class=\"e16902-23 x-column x-sm x-1-1\">\n<h3>Fix<\/h3>\n<div>Whenever high privileged services write data into user controlled parts of the file system, they should make sure to impersonate the corresponding user during the operation. Additionally, protection mechanisms can be implemented to avoid following file system link during write operations.<\/div>\n<p>&nbsp;<\/p>\n<div><\/div>\n<h3>References<\/h3>\n<ul>\n<li><a href=\"https:\/\/googleprojectzero.blogspot.com\/2015\/12\/between-rock-and-hard-link.html\" target=\"_blank\" rel=\"noopener\">https:\/\/googleprojectzero.blogspot.com\/2015\/12\/between-rock-and-hard-link.html<\/a><a href=\"https:\/\/cve.mitre.org\/cgi-bin\/cvename.cgi?name=CVE-2018-10054\" target=\"_blank\" rel=\"noopener\"><\/a><\/li>\n<\/ul>\n<h3><\/h3>\n<h3>Timeline<\/h3>\n<ul>\n<li>2021-01-31: This vulnerability was identified by Tobias Neitzel.<\/li>\n<li>2021-02-13: Initial contact to vendor.<\/li>\n<li>2021-02-14: Vulnerability information transmitted to vendor.<\/li>\n<li>2021-02-15: Vendor informs about upcoming fix.<\/li>\n<li>2021-09-27: Vulnerability was fixed in release 21.0.1.<\/li>\n<li>2021-09-30: Security advisory released by usd AG.<\/li>\n<\/ul>\n<h3><\/h3>\n<h3>Credits<\/h3>\n<p>This security vulnerability was found by Tobias Neitzel of usd AG.<\/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-2021-0002 | EgoSecure Agent Advisory ID: usd-2021-0002Affected Product: EgoSecure AgentAffected Version: 14.3.937.4Vulnerability Type: Symlink VulnerabilitySecurity Risk: HighVendor URL: https:\/\/www.egosecure.com\/Vendor Status: Fixed (21.0.1) Description Privileged file write vulnerabilities allow low privileged users to create or overwrite files in arbitrary locations of the file system.The impact of these attacks depends largely on the content that is written [&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-17262","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/17262","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=17262"}],"version-history":[{"count":0,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/17262\/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=17262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}