
Proof-of-concept exploit for CVE-2025-21333, a heap-based buffer overflow in Hyper-V's vkrnlintvsp.sys leading to local privilege escalation via I/O Ring and token replacement.
Hyper-V NT Kernel Integration VSP (vkrnlintvsp.sys) Paged Pool heap overflow → Local Privilege Escalation (LPE).
This directory contains lab PoC source code (based on MrAle98/CVE-2025-21333-POC, including a local patch).
| Item | Content |
|---|---|
| CVE | CVE-2025-21333 |
| Type | Heap-based Buffer Overflow |
| Impact | Local Privilege Escalation (EoP); was marked as exploited in the wild |
| Component | vkrnlintvsp.sys |
| Vulnerable Function | VkiRootAdjustSecurityDescriptorForVmwp |
| Pool Tag | ViRo |
| Patch | 2025-01-14; Win11 23H2 must be ≥ 22631.4751 (KB5050021) |
In VkiRootAdjustSecurityDescriptorForVmwp:
WORD: AclSize + sid1 + sid2 + 16AclSize = 0xfff0, sum is 0x10040 → truncated to 0x40ExAllocatePool2(..., 0x40, 'ViRo')memmove(pool, dacl, AclSize) still copies the full 0xfff0Core inequality: allocatedBytes(0x40) < accessEnd(0xfff0).
KD dynamic confirmation:
ExAllocatePool2 → @rdx = 0x40memmove → @r8 = 0xfff0Requires enabling Windows Sandbox (and Nested Virtualization) so that the relevant syscall enters vkrnlintvsp.sys:
PoC → NtCreateCrossVmEvent
→ VkiRootCalloutCreateEvent
→ VkiRootAdjustSecurityDescriptorForVmwp
| Item | Value |
|---|---|
| Guest OS | Windows 11 23H2 |
Patched 23H2 (≥ 22631.4751) not reproducible. Requires enabling Nested Virtualization + Windows Sandbox.
WNF_STATE_DATAAclSize=0xfff0, trigger overflow, enlarge adjacent WNF DataSizeIrRB (I/O Ring RegBuffers) + NpAt (PipeAttribute)IOP_MC_BUFFER_ENTRY in user modePRIV_ESC_OK → session-bound visible SYSTEM shellExpected layout: 0x30 IrRB + 0x80 NpAt (requires found1=1 && found2=1).
Mandatory contract relative to upstream:
Heap spray layout is non-deterministic, privilege escalation not 100%; can retry on failure.
| Guest build | 10.0.22631.3447 (< 4751, reproducible) |
vkrnlintvsp.sys | 10.0.22621.2506; SHA256 015DD1211569B6F85CC0041269F249BA5935A3DA89B615B502DF59EAD5354BB8 |
| Topic | Key Points |
|---|
| Dual-ACE | Single ACE AceSize=0xf000 will be changed by SeCapture to about 0xf008 → no overflow; must use dual ACE to preserve kernel AclSize=0xfff0 |
| Return code | CrossVm may return STATUS_INVALID_ACL (0xC0000077), must still continue scanning WNF |
| Timing | free CCC → Submit IoRing → Sleep(5000) → free DDD → pipe spray |
| Sandbox | After confirming IrRB/NpAt, then kill WindowsSandboxClient |
| ntos RVA | ExAllocatePool2=0xaac7a0, PsInitialSystemProcess=0xd1da60 (upstream offset on 3447 yields system EPROCESS: 0) |
| Visible shell | CreateProcessAsUser + TokenSessionId + winsta0\Default → VISIBLE_SYSTEM_CMD_OK |