CVE-2026-21236 — Windows Ancillary Function Driver for WinSock Elevation of Privilege Vulnerability
Executive Summary
Heap-based buffer overflow in Windows Ancillary Function Driver for WinSock allows an authorized attacker to elevate privileges locally.
Overview
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H/E:U/RL:O/RC:C
EPSS Score
Affected Products
| Product | KB Article | Severity | Impact | Restart Required |
|---|---|---|---|---|
| Windows 10 Version 1607 for 32-bit Systems | 5075999 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 1607 for x64-based Systems | 5075999 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 1809 for 32-bit Systems | 5075904 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 1809 for x64-based Systems | 5075904 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 21H2 for 32-bit Systems | 5075912 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 21H2 for ARM64-based Systems | 5075912 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 21H2 for x64-based Systems | 5075912 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 22H2 for 32-bit Systems | 5075912 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 22H2 for ARM64-based Systems | 5075912 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 22H2 for x64-based Systems | 5075912 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 11 Version 23H2 for ARM64-based Systems | 5075941 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 11 Version 23H2 for x64-based Systems | 5075941 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 11 Version 24H2 for ARM64-based Systems 5077181 (Security Update) 5077212 (Security Hotpatch Update) Important Elevation of Privilege 5073379 Base: 7.8 Temporal: 6.8 Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H/E:U/RL:O/RC:C 10.0.26100.7840 10.0.26100.7781 Yes None Windows 11 Version 24H2 for x64-based Systems 5077212 (Security Hotpatch Update) 5077181 (Security Update) Important Elevation of Privilege 5074109 Base: 7.8 Temporal: 6.8 Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H/E:U/RL:O/RC:C 10.0.26100.7781 10.0.26100.7840 Yes None Windows 11 Version 25H2 for ARM64-based Systems 5077181 (Security Update) 5077212 (Security Hotpatch Update) Important Elevation of Privilege 5074109 Base: 7.8 Temporal: 6.8 Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H/E:U/RL:O/RC:C 10.0.26200.7840 10.0.26200.7781 Yes None Windows 11 Version 25H2 for x64-based Systems 5077181 (Security Update) 5077212 (Security Hotpatch Update) Important Elevation of Privilege 5074109 Base: 7.8 Temporal: 6.8 Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H/E:U/RL:O/RC:C 10.0.26200.7840 10.0.26200.7781 Yes None Windows 11 Version 26H1 for ARM64-based Systems | 5077179 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 11 version 26H1 for x64-based Systems | 5077179 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows Server 2012 | 5075971 (Monthly Rollup) |
Important | Elevation of Privilege | Yes |
| Windows Server 2012 (Server Core installation) | 5075971 (Monthly Rollup) |
Important | Elevation of Privilege | Yes |
| Windows Server 2012 R2 | 5075970 (Monthly Rollup) |
Important | Elevation of Privilege | Yes |
| Windows Server 2012 R2 (Server Core installation) | 5075970 (Monthly Rollup) |
Important | Elevation of Privilege | Yes |
| Windows Server 2016 | 5075999 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows Server 2016 (Server Core installation) | 5075999 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows Server 2019 | 5075904 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows Server 2019 (Server Core installation) | 5075904 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows Server 2022 5075906 (Security Update) 5075943 (Security Hotpatch Update) Important Elevation of Privilege 5073457 Base: 7.8 Temporal: 6.8 Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H/E:U/RL:O/RC:C 10.0.20348.4773 10.0.20348.4711 Yes None Windows Server 2022 (Server Core installation) 5075906 (Security Update) 5075943 (Security Hotpatch Update) Important Elevation of Privilege 5073457 Base: 7.8 Temporal: 6.8 Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H/E:U/RL:O/RC:C 10.0.20348.4773 10.0.20348.4711 Yes None Windows Server 2022, 23H2 Edition (Server Core installation) | 5075897 (Security Update) |
Important | Elevation of Privilege | Yes |
Patches
| Article | Type | Restart |
|---|---|---|
5075999 |
Security Update | Yes |
5075904 |
Security Update | Yes |
5075912 |
Security Update | Yes |
5075941 |
Security Update | Yes |
5077179 |
Security Update | Yes |
5075971 |
Monthly Rollup | Yes |
5075970 |
Monthly Rollup | Yes |
5075897 |
Security Update | Yes |
Patch Diff
Patch diff 10.0.26100.7623 -> 10.0.26100.7824
| Function | Address | Change | Note |
|---|---|---|---|
AfdBReceive |
14003f640 -> 14003e810 |
code, length, address, called | similarity 0.63 |
NTOSKRNL.EXE::MmMapLockedPages |
EXTERNAL:000000d5 -> EXTERNAL:000000d6 |
refcount, address | similarity 1.0 |
AfdNotifyPostEvents |
14005364c -> 140053cac |
code, length, address, called | similarity 0.39 |
memcpy |
140074980 -> 140075200 |
refcount, address | similarity 1.0 |
AfdFastDatagramReceive |
140033850 -> 140032940 |
code, length, address, called | similarity 0.6 |
AfdTdiCreateAO |
14002c650 -> 14002b6a0 |
code, length, sig, address, called | similarity 0.92 |
AfdNotifyDestroyContext |
14005349c -> 140053adc |
code, length, address, called | similarity 0.67 |
AfdCleanupCore |
140013870 -> 1400135a0 |
code, length, address, called | similarity 0.67 |
AfdTransmitPackets |
140043d30 -> 140044100 |
code, length, address, called | similarity 0.41 |
AfdBCommonChainedReceiveEventHandler |
14001a380 -> 140019340 |
code, length, address, called | similarity 0.98 |
AfdSuperAccept |
14002a310 -> 140029300 |
code, length, address, called | similarity 0.26 |
AfdSanConnectHandler |
14005c570 -> 14005cc50 |
code, length, address, called | similarity 0.29 |
AfdRestartSuperAcceptGetAddress |
14004a7e0 -> 14004ae30 |
code, length, address, called | similarity 0.98 |
AfdCloseCore |
140006ac8 -> 1400150c0 |
code, length, address, called | similarity 0.17 |
wil_details_IsEnabledFallback |
14004b4c8 -> 14004bab4 |
refcount, address, calling | similarity 1.0 |
AfdReceiveDatagram |
14003dec0 -> 14003d010 |
code, length, address, called | similarity 0.67 |
AfdSanAcceptCore |
140044f40 -> 1400453bc |
code, length, address, called | similarity 0.19 |
__security_check_cookie |
140074850 -> 1400750c0 |
refcount, address, calling | similarity 1.0 |
AfdNotifyProcessRegistration |
14005390c -> 140053fb8 |
code, length, address, called | similarity 0.48 |
AfdExtractAfdSendMsgInfo |
1400422a0 -> 1400415b0 |
code, length, address, called | similarity 0.41 |
__C_specific_handler |
140049fdd -> 14004a62d |
refcount, address | similarity 0.89 |
AfdCompleteBufferedSendsUnlock |
140005230 |
code, length, called | similarity 0.48 |
AfdFastConnectionSend |
140032e60 -> 140031ef0 |
code, length, address, called | similarity 0.7 |
AfdFastConnectionReceive |
140031ef0 -> 140030f00 |
code, length, address, called | similarity 0.5 |
__GSHandlerCheck_SEH |
1400747b4 -> 140075024 |
refcount, address | similarity 1.0 |
NTOSKRNL.EXE::ExFreePoolWithTag |
EXTERNAL:000000f5 -> EXTERNAL:000000f6 |
refcount, address, calling | similarity 1.0 |
AfdQueryHandles |
14003a350 -> 140039510 |
code, length, sig, address, called | similarity 0.63 |
AfdBind |
14002acb0 -> 140029c70 |
code, length, address, called | similarity 0.1 |
AfdFastDatagramSend |
140034280 -> 1400333d0 |
code, length, address, called | similarity 0.41 |
Feature_2829529401__private_IsEnabledDeviceUsageNoInline |
14004acf0 -> 14004c900 |
name, fullname, refcount, sig, address, calling, called | similarity 0.71 |
Feature_447951161__private_IsEnabledDeviceUsageNoInline |
14004acf0 -> 14004d200 |
name, fullname, refcount, sig, address, calling, called | similarity 0.71 |
Feature_TCPIP_2025_Wave4_AfdTransmit_MSRC__private_IsEnabledDeviceUsageNoInline |
14004acf0 -> 14005bd78 |
name, fullname, refcount, sig, address, calling, called | similarity 0.71 |
Feature_3923194169__private_IsEnabledDeviceUsageNoInline |
14004acf0 -> 140060620 |
name, fullname, refcount, sig, address, calling, called | similarity 0.71 |
Feature_2829529401__private_IsEnabledDeviceUsageNoInline |
14004c310 -> 14004c900 |
name, fullname, refcount, sig, address, calling, called | similarity 0.71 |
Feature_447951161__private_IsEnabledDeviceUsageNoInline |
14004c310 -> 14004d200 |
name, fullname, refcount, sig, address, calling, called | similarity 0.71 |
Feature_TCPIP_2025_Wave4_AfdTransmit_MSRC__private_IsEnabledDeviceUsageNoInline |
14004c310 -> 14005bd78 |
name, fullname, refcount, sig, address, calling, called | similarity 0.71 |
Feature_3923194169__private_IsEnabledDeviceUsageNoInline |
14004c310 -> 140060620 |
name, fullname, refcount, sig, address, calling, called | similarity 0.71 |
Feature_447951161__private_IsEnabledDeviceUsageNoInline |
140056c40 -> 14004d200 |
name, fullname, refcount, sig, address, calling, called | similarity 0.71 |
Feature_3923194169__private_IsEnabledDeviceUsageNoInline |
140056c40 -> 140060620 |
name, fullname, refcount, sig, address, calling, called | similarity 0.71 |
Root Cause Analysis
CVE-2026-21236 — afd.sys AfdSanConnectHandler Heap-Based Buffer Overflow
Summary
| Product | Microsoft Windows — afd.sys (Ancillary Function Driver for WinSock) |
|---|---|
| Vendor | Microsoft Corporation |
| Severity | CVSS v3.1 7.8 (High) |
| CVSS Vector | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H (MSRC) |
| CVE Title | Windows Ancillary Function Driver for WinSock Elevation of Privilege Vulnerability |
| CWE | CWE-122 (Heap-based Buffer Overflow), CWE-787 (Out-of-bounds Write) |
| Affected Versions | Windows 10 (1607+), Windows 11 (23H2/24H2/25H2), Windows Server 2012–2025 |
| Tested Version | Windows 11 24H2 — afd.sys 10.0.26100.7623 (pre, KB5074109) vs 10.0.26100.7824 (post, KB5077181) |
| Impact | Local EoP — authenticated local attacker corrupts kernel pool memory → SYSTEM |
| Exploitability (MSRC) | “Exploitation Unlikely” — practical trigger requires Windows Server with SAN/RDMA components |
| PoC Available | NCC Group published a full analysis + PoC walkthrough (Python, WinDbg-verified BSOD); no public weaponised exploit |
| Patch Date | February 2026 Patch Tuesday — KB5077181 |
Root Cause
afd.sys still carries the legacy SAN (System Area Network / Windows
Sockets Direct, RDMA) code path for backwards compatibility. Two IOCTL
handlers cooperate across two different socket handles:
-
AfdSuperAccept— called on a listener SAN endpoint. It parses a user-controlledType3InputBufferwhose length fields (ReceiveDataLength,RemoteAddressLength, …) are sanity-checked, then allocates an MDL of user-influencedTotalLengthviaIoAllocateMdl+MmProbeAndLockPages. This is the destination buffer. -
AfdSanConnectHandler— called on a connecting SAN endpoint. It copies the connect request’s address payload into the listener’s MDL buffer (MmMapLockedPages). The copy length is read from the user-controlled input buffer (*_Src) and was never checked against the size of the buffer allocated byAfdSuperAccept.
Because the attacker controls the allocation size (via AfdSuperAccept), the
copy size, and the copied bytes (via AfdSanConnectHandler), a copy size
larger than the allocation produces a fully controlled kernel heap/pool
overflow (in NCC’s demo: 0x1000-byte buffer, 0x2002-byte copy, classic
'A'*0x1000 + 'B'*0x1002 pattern observed in WinDbg over the MDL’s mapped
VA).
The patch (verified in our ghidriff diff, 7623 → 7824)
Behind WIL feature flag Feature_3923194169, the copy length is now clamped
against the destination buffer’s size field (*(uint*)(lVar15 + 0x18),
sourced from the IRP stack) before both copy sites:
// post-patch 10.0.26100.7824 — clamp added before memcpy
if ((int)(uVar27 + 4) < (int)((uVar5 & 0xffff) - 8)) uVar27 = uVar27 + 4;
else uVar27 = (short)uVar5 - 8;
memcpy(_Dst + 2, _Src, _Size); // clamped
AfdSuperAccept and AfdRestartSuperAcceptGetAddress were also touched in
the same change set (call-site/context alignment).
Reaching the bug — userspace call flow
Platform gate:
AfdSanCreateHelperchecksMmIsThisAnNtAsSystem()— SAN endpoint creation succeeds only on Windows Server SKUs with SAN components installed. On Windows 10/11 client the vulnerable code exists but the endpoint cannot be created; the IOCTL returns an error. This is why MSRC rates exploitation “Unlikely”.
AFD has no documented userspace SAN API; all interaction is raw IRP traffic (NCC’s approach, building on Akamai’s prior AFD research):
ntdll!NtCreateFile("\\Device\\Afd\\Endpoint", EA = "AfdSwOpenPacket")
│ ← SAN endpoint (NOT "AfdOpenPacketXX")
▼
afd!AfdSanCreateHelper ── MmIsThisAnNtAsSystem() gate (Server only)
│
├─► [handle A] SAN listener endpoint
│ NtDeviceIoControlFile(hA, IOCTL 0x12003 AfdBind) ← bind to address
│ NtDeviceIoControlFile(hA, AfdSuperAccept) ← allocates MDL
│ buffer of attacker-chosen TotalLength
│
└─► [handle B] SAN connecting endpoint
NtDeviceIoControlFile(hB, IOCTL 0x12003 AfdBind)
NtDeviceIoControlFile(hB, IOCTL 0x120E2) ──► afd!AfdSanConnectHandler
│ memcpy(listener_MDL + off,
│ user_src, *_Src) ← BUG
▼
pool overflow with attacker size + contents → bugcheck
| Element | Value |
|---|---|
| Device | \Device\Afd\Endpoint via NtCreateFile with EA name AfdSwOpenPacket (SAN) |
| IOCTL — bind | 0x12003 (AfdBind) |
| IOCTL — vulnerable handler | 0x120E2 (AfdSanConnectHandler) |
| Supporting call | AfdSuperAccept on the listener handle (creates the undersized buffer) |
| Privileges | Local authenticated user on Windows Server with SAN/RDMA present |
| Detection surface | NtCreateFile on \Device\Afd\Endpoint with EA AfdSwOpenPacket is extraordinarily rare on real systems — a high-fidelity hunt/telemetry signal on its own |
PoC policy (deliberate)
No new PoC is shipped for this CVE:
- NCC Group’s paper already contains a complete, debugger-verified PoC walkthrough (Python + WinDbg) — duplicating it adds nothing.
- A trigger only fires on Windows Server; it cannot be crash-validated on a Windows 11 client, and unvalidated kernel PoCs are worse than none.
- For blue-team purposes the signal is the attempt, not the crash: SAN
endpoint creation (EA
AfdSwOpenPacket) and IOCTL0x120E2have no legitimate userspace callers on modern systems.
See poc_cve_2026_21241.c for the client-reachable afd.sys bug from the same Patch Tuesday (CVE-2026-21241), which does produce a validatable crash.
Detection engineering
- Sysmon/ETW (process): any process opening
\Device\Afd\Endpointwith an Extended Attribute namedAfdSwOpenPacket(visible via kernel Object/IoCreateFile tracing, e.g. Microsoft-Windows-Kernel-File or a minifilter). On clients this should be near-zero prevalence. - IOCTL auditing: IOCTL
0x120E2to AFD endpoints. Requires driver-level telemetry (ETW kernel IOCTL providers / EDR), but is unambiguous. - YARA (memory/disk): PoCs and tooling embed the EA string
AfdSwOpenPacketand the IOCTL constant0x120E2— both are stable, low-collision indicators. - Crash forensics: bugchecks in
afd!AfdSanConnectHandler/afd!AfdSuperAccepton pre-KB5077181 Server builds.
References
Attack Path
A SAN connect handler copies an attacker-controlled length into a buffer whose size the attacker also chose, overflowing kernel pool
Derived from the patch delta: the checks added by the vendor identify which fields crossed a trust boundary unvalidated. Reachability and privilege are taken from the call chain in the RCA report.
Exploits & PoC
Detection Rules
Acknowledgments
JUSTWIN Team