<?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>Security Framework — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/security-framework/</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 15:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/security-framework/feed.xml" rel="self" type="application/rss+xml"/><item><title>Apple Security Framework Crash due to Uninitialized Pointer</title><link>https://feed.craftedsignal.io/briefs/2024-01-apple-security-framework-crash/</link><pubDate>Wed, 03 Jan 2024 15:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-apple-security-framework-crash/</guid><description>A crash was identified in Apple's Security framework due to an uninitialized pointer in the SecError function, leading to the dereference of an invalid memory address.</description><content:encoded><![CDATA[<p>A vulnerability exists within Apple&rsquo;s Security framework that can lead to application crashes. The issue stems from an uninitialized pointer, <code>CFErrorRef *error</code>, within the <code>SecCDSAKeyCopyPublicKey</code> function. This function is part of the Swift framework responsible for handling cryptographic operations, specifically dealing with certificate authorities and key generation. When an error occurs during the execution of <code>SecCDSAKeyCopyPublicKey</code>, a catch block is invoked. This catch block then calls the <code>SecError</code> function with the uninitialized <code>CFErrorRef</code> pointer. The <code>SecError</code> function attempts to dereference this uninitialized pointer, resulting in an attempt to access an invalid memory address and triggering an <code>EXC_BAD_ACCESS</code> exception, ultimately crashing the application. This vulnerability was discovered during the development of a security utility named &ldquo;Do Not Disturb (DND)&rdquo;.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Application invokes the <code>SecCDSAKeyCopyPublicKey</code> function within Apple&rsquo;s Security framework.</li>
<li>An error occurs during the execution of <code>SecCDSAKeyCopyPublicKey</code>, triggering a <code>MacOSError</code>, <code>CommonError</code>, <code>std::bad_alloc</code>, or other exception.</li>
<li>The <code>BEGIN_SECKEYAPI</code> and <code>END_SECKEYAPI</code> macros wrap the function in a try/catch block.</li>
<li>The catch block is executed due to the error.</li>
<li>Within the catch block, the <code>SecError</code> function is called.</li>
<li>The <code>SecError</code> function receives an uninitialized <code>CFErrorRef *error</code> pointer because it was declared but not assigned a valid memory address within <code>SecCDSAKeyCopyPublicKey</code>.</li>
<li><code>SecError</code> attempts to dereference the invalid <code>CFErrorRef *error</code> pointer.</li>
<li>This dereference operation results in an <code>EXC_BAD_ACCESS</code> exception, causing the application to crash.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>The vulnerability leads to application crashes on macOS. While the source does not specify the number of victims or sectors targeted, any application utilizing the vulnerable <code>SecCDSAKeyCopyPublicKey</code> function within Apple&rsquo;s Security framework is susceptible to this crash. A successful exploitation of this vulnerability results in a denial-of-service condition for the affected application.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Monitor for crash reports indicating <code>EXC_BAD_ACCESS</code> exceptions originating within the <code>SecError</code> function of Apple&rsquo;s Security framework, specifically when called from <code>SecCDSAKeyCopyPublicKey</code>.</li>
<li>Examine the logs for exceptions or errors occurring within cryptographic functions that may trigger the described crash within <code>SecCDSAKeyCopyPublicKey</code>.</li>
<li>Deploy the Sigma rule &ldquo;Detect Security Framework Crashes due to Uninitialized Pointer&rdquo; to identify potential exploitation attempts.</li>
<li>Implement runtime monitoring to detect attempts to call <code>SecError</code> with invalid <code>CFErrorRef</code> pointers.</li>
</ul>
]]></content:encoded><category domain="severity">medium</category><category domain="type">advisory</category><category>security-framework</category><category>crash</category><category>uninitialized-pointer</category><category>macos</category></item></channel></rss>