# Playing It SFAPE: Code Execution in Isolated User Mode

DevFeed: [Playing It SFAPE: Code Execution in Isolated User Mode](<https://devfeed.tech/articles/playing-it-sfape-code-execution-in-isolated-user-mode-92082.md>)

Original publisher: [Read original article](<https://blog.doyensec.com/2026/10/13/Sfape.html>)

Published: 2026-10-12T22:00:00Z

Content type: article

Language: en

Sources: [Doyensec](<https://devfeed.tech/sources/doyensec.md>)

Topics: [virtualization](<https://devfeed.tech/topics/virtualization.md>), [Cryptography](<https://devfeed.tech/topics/cryptography.md>)

Tags: [auditing](<https://devfeed.tech/tags/auditing.md>), [automation](<https://devfeed.tech/tags/automation.md>), [bug](<https://devfeed.tech/tags/bug.md>), [code-execution](<https://devfeed.tech/tags/code-execution.md>), [control](<https://devfeed.tech/tags/control.md>), [doyensec](<https://devfeed.tech/tags/doyensec.md>), [doyensecurity](<https://devfeed.tech/tags/doyensecurity.md>), [exploit](<https://devfeed.tech/tags/exploit.md>), [exports](<https://devfeed.tech/tags/exports.md>), [hacking](<https://devfeed.tech/tags/hacking.md>), [has](<https://devfeed.tech/tags/has.md>), [infosec](<https://devfeed.tech/tags/infosec.md>), [integrity](<https://devfeed.tech/tags/integrity.md>), [kernel](<https://devfeed.tech/tags/kernel.md>), [libraries](<https://devfeed.tech/tags/libraries.md>), [memory](<https://devfeed.tech/tags/memory.md>), [microsoft](<https://devfeed.tech/tags/microsoft.md>), [offensive](<https://devfeed.tech/tags/offensive.md>), [pentest](<https://devfeed.tech/tags/pentest.md>), [pentester](<https://devfeed.tech/tags/pentester.md>), [process](<https://devfeed.tech/tags/process.md>), [reverse-engineering](<https://devfeed.tech/tags/reverse-engineering.md>), [ring](<https://devfeed.tech/tags/ring.md>), [security](<https://devfeed.tech/tags/security.md>), [space](<https://devfeed.tech/tags/space.md>), [system](<https://devfeed.tech/tags/system.md>), [virtual](<https://devfeed.tech/tags/virtual.md>), [virtualization](<https://devfeed.tech/tags/virtualization.md>), [vulnerability](<https://devfeed.tech/tags/vulnerability.md>), [windows](<https://devfeed.tech/tags/windows.md>), [world](<https://devfeed.tech/tags/world.md>), [write](<https://devfeed.tech/tags/write.md>)

## AI overview

The article shows how a fixed four-byte write in SFAPE.dll's repeated Initialize path can corrupt the enclave-base range check, making a ClipboardInput descriptor race reachable. The resulting chain pivots SFAPE's credential-context map to gain constrained VTL1 read and write primitives, alters vertdll's writable valid-target table, and uses NtContinue to call existing VTL1 code with controlled arguments. The authors also describe Secure Kernel copy services that simplify memory access. Microsoft's September 2026 update validates the repeated-initialization request, hardens ClipboardInput against the demonstrated race, and updates VBS Code Integrity policy to reject older SFAPE images. The article says a vulnerable Edge enclave remains unblocked; whether that is deliberate is unclear.

## Source excerpt

It is tempting to think of Windows in terms of a simple model: user mode and kernel mode. If a bug lets a user-mode process gain control of the kernel, it's game over. Well, for a long time it used to be like that. Protected processes, SMEP, PatchGuard and other mitigations surely raised the bar, but it was Virtualization-Based Security that added another dimension to that model and made the whole design a lot more complex. Some code does not merely cross from user mode to kernel mode. It crosses into another Virtual Trust Level (VTL), where the normal kernel is no longer the most trusted component in the system. From a VTL0 perspective, the call may look like it disappears into a region whose private memory cannot be inspected even with kernel privileges. VBS uses the Windows hypervisor to split the system into Virtual Trust Levels. This separation is orthogonal to the user-mode/kernel-mode distinction. On x64, both VTLs can contain ring 3 and ring 0 code. In the VTL1 world, we are talking about Isolated User Mode (IUM) and the Secure Kernel (SK), respectively. This part of Windows has existed for years now, primarily to support really powerful features such as Hypervisor-Protected Code Integrity and Credential Guard. However, until recently, VTL1 was also pretty exclusive to Microsoft's code. We are not aware of any third-party trustlets. Technically, a trustlet is just yet another PE file with a special policy, metadata and a signature. Yet, the signature part is a problem - Microsoft simply doesn't offer a way to properly sign custom trustlets. Things changed when Microsoft introduced support for third-party VBS enclaves. These are custom libraries loaded by a normal VTL0 process but running within an isolated address space in VTL1. The host process controls when the library is loaded and which exports are called, but it cannot directly read or write the enclave's private memory. Those libraries also require a special signature, but this time there is an officia