{"id":20850,"date":"2022-12-19T10:01:04","date_gmt":"2022-12-19T18:01:04","guid":{"rendered":"https:\/\/www.palada.net\/index.php\/2022\/12\/19\/news-14583\/"},"modified":"2022-12-19T10:01:04","modified_gmt":"2022-12-19T18:01:04","slug":"news-14583","status":"publish","type":"post","link":"http:\/\/www.palada.net\/index.php\/2022\/12\/19\/news-14583\/","title":{"rendered":"Gatekeeper\u2019s Achilles heel: Unearthing a macOS vulnerability"},"content":{"rendered":"<p><strong>Credit to Author: Microsoft Security Threat Intelligence| Date: Mon, 19 Dec 2022 18:00:00 +0000<\/strong><\/p>\n<p>On July 27, 2022, Microsoft discovered a vulnerability in macOS that can allow attackers to bypass application execution restrictions imposed by Apple\u2019s Gatekeeper security mechanism, designed to ensure only trusted apps run on Mac devices. We developed a proof-of-concept exploit to demonstrate the vulnerability, which we call \u201cAchilles\u201d. Gatekeeper bypasses such as this could be leveraged as a vector for initial access by malware and other threats and could help increase the success rate of malicious campaigns and attacks on macOS.<\/p>\n<p>After carefully reviewing the implications, we shared the vulnerability with Apple in July 2022 through <a href=\"https:\/\/www.microsoft.com\/msrc\/cvd?rtc=1\">Coordinated Vulnerability Disclosure<\/a> (CVD) via <a href=\"https:\/\/www.microsoft.com\/msrc\/msvr\">Microsoft Security Vulnerability Research<\/a> (MSVR). Fixes for the vulnerability, now identified as <a href=\"https:\/\/cve.mitre.org\/cgi-bin\/cvename.cgi?name=CVE-2022-42821\">CVE-2022-42821<\/a>, were quickly released by Apple to all their OS versions. We note that Apple&#8217;s <a href=\"https:\/\/www.apple.com\/newsroom\/2022\/07\/apple-expands-commitment-to-protect-users-from-mercenary-spyware\/\">Lockdown Mode<\/a>, introduced in macOS Ventura as an optional protection feature for high-risk users that might be personally targeted by a sophisticated cyberattack, is aimed to stop zero-click remote code execution exploits, and therefore does not defend against Achilles. End-users should apply the fix regardless of their Lockdown Mode status. We thank Apple for the collaboration in addressing this issue.<\/p>\n<p>In this blog post, we share information about <a href=\"https:\/\/support.apple.com\/en-us\/HT202491\">Gatekeeper<\/a> and the vulnerability able to bypass it. We also share this research to emphasize the importance of collaboration among researchers and the security community to improve defenses for the larger ecosystem.<\/p>\n<h2>Unlocking the Gatekeeper security mechanism<\/h2>\n<p>Many macOS infections are the result of users running malware, oftentimes inadvertently. Fake app bundles might masquerade themselves as different apps, like Flash Player, or as a legitimate file, such as using a PDF icon and using the app name \u201cResume\u201d. To combat this highly popular infection vector, Apple has imposed strong security mechanisms. When downloading apps from a browser, like Safari, the browser assigns a special extended attribute to the downloaded file. That attribute is named <em>com.apple.quarantine<\/em> and is later used to enforce policies such as Gatekeeper or certain mitigations that prevent <a href=\"https:\/\/www.microsoft.com\/security\/blog\/2022\/07\/13\/uncovering-a-macos-app-sandbox-escape-vulnerability-a-deep-dive-into-cve-2022-26706\/\">sandbox escapes<\/a>. In recent years, Apple has tightened the security policies even further, and the current Gatekeeper design dictates the following behavior for downloaded apps:<\/p>\n<ol type=\"1\">\n<li>If the app is validly signed and notarized, meaning approved by Apple, then a prompt requires the user\u2019s consent before its launched.<\/li>\n<li>Otherwise, the user is informed that the app cannot be run as it\u2019s untrusted.<\/li>\n<\/ol>\n<p>Extended attributes are a filesystem feature supported on common macOS filesystems, like APFS and HFS+, and their main purpose is to save file metadata. Specifically, the <em>com.apple.quarantine<\/em> attribute saves information regarding the source of the downloaded file, as well as data instructing Gatekeeper how to process the file. The attribute format is generally:<\/p>\n<pre class=\"wp-block-preformatted\">flag;date;agent_name;UUID<\/pre>\n<p>Extended attributes can be viewed or modified with the <a href=\"https:\/\/ss64.com\/osx\/xattr.html\"><em>xattr<\/em><\/a> command line utility.<\/p>\n<p>A flag value of \u201c0083\u201d enforces Gatekeeper restrictions on the file, as displayed below:<\/p>\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"936\" height=\"90\" src=\"https:\/\/www.microsoft.com\/en-us\/security\/blog\/wp-content\/uploads\/2022\/12\/Figure-1.-A-common-com.apple_.quarantine-extended-attribute-value.png\" alt=\"Graphical user interface; text\" class=\"wp-image-125348\" srcset=\"https:\/\/www.microsoft.com\/en-us\/security\/blog\/wp-content\/uploads\/2022\/12\/Figure-1.-A-common-com.apple_.quarantine-extended-attribute-value.png 936w, https:\/\/www.microsoft.com\/en-us\/security\/blog\/wp-content\/uploads\/2022\/12\/Figure-1.-A-common-com.apple_.quarantine-extended-attribute-value-300x29.png 300w, https:\/\/www.microsoft.com\/en-us\/security\/blog\/wp-content\/uploads\/2022\/12\/Figure-1.-A-common-com.apple_.quarantine-extended-attribute-value-768x74.png 768w, https:\/\/www.microsoft.com\/en-us\/security\/blog\/wp-content\/uploads\/2022\/12\/Figure-1.-A-common-com.apple_.quarantine-extended-attribute-value-930x90.png 930w\" sizes=\"auto, (max-width: 936px) 100vw, 936px\" \/><figcaption class=\"wp-element-caption\">Figure 1. A common <em>com.apple.quarantine<\/em> extended attribute value<\/figcaption><\/figure>\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.microsoft.com\/en-us\/security\/blog\/wp-content\/uploads\/2022\/12\/Figure-2.-Gatekeeper-blocking-an-untrusted-downloaded-file.png\" alt=\"Graphical user interface; text\" class=\"wp-image-125349\" width=\"412\" height=\"466\" srcset=\"https:\/\/www.microsoft.com\/en-us\/security\/blog\/wp-content\/uploads\/2022\/12\/Figure-2.-Gatekeeper-blocking-an-untrusted-downloaded-file.png 824w, https:\/\/www.microsoft.com\/en-us\/security\/blog\/wp-content\/uploads\/2022\/12\/Figure-2.-Gatekeeper-blocking-an-untrusted-downloaded-file-266x300.png 266w, https:\/\/www.microsoft.com\/en-us\/security\/blog\/wp-content\/uploads\/2022\/12\/Figure-2.-Gatekeeper-blocking-an-untrusted-downloaded-file-768x868.png 768w\" sizes=\"auto, (max-width: 412px) 100vw, 412px\" \/><figcaption class=\"wp-element-caption\">Figure 2. Gatekeeper blocking an untrusted downloaded file<\/figcaption><\/figure>\n<p>Due to its essential role in stopping malware on macOS, Gatekeeper is a helpful and effective security feature. However, considering there have been numerous bypass techniques targeting the security feature in the past, Gatekeeper is not bulletproof. Gaining the ability to bypass Gatekeeper has dire implications as sometimes malware authors leverage those techniques for initial access.<\/p>\n<h2>Historical overview of Gatekeeper bypasses<\/h2>\n<p>Numerous Gatekeeper bypasses have been identified in the past years, some even <a href=\"https:\/\/www.bleepingcomputer.com\/news\/security\/apple-fixes-macos-zero-day-bug-exploited-by-shlayer-malware\/\">abused by malware families<\/a> such as Shlayer. When examining Gatekeeper bypasses from recent years, we see two approaches:<\/p>\n<ol type=\"1\">\n<li>Misuse the <em>com.apple.quarantine<\/em> extended attribute assignment.<\/li>\n<li>Find a vulnerability in the components that enforce policy checks on quarantined files.<\/li>\n<\/ol>\n<p>Two cases that we don\u2019t consider to constitute a \u201ctrue\u201d Gateway bypass are:<\/p>\n<ol type=\"a\">\n<li>Using unsupported filesystems, like a USB mass storage device using FAT32, as these require non-trivial user interaction to run macOS applications.<\/li>\n<li>MITRE\u2019s definition of \u201cGatekeeper Bypass\u201d (<a href=\"https:\/\/attack.mitre.org\/techniques\/T1553\/001\/\">T1553.001<\/a>), which requires code execution to forcefully modify or remove the <em>com.apple.quarantine<\/em> extended attribute.<\/li>\n<\/ol>\n<p>Here are some examples of Gatekeeper bypass vulnerabilities discovered over the last several years:<\/p>\n<figure class=\"wp-block-table\">\n<table>\n<tbody>\n<tr>\n<td><strong>Vulnerability<\/strong><\/td>\n<td><strong>Exploits<\/strong><\/td>\n<td><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong><a href=\"https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2022-22616\">CVE-2022-22616<\/a><\/strong><\/td>\n<td>Assignment of the quarantine attribute.<\/td>\n<td>Gzip files archived in BOM archives are not assigned with the quarantine extended attribute, further detailed <a href=\"https:\/\/jhftss.github.io\/CVE-2022-22616-Gatekeeper-Bypass\/\">here<\/a>.<\/td>\n<\/tr>\n<tr>\n<td><strong><a href=\"https:\/\/cve.mitre.org\/cgi-bin\/cvename.cgi?name=CVE-2021-1810\">CVE-2021-1810<\/a><\/strong><\/td>\n<td>Assignment of the quarantine attribute.<\/td>\n<td>Paths longer than 886 characters were not assigned with extended attributes. Therefore, creating a symbolic link that points to an app that resides in a long path results in a Gatekeeper bypass. Since symbolic links are not assigned with the quarantine attribute, it was possible to completely bypass Gatekeeper, as outlined <a href=\"https:\/\/labs.withsecure.com\/blog\/the-discovery-of-cve-2021-1810\/\">here<\/a>.<\/td>\n<\/tr>\n<tr>\n<td><strong><a href=\"https:\/\/cve.mitre.org\/cgi-bin\/cvename.cgi?name=CVE-2021-30657\">CVE-2021-30657<\/a><\/strong><\/td>\n<td>Component(s) that enforce policy checks.<\/td>\n<td>App bundles with a missing <em>Info.plist<\/em> and a shell script main executable component are treated incorrectly by <em>syspolicyd<\/em>, a component that enforces policy restrictions on apps. Writeups can be found <a href=\"https:\/\/cedowens.medium.com\/macos-gatekeeper-bypass-2021-edition-5256a2955508\">here<\/a> and <a href=\"https:\/\/objective-see.org\/blog\/blog_0x64.html\">here<\/a>.<\/td>\n<\/tr>\n<tr>\n<td><strong><a href=\"https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2021-30853\">CVE-2021-30853<\/a><\/strong><\/td>\n<td>Component(s) that enforce policy checks.<\/td>\n<td>A security bug in the way files with a \u201c<em>Shebang<\/em>\u201d (#!) header are interpreted by <em>syspolicyd<\/em> cause it to consider the app bundle to be safe, as detailed <a href=\"https:\/\/objective-see.org\/blog\/blog_0x6A.html\">here<\/a>.<\/td>\n<\/tr>\n<tr>\n<td><strong><a href=\"https:\/\/cve.mitre.org\/cgi-bin\/cvename.cgi?name=CVE-2019-8656\">CVE-2019-8656<\/a><\/strong><\/td>\n<td>Assignment of the quarantine attribute.<\/td>\n<td>Since symbolic links are not assigned with the quarantine extended attribute, an archive that contains a symbolic link to an app that resides in an external filesystem (NFS) results in a Gatekeeper bypass. Apple fixed the issue by blocking the execution of applications from remote shared locations, documented <a href=\"https:\/\/www.fcvl.net\/vulnerabilities\/macosx-gatekeeper-bypass\">here<\/a>.<\/td>\n<\/tr>\n<tr>\n<td><strong><a href=\"https:\/\/cve.mitre.org\/cgi-bin\/cvename.cgi?name=CVE-2014-8826\">CVE-2014-8826<\/a><\/strong><\/td>\n<td>Component(s) that enforce policy checks.<\/td>\n<td>Quarantine attributes are not checked for JAR files, which are run by Java, as summarized <a href=\"https:\/\/www.ampliasecurity.com\/advisories\/os-x-gatekeeper-bypass-vulnerability.html\">here<\/a>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h2>Metadata persistence over AppleDouble<\/h2>\n<p>Intrigued by <a href=\"https:\/\/cve.mitre.org\/cgi-bin\/cvename.cgi?name=CVE-2021-1810\">CVE-2021-1810<\/a>, as listed in the above table, we wondered what mechanism could be leveraged in archives. Considering symbolic links are preserved in archives and aren\u2019t assigned with quarantine attributes\u2014we looked for a mechanism that could persist different kinds of metadata over archives.<\/p>\n<p>After some investigation, we discovered a way to persist important file metadata through a mechanism called AppleDouble.<\/p>\n<p>Even though extended attributes are common on different filesystems, they might be implemented differently or even not supported, so copying files with their metadata becomes a challenging task. To solve this problem, <a href=\"https:\/\/www.rfc-editor.org\/rfc\/rfc1740.txt\">back in 1994<\/a>, Apple introduced the concept of AppleSingle and AppleDouble formats. In a nutshell, AppleSingle is a binary blob that is added as a part of the original file contents so that there\u2019s only a \u201csingle\u201d file to process, whereas AppleDouble saves the metadata in a different file side-by-side next to the original file, with a \u201c._\u201d prefix.<\/p>\n<p>Interestingly, when extracting an archive, macOS processes any attached AppleDouble file and assigns the target file with the appropriate metadata.<\/p>\n<p>The AppleDouble binary file format is quite complicated, but the code that parses it can be read in the XNU git repository in <a href=\"https:\/\/github.com\/apple\/darwin-xnu\/blob\/main\/bsd\/vfs\/vfs_xattr.c\">the file<\/a> that handles extended attributes, which also includes ASCII-art depiction of the format. To demonstrate the AppleDouble file information, we used the <a href=\"https:\/\/ss64.com\/osx\/ditto.html\"><em>ditto<\/em><\/a> utility as such:<\/p>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"737\" height=\"546\" src=\"https:\/\/www.microsoft.com\/en-us\/security\/blog\/wp-content\/uploads\/2022\/12\/Figure-3.-AppleDouble-file-created-as-._somefile.png\" alt=\"Graphical user interface; text\" class=\"wp-image-125350\" srcset=\"https:\/\/www.microsoft.com\/en-us\/security\/blog\/wp-content\/uploads\/2022\/12\/Figure-3.-AppleDouble-file-created-as-._somefile.png 737w, https:\/\/www.microsoft.com\/en-us\/security\/blog\/wp-content\/uploads\/2022\/12\/Figure-3.-AppleDouble-file-created-as-._somefile-300x222.png 300w\" sizes=\"auto, (max-width: 737px) 100vw, 737px\" \/><figcaption class=\"wp-element-caption\">Figure 3. AppleDouble file created as \u201c._somefile\u201d<\/figcaption><\/figure>\n<p>When the file is archived alongside its original file and then extracted by macOS, extended attributes are fully restored, as demonstrated here:<\/p>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"725\" height=\"285\" src=\"https:\/\/www.microsoft.com\/en-us\/security\/blog\/wp-content\/uploads\/2022\/12\/Figure-4.-Using-AppleDouble-in-a-zip-file-to-preserve-extended-attributes.png\" alt=\"Graphical user interface; text\" class=\"wp-image-125351\" srcset=\"https:\/\/www.microsoft.com\/en-us\/security\/blog\/wp-content\/uploads\/2022\/12\/Figure-4.-Using-AppleDouble-in-a-zip-file-to-preserve-extended-attributes.png 725w, https:\/\/www.microsoft.com\/en-us\/security\/blog\/wp-content\/uploads\/2022\/12\/Figure-4.-Using-AppleDouble-in-a-zip-file-to-preserve-extended-attributes-300x118.png 300w\" sizes=\"auto, (max-width: 725px) 100vw, 725px\" \/><figcaption class=\"wp-element-caption\">Figure 4. Using AppleDouble in a zip file to preserve extended attributes<\/figcaption><\/figure>\n<p>Using this newfound knowledge, we examined how we could use the AppleDouble mechanism to trick Gatekeeper in some way.<\/p>\n<p>Our first approach was to generate many large extended attributes in the AppleDouble format such that there won\u2019t be enough space to assign the <em>com.apple.quarantine<\/em> extended attribute. Interestingly, it doesn\u2019t work\u2014AppleDouble is ignored if the overall size is over 2 GB, and there is no limitation on the number of extended attributes a file could get (besides the size of the disk).<\/p>\n<p>Researching further, we decided to examine the <a href=\"https:\/\/opensource.apple.com\/source\/Libc\/Libc-391\/darwin\/copyfile.c.auto.html\">source code<\/a> of the unarchiving mechanism. Carefully studying the <em>copyfile_unpack<\/em> implementation, we discovered an option for a special extended attribute named <em>com.apple.acl.text<\/em> (saved in the <em>XATTR_SECURITY_NAME<\/em> constant in the source code), which is used to set arbitrary Access Control Lists.<\/p>\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"560\" src=\"https:\/\/www.microsoft.com\/en-us\/security\/blog\/wp-content\/uploads\/2022\/12\/Figure-5.-The-code-that-allows-setting-arbitrary-Access-Control-Lists-1024x560.png\" alt=\"Graphical user interface; text\" class=\"wp-image-125352\" srcset=\"https:\/\/www.microsoft.com\/en-us\/security\/blog\/wp-content\/uploads\/2022\/12\/Figure-5.-The-code-that-allows-setting-arbitrary-Access-Control-Lists-1024x560.png 1024w, https:\/\/www.microsoft.com\/en-us\/security\/blog\/wp-content\/uploads\/2022\/12\/Figure-5.-The-code-that-allows-setting-arbitrary-Access-Control-Lists-300x164.png 300w, https:\/\/www.microsoft.com\/en-us\/security\/blog\/wp-content\/uploads\/2022\/12\/Figure-5.-The-code-that-allows-setting-arbitrary-Access-Control-Lists-768x420.png 768w, https:\/\/www.microsoft.com\/en-us\/security\/blog\/wp-content\/uploads\/2022\/12\/Figure-5.-The-code-that-allows-setting-arbitrary-Access-Control-Lists.png 1307w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Figure 5. The code that allows setting arbitrary Access Control Lists<\/figcaption><\/figure>\n<h2>Using ACLs for exploitation<\/h2>\n<p>Access Control Lists (ACLs) are a mechanism in macOS that further extends the traditional permission model. The traditional permission model saves permission for each file in a file \u201cmode\u201d, which can be changed by using the <a href=\"https:\/\/ss64.com\/osx\/chmod.html\"><em>chmod<\/em><\/a> utility. It enforces permissions on the owning user, owning group, and others in terms of reading (r), writing (w) and launching (x). A file\u2019s mode can be viewed by listing files with the \u201c<em>-l<\/em>\u201d (long) flag:<\/p>\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.microsoft.com\/en-us\/security\/blog\/wp-content\/uploads\/2022\/12\/Figure-6.-Viewing-the-hello.sh-file-mode-the-owner-can-do-anything-while-others-can-only-read-or-launch-it.png\" alt=\"Graphical user interface; text\" class=\"wp-image-125353\" width=\"566\" height=\"154\" srcset=\"https:\/\/www.microsoft.com\/en-us\/security\/blog\/wp-content\/uploads\/2022\/12\/Figure-6.-Viewing-the-hello.sh-file-mode-the-owner-can-do-anything-while-others-can-only-read-or-launch-it.png 755w, https:\/\/www.microsoft.com\/en-us\/security\/blog\/wp-content\/uploads\/2022\/12\/Figure-6.-Viewing-the-hello.sh-file-mode-the-owner-can-do-anything-while-others-can-only-read-or-launch-it-300x81.png 300w\" sizes=\"auto, (max-width: 566px) 100vw, 566px\" \/><figcaption class=\"wp-element-caption\">Figure 6. Viewing the &#8220;hello.sh&#8221; file mode, the owner can do anything while others can only read or launch it<\/figcaption><\/figure>\n<p>Unlike the traditional permission mechanism, ACLs allow fine-grained permissions to files and directories. Each ACL has one or more Access Control Entries (ACEs) that dictate what each principal can or cannot do, much like firewall rules. Like the file mode, ACLs can be modified with the <em>chmod<\/em> utility and viewed with the <em>ls<\/em> utility. It\u2019s important to note that file access checks are dictated by both ACLs and the traditional permission model mechanisms, as demonstrated by the following example:<\/p>\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.microsoft.com\/en-us\/security\/blog\/wp-content\/uploads\/2022\/12\/Figure-7.-Denying-file-reads-from-everyone-makes-it-impossible-to-read-the-file-despite-its-mode.png\" alt=\"Graphical user interface; text\" class=\"wp-image-125354\" width=\"773\" height=\"274\" srcset=\"https:\/\/www.microsoft.com\/en-us\/security\/blog\/wp-content\/uploads\/2022\/12\/Figure-7.-Denying-file-reads-from-everyone-makes-it-impossible-to-read-the-file-despite-its-mode.png 773w, https:\/\/www.microsoft.com\/en-us\/security\/blog\/wp-content\/uploads\/2022\/12\/Figure-7.-Denying-file-reads-from-everyone-makes-it-impossible-to-read-the-file-despite-its-mode-300x106.png 300w, https:\/\/www.microsoft.com\/en-us\/security\/blog\/wp-content\/uploads\/2022\/12\/Figure-7.-Denying-file-reads-from-everyone-makes-it-impossible-to-read-the-file-despite-its-mode-768x272.png 768w\" sizes=\"auto, (max-width: 773px) 100vw, 773px\" \/><figcaption class=\"wp-element-caption\">Figure 7. Denying file reads from everyone makes it impossible to read the file despite its mode<\/figcaption><\/figure>\n<p>The set of authorizations supported by ACLs is well-documented by Apple in the <em>chmod<\/em> manual, which contain more than the traditional reading, writing, or launching abilities, including:<\/p>\n<ul>\n<li><em>writeattr<\/em>: controls the ability to write attributes to the file<\/li>\n<li><em>writeextattr<\/em>: controls the ability to write extended attributes to the file<\/li>\n<li><em>writesecurity<\/em>: controls the ability to set ACLs to the file<\/li>\n<li><em>chown<\/em>: controls the ability to set the owner of the file<\/li>\n<li><em>delete:<\/em> controls the ability to delete the file<\/li>\n<\/ul>\n<p>Equipped with this information, we decided to add very restrictive ACLs to the downloaded files. Those ACLs prohibit Safari (or any other program) from setting new extended attributes, including the <em>com.apple.quarantine<\/em> attribute.<\/p>\n<p>Two minor challenges that we had to overcome during the proof-of-concept (POC) development were:<\/p>\n<ul>\n<li>The format of the ACL text as saved in the AppleDouble file isn\u2019t identical to the format of the <em>chmod<\/em> command line. This can easily be overcome by invoking the macOS <a href=\"https:\/\/developer.apple.com\/library\/archive\/documentation\/System\/Conceptual\/ManPages_iPhoneOS\/man3\/acl_to_text.3.html\"><em>acl_to_text<\/em><\/a> API and saving the ACL with the correct format.<\/li>\n<li>When using the <em>ditto<\/em> utility, the <em>com.apple.acl.text<\/em> extended attribute is lost in the resulting AppleDouble file. This can be overcome by either manually creating the binary AppleDouble or, as we chose in this case, simply patching the resulting AppleDouble file before archiving it.<\/li>\n<\/ul>\n<p>Therefore, our POC is as follows:<\/p>\n<ol type=\"1\">\n<li>Create a fake directory structure with an arbitrary icon and payload.<\/li>\n<li>Create an AppleDouble file with the <em>com.apple.acl.text<\/em> extended attribute key and a value that represents a restrictive ACL (we chose the equivalent of \u201c<em>everyone deny write,writeattr,writeextattr,writesecurity,chown<\/em>\u201d). Perform the correct AppleDouble patching if using <em>ditto<\/em> to generate the AppleDouble file.<\/li>\n<li>Create an archive with the application alongside its AppleDouble file and host it on a web server.<\/li>\n<\/ol>\n<p>We named our POC exploit Achilles after its use of ACLs to bypass Gatekeeper. Our POC recorded video can be viewed here:<\/p>\n<p><iframe loading=\"lazy\" title=\"Video Player\" src=\"https:\/\/www.microsoft.com\/en-us\/videoplayer\/embed\/RE5dQo5\" class=\"c-video\" frameborder=\"0\" width=\"100%\" height=\"420\" allowfullscreen=\"true\" style=\"\"><\/iframe><\/p>\n<p>The AppleDouble file we used for this Gatekeeper bypass can be generated, as displayed below:<\/p>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"770\" height=\"527\" src=\"https:\/\/www.microsoft.com\/en-us\/security\/blog\/wp-content\/uploads\/2022\/12\/Figure-8.-Generic-AppleDouble-file-that-can-be-used-for-any-Gatekeeper-bypass.png\" alt=\"Graphical user interface; text\" class=\"wp-image-125355\" srcset=\"https:\/\/www.microsoft.com\/en-us\/security\/blog\/wp-content\/uploads\/2022\/12\/Figure-8.-Generic-AppleDouble-file-that-can-be-used-for-any-Gatekeeper-bypass.png 770w, https:\/\/www.microsoft.com\/en-us\/security\/blog\/wp-content\/uploads\/2022\/12\/Figure-8.-Generic-AppleDouble-file-that-can-be-used-for-any-Gatekeeper-bypass-300x205.png 300w, https:\/\/www.microsoft.com\/en-us\/security\/blog\/wp-content\/uploads\/2022\/12\/Figure-8.-Generic-AppleDouble-file-that-can-be-used-for-any-Gatekeeper-bypass-768x526.png 768w\" sizes=\"auto, (max-width: 770px) 100vw, 770px\" \/><figcaption class=\"wp-element-caption\">Figure 8. Generic AppleDouble file that can be used for any Gatekeeper bypass<\/figcaption><\/figure>\n<h2>Improving security for all through research and threat intelligence sharing<\/h2>\n<p>The threat landscape continues to evolve, delivering new threats and attack capabilities that take advantage of unpatched vulnerabilities and misconfigurations as a vector to access systems and data. Our data shows that fake apps remain one of the top entry vectors on macOS, indicating Gatekeeper bypass techniques are an attractive and even a necessary capability for adversaries to leverage in attacks. Nonetheless, through research-driven protections and collaboration with customers, partners, and industry experts, we strive to enrich our protection technologies to defend against such issues\u2014regardless of the platform or device in use.<\/p>\n<p>As environments continue to rely on a diverse range of devices and operating systems, organizations need security solutions that can provide protection across platforms and a complete picture of their security posture. Collaborative research such as this informs our comprehensive protection capabilities across platforms, allowing <a href=\"https:\/\/www.microsoft.com\/security\/business\/endpoint-security\/microsoft-defender-endpoint?rtc=1\">Microsoft Defender for Endpoint<\/a> to deliver and coordinate threat defense across all major OS platforms including Windows, macOS, Linux, Android, and iOS. On macOS devices, Microsoft Defender for Endpoint detects and exposes threats and vulnerabilities, including CVE-2022-42821, using antivirus, endpoint detection and response (EDR), and threat and vulnerability management capabilities. This research also improved <a href=\"https:\/\/docs.microsoft.com\/microsoft-365\/security\/defender-vulnerability-management\/defender-vulnerability-management-capabilities?view=o365-worldwide\">Microsoft Defender\u2019s Vulnerability Management<\/a> capabilities to discover, prioritize, and remediate misconfigurations and vulnerabilities. This includes detecting CVE-2022-42821 on <a href=\"https:\/\/docs.microsoft.com\/microsoft-365\/security\/defender-endpoint\/microsoft-defender-endpoint-mac?view=o365-worldwide\">macOS devices<\/a> by examining AppleDouble files misusing ACLs.<\/p>\n<p>This case also emphasized the need for responsible vulnerability disclosures and expert, cross-platform collaboration to effectively mitigate issues, protecting users against present and future threats. We wish to again thank the Apple product security team for their efforts and responsiveness in addressing the issue.<\/p>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"936\" height=\"378\" src=\"https:\/\/www.microsoft.com\/en-us\/security\/blog\/wp-content\/uploads\/2022\/12\/Figure-9.-Microsoft-Defender-for-Endpoint-preventing-the-vulnerability.png\" alt=\"Microsoft Defender for Endpoint detecting and preventing an AppleDouble file\" class=\"wp-image-125356\" srcset=\"https:\/\/www.microsoft.com\/en-us\/security\/blog\/wp-content\/uploads\/2022\/12\/Figure-9.-Microsoft-Defender-for-Endpoint-preventing-the-vulnerability.png 936w, https:\/\/www.microsoft.com\/en-us\/security\/blog\/wp-content\/uploads\/2022\/12\/Figure-9.-Microsoft-Defender-for-Endpoint-preventing-the-vulnerability-300x121.png 300w, https:\/\/www.microsoft.com\/en-us\/security\/blog\/wp-content\/uploads\/2022\/12\/Figure-9.-Microsoft-Defender-for-Endpoint-preventing-the-vulnerability-768x310.png 768w\" sizes=\"auto, (max-width: 936px) 100vw, 936px\" \/><figcaption class=\"wp-element-caption\">Figure 8. Generic AppleDouble file that can be used for any Gatekeeper bypass<\/figcaption><\/figure>\n<p>Our Microsoft security researchers continue to discover new threats and vulnerabilities as part of our effort to secure users\u2019 computing experiences, be it a Windows or non-Windows device. In the effort to improve security for all, we will continue to share intelligence and work with the security community to create and improve upon solutions that protect users and organizations across platforms every single day.<\/p>\n<p><strong>Jonathan Bar Or<\/strong><\/p>\n<p>Microsoft 365 Defender Research Team<\/p>\n<p>The post <a rel=\"nofollow\" href=\"https:\/\/www.microsoft.com\/en-us\/security\/blog\/2022\/12\/19\/gatekeepers-achilles-heel-unearthing-a-macos-vulnerability\/\">Gatekeeper\u2019s Achilles heel: Unearthing a macOS vulnerability<\/a> appeared first on <a rel=\"nofollow\" href=\"https:\/\/www.microsoft.com\/en-us\/security\/blog\">Microsoft Security Blog<\/a>.<\/p>\n<p><a href=\"https:\/\/www.microsoft.com\/en-us\/security\/blog\/2022\/12\/19\/gatekeepers-achilles-heel-unearthing-a-macos-vulnerability\/\" target=\"bwo\" >https:\/\/blogs.technet.microsoft.com\/mmpc\/feed\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><strong>Credit to Author: Microsoft Security Threat Intelligence| Date: Mon, 19 Dec 2022 18:00:00 +0000<\/strong><\/p>\n<p>Microsoft discovered a vulnerability in macOS, referred to as \u201cAchilles\u201d, allowing attackers to bypass application execution restrictions enforced by the Gatekeeper security mechanism. <\/p>\n<p>The post <a rel=\"nofollow\" href=\"https:\/\/www.microsoft.com\/en-us\/security\/blog\/2022\/12\/19\/gatekeepers-achilles-heel-unearthing-a-macos-vulnerability\/\">Gatekeeper\u2019s Achilles heel: Unearthing a macOS vulnerability<\/a> appeared first on <a rel=\"nofollow\" href=\"https:\/\/www.microsoft.com\/en-us\/security\/blog\">Microsoft Security Blog<\/a>.<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[10759,10378],"tags":[4500,10403,10516,22453,714,10467],"class_list":["post-20850","post","type-post","status-publish","format-standard","hentry","category-microsoft","category-security","tag-cybersecurity","tag-macos","tag-microsoft","tag-microsoft-security-intelligence","tag-security","tag-vulnerability"],"_links":{"self":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts\/20850","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/comments?post=20850"}],"version-history":[{"count":0,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts\/20850\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/media?parent=20850"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/categories?post=20850"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/tags?post=20850"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}