<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Monitor.app — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/monitor.app/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata. Fed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Wed, 03 Jan 2024 12:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/monitor.app/feed.xml" rel="self" type="application/rss+xml"/><item><title>macOS Local Privilege Escalation via Dylib Hijacking in App Store Applications</title><link>https://feed.craftedsignal.io/briefs/2024-01-macos-dylib-hijacking/</link><pubDate>Wed, 03 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-macos-dylib-hijacking/</guid><description>A local privilege escalation vulnerability in macOS allows attackers to gain root privileges by hijacking dylibs in applications installed from the Mac App Store.</description><content:encoded><![CDATA[<p>This brief addresses a local privilege escalation vulnerability in macOS that leverages dylib hijacking within applications obtained from the official Mac App Store. The vulnerability allows a malicious actor to inject a dynamic library (dylib) into a legitimate application, potentially gaining elevated privileges. The attack exploits weaknesses in how macOS applications load dynamic libraries, specifically the use of weak loading and run-path dependent (rpath) dylibs. While applications dragged into the /Applications directory are typically owned by the user, applications installed from the App Store are owned by root, requiring privilege escalation to exploit. This vulnerability matters because it allows attackers to bypass intended security restrictions and gain root access, even on systems with standard security configurations. Successful exploitation enables persistence and further malicious activities.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>The attacker identifies a vulnerable application using tools like Dylib Hijack Scanner (DHS), looking for apps with weak or rpath-dependent dylib loading.</li>
<li>The attacker confirms the absence of library-validation option (flag=0x200) using <code>codesign</code> to verify if dylib hijacking is possible.</li>
<li>The attacker crafts a malicious dylib (e.g., <code>hello-tresorit.dylib</code>) containing code to be executed upon loading, such as opening a Terminal or creating a syslog entry.</li>
<li>The attacker uses <code>gcc</code> to compile the dylib. The attacker uses a tool like <code>createHijacker.py</code> to fix the dylib version and add exports from the original dylib to the malicious dylib.</li>
<li>The attacker exploits a vulnerability to bypass root folder permissions to copy the malicious dylib to the application&rsquo;s framework directory (e.g., <code>/Applications/Tresorit.app/Contents/MacOS/TresoritExtension.app/Contents/PlugIns/FinderExtension.appex/Contents/MacOS/../../../../Frameworks/UtilsMac.framework/Versions/A/UtilsMac</code>).</li>
<li>The attacker launches the targeted application, causing the malicious dylib to be loaded into the application process.</li>
<li>The malicious code within the dylib executes with the privileges of the application, potentially escalating privileges to root.</li>
<li>The attacker achieves persistence or performs other malicious actions based on the gained privileges.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this vulnerability can lead to complete system compromise. An attacker gaining root access can install persistent backdoors, steal sensitive data, or deploy ransomware. The number of potential victims is large, as many macOS applications from the App Store are vulnerable. The affected sectors span various industries, as the vulnerability affects a wide range of applications. The consequences of a successful attack range from data breaches and financial loss to complete system control by the attacker.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Use a tool like Dylib Hijack Scanner to identify vulnerable applications in your environment and prioritize patching or removal.</li>
<li>Monitor for the creation of new dylibs within application framework directories, which may indicate a dylib hijacking attempt, using a file integrity monitoring system.</li>
<li>Deploy the Sigma rule <code>Detecting Dylib Hijacking via DYLD_PRINT_RPATHS</code> to detect attempts to identify vulnerable dylibs.</li>
<li>Enable library validation for applications to prevent the loading of unsigned or improperly signed dylibs.</li>
<li>Use process monitoring tools like Objective-See&rsquo;s ProcInfo to detect suspicious process creation events that may be indicative of exploitation.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>dylib-hijacking</category><category>privilege-escalation</category><category>macos</category></item></channel></rss>