<?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>Xpc — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/xpc/</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>Mon, 29 Jan 2024 12:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/xpc/feed.xml" rel="self" type="application/rss+xml"/><item><title>macOS Privilege Escalation via Feedback Assistant Race Condition (CVE-2019-8565)</title><link>https://feed.craftedsignal.io/briefs/2024-01-rootpipe-reborn/</link><pubDate>Mon, 29 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-rootpipe-reborn/</guid><description>A race condition vulnerability (CVE-2019-8565) exists in macOS where a privileged XPC service, com.apple.appleseed.fbahelperd, improperly validates XPC messages based on process ID, allowing an unprivileged process to escalate privileges to root.</description><content:encoded><![CDATA[<p>The vulnerability, CVE-2019-8565, resides in macOS versions prior to 10.14.4 and iOS versions prior to 12.2. It involves a race condition in the privileged XPC service <code>com.apple.appleseed.fbahelperd</code>, used by the Feedback Assistant application. This service incorrectly validates incoming XPC messages based on process IDs (PIDs) instead of more secure methods like audit tokens. An unprivileged or sandboxed process can exploit this by rapidly spawning processes to reuse PIDs, tricking the privileged service into accepting malicious requests. This allows attackers to bypass security checks and execute privileged operations, ultimately leading to privilege escalation to root. The original research was published in April 2019, highlighting the risks associated with PID-based security checks in inter-process communication.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An unprivileged process sends multiple XPC messages to <code>com.apple.appleseed.fbahelperd</code> to fill the message queue.</li>
<li>The unprivileged process spawns a new process (using <code>posix_spawn</code> or <code>NSTask</code>) to reuse the PID while keeping the new process suspended.</li>
<li>The <code>FBAPrivilegedDaemon</code> validates the XPC message based on the reused PID, incorrectly associating it with the trusted Feedback Assistant application.</li>
<li>The attacker exploits the <code>copyLogFiles:</code> method to copy arbitrary files by bypassing path constraints using path traversal (e.g., &ldquo;../../../&rdquo;).</li>
<li>Files are copied to attacker-controlled locations, bypassing intended permission restrictions.</li>
<li>Alternatively, the attacker leverages <code>runMobilityReportWithDestination:</code> to trigger execution of <code>/System/Library/Frameworks/SystemConfiguration.framework/Versions/A/Resources/get-mobility-info</code>.</li>
<li>The <code>get-mobility-info</code> script checks for <code>/usr/local/bin/netdiagnose</code> and executes it with root privileges if found.</li>
<li>The attacker gains root privileges by executing a custom <code>netdiagnose</code> binary in <code>/usr/local/bin</code>.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of CVE-2019-8565 allows a local attacker to gain root privileges on vulnerable macOS systems. This can lead to complete system compromise, including unauthorized access to sensitive data, installation of malware, and modification of system configurations. The vulnerability impacts systems running macOS 10.14.3 and earlier, as well as iOS 12.2 and earlier. In CTF scenarios, it was used to directly read flag files. If an attacker can plant a binary in a location like /usr/local/bin, they can achieve instant root access.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade to macOS 10.14.4 or later to patch CVE-2019-8565.</li>
<li>Deploy the Sigma rule &ldquo;Detect Suspicious File Copy via FBAPrivilegedDaemon&rdquo; to detect exploitation attempts targeting the <code>copyLogFiles:</code> method.</li>
<li>Deploy the Sigma rule &ldquo;Detect Execution of netdiagnose from get-mobility-info&rdquo; to detect attempts to exploit the <code>runMobilityReportWithDestination:</code> method.</li>
<li>Monitor process creations for suspicious binaries executing from <code>/usr/local/bin</code> as described in the Attack Chain.</li>
</ul>
]]></content:encoded><category domain="severity">critical</category><category domain="type">advisory</category><category>privilege-escalation</category><category>macos</category><category>xpc</category><category>race-condition</category></item></channel></rss>