CVE-2026-68820: Windows Ancillary Function Driver for WinSock (afd.sys) Use-After-Free Privilege Escalation
Detects exploitation activity targeting CVE-2026-68820, a use-after-free (CWE-416) vulnerability in the Microsoft Windows Ancillary Function Driver for WinSock (afd.sys). This kernel-mode driver flaw allows a local attacker to elevate privileges to SYSTEM by corrupting kernel memory through crafted socket IOCTL sequences. The CVE is on the CISA KEV catalog (active in-the-wild exploitation). Detection focuses on the post-exploitation footprint: unusual child processes or token manipulation originating from low-integrity processes, abnormal afd.sys / socket driver interactions, kernel crash (BSOD 0x139/0xC2) signals from failed exploit attempts, and privilege-escalation behavioral chains, since the memory-corruption primitive itself is not directly logged.
Vulnerability Intelligence
KEV — Known ExploitedAffected Software
- Vendor
- Microsoft
- Product
- Windows Ancillary Function Driver for WinSock
Weakness (CWE)
Timeline
- Disclosed
- August 11, 2026
References & Proof of Concept
- https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2026-68820
- https://www.cisa.gov/news-events/directives/bod-26-04-prioritizing-security-updates-based-risk
- https://www.cisa.gov/news-events/directives/bod-26-04-implementation-guidance-prioritizing-security-updates-based-risk
- https://nvd.nist.gov/vuln/detail/CVE-2026-68820
- https://thehackernews.com/2026/08/microsoft-patches-398-flaws-including.html
CVSS
What is CVE-2026-68820 CVE-2026-68820: Windows Ancillary Function Driver for WinSock (afd.sys) Use-After-Free Privilege Escalation?
CVE-2026-68820: Windows Ancillary Function Driver for WinSock (afd.sys) Use-After-Free Privilege Escalation (CVE-2026-68820) maps to the Privilege Escalation and Execution tactics — the adversary is trying to gain higher-level permissions in MITRE ATT&CK.
This page provides production-ready detection logic for CVE-2026-68820: Windows Ancillary Function Driver for WinSock (afd.sys) Use-After-Free Privilege Escalation, covering the data sources and telemetry it touches: Microsoft Defender for Endpoint, Windows Security Events. The queries below are rated high severity at medium confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.
MITRE ATT&CK
- Tactic
- Privilege Escalation Execution
// CVE-2026-68820 afd.sys UAF LPE — token/integrity escalation and crash signals
let suspiciousParents = dynamic(["cmd.exe","powershell.exe","rundll32.exe","regsvr32.exe","mshta.exe","wscript.exe","cscript.exe","wmiprvse.exe"]);
let escalation = DeviceProcessEvents
| where Timestamp > ago(24h)
| where InitiatingProcessIntegrityLevel in ("Low","Medium")
| where ProcessIntegrityLevel in ("System","High")
| where InitiatingProcessAccountSid != "S-1-5-18"
| where ProcessTokenElevation == "TokenElevationTypeFull" or AccountName in~ ("system","nt authority\\system")
| where InitiatingProcessParentFileName in~ (suspiciousParents) or InitiatingProcessFileName in~ (suspiciousParents)
| project Timestamp, DeviceName, AccountName, ProcessIntegrityLevel, InitiatingProcessIntegrityLevel, FileName, InitiatingProcessFileName, ProcessCommandLine, ReportId;
let crashes = DeviceEvents
| where Timestamp > ago(24h)
| where ActionType in ("BugCheck","KernelCrash")
| where AdditionalFields has_any ("afd.sys","0x139","0xc2","KERNEL_SECURITY_CHECK_FAILURE")
| project Timestamp, DeviceName, ActionType, AdditionalFields, ReportId;
escalation
| union crashes Flags low/medium-integrity processes spawning SYSTEM/High-integrity children (token theft/duplication typical of afd.sys UAF LPE) and afd.sys-related kernel bugchecks from failed exploitation, over Defender for Endpoint telemetry.
Data Sources
Required Tables
False Positives
- Legitimate installers or software-deployment agents (SCCM, Intune) that elevate to SYSTEM via approved parents
- Endpoint management/RMM tools performing privileged automation from medium-integrity contexts
- Genuine hardware or driver faults causing bugchecks unrelated to exploitation
Sigma rule & cross-platform mapping
The detection logic for CVE-2026-68820: Windows Ancillary Function Driver for WinSock (afd.sys) Use-After-Free Privilege Escalation (CVE-2026-68820) above is provided in a vendor-neutral
form so you can deploy it on any SIEM. The same logic is shipped here as native
KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the
following logsource:
logsource:
category: process_creation
product: windows Browse the community-maintained Sigma rules for this technique:
Platform-specific guides for CVE-2026-68820
References (5)
- https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2026-68820
- https://nvd.nist.gov/vuln/detail/CVE-2026-68820
- https://www.cisa.gov/news-events/directives/bod-26-04-prioritizing-security-updates-based-risk
- https://www.cisa.gov/news-events/directives/bod-26-04-implementation-guidance-prioritizing-security-updates-based-risk
- https://thehackernews.com/2026/08/microsoft-patches-398-flaws-including.html
Testing Methodology
Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1Simulate integrity-escalation process spawn (benign)
Expected signal: Process-creation event showing cmd.exe running as NT AUTHORITY\SYSTEM with a non-SYSTEM initiating parent
- Test 2Enumerate afd.sys driver state
Expected signal: PowerShell process access to afd.sys and file write of driver version info
- Test 3Trigger benign kernel bugcheck signal (lab VM only)
Expected signal: System event log EventID 1001 bugcheck 0x139 and a MEMORY.DMP crash file
Response Playbook
Triage
- Confirm the affected host's patch level against the August 2026 Microsoft security update for CVE-2026-68820; determine whether afd.sys is unpatched.
- Review the process ancestry of the escalated process — identify the initiating low/medium-integrity process, its command line, and originating user.
- Check for correlated kernel bugcheck events (0x139 KERNEL_SECURITY_CHECK_FAILURE, 0xC2) referencing afd.sys around the same timeframe, indicating failed exploit attempts.
- Determine whether the escalating account is a standard user (LPE from unprivileged context is the key indicator).
Containment
- Isolate the affected host from the network via EDR containment to prevent lateral movement from a SYSTEM-level foothold.
- Suspend or terminate the identified malicious process tree and disable the compromised local account pending investigation.
- Deploy the Microsoft August 2026 patch for CVE-2026-68820 to the host and to all unpatched Windows systems in scope.
Evidence Collection
- Capture a full memory image and afd.sys driver state before remediation for kernel-level forensic analysis.
- Collect Sysmon/Security process-creation logs, token-manipulation events, and any minidump/MEMORY.DMP crash files referencing afd.sys.
- Preserve EDR process timelines, loaded-driver inventory, and any dropped payloads from the initiating process's working directory.
Escalation Criteria
- ! Escalate to IR lead if SYSTEM-level execution is confirmed on a host with a standard-user initial foothold.
- ! Escalate to threat-intel/hunt team if the exploit chain matches known KEV-listed in-the-wild afd.sys campaigns, or if lateral movement from the compromised host is observed.
Investigation Guide
Forensic Artifacts
- >
MEMORY.DMP / minidump files with bugcheck 0x139 or 0xC2 referencing afd.sys - >
Loaded-driver list and afd.sys version/hash on the affected host - >
Process-creation and token-elevation event records (Sysmon EID 1, Security EID 4688/4673/4672) - >
Exploit binary or script artifacts in the initiating process's directory
Tuning Guidance
Baseline legitimate SYSTEM-elevation parents (SCCM/Intune agents, RMM tooling, approved installers) and exclude their signed executables and known service accounts. Correlate the escalation signal with afd.sys bugcheck events to raise fidelity — an escalation alone is medium confidence, but paired with a same-host afd.sys 0x139 crash it is high confidence. Suppress alerts where the initiating SID is S-1-5-18 (already SYSTEM). Prioritize hosts missing the August 2026 patch.
Hunting Queries
Hunts for standard-user (non-SYSTEM SID) low/medium-integrity processes producing SYSTEM-integrity children across the fleet, revealing candidate afd.sys LPE exploitation.
DeviceProcessEvents | where InitiatingProcessIntegrityLevel in ("Low","Medium") | where ProcessIntegrityLevel == "System" | where InitiatingProcessAccountSid != "S-1-5-18" | summarize count() by DeviceName, InitiatingProcessFileName, FileName, bin(Timestamp, 1h) index=windows (EventCode=4688 OR EventCode=1) | eval integ=lower(coalesce(IntegrityLevel,TokenElevationType)) | search integ="*system*" | stats count by host, ParentProcessName, NewProcessName, User | where count>0 Atomic Red Team Tests
Launches a SYSTEM-integrity process from a medium-integrity shell using PsExec to reproduce the token-escalation telemetry pattern without exploiting the driver.
Command
PsExec64.exe -accepteula -s -i cmd.exe /c "whoami > C:\\Windows\\Temp\\afd_lpe_test.txt" Cleanup
del C:\\Windows\\Temp\\afd_lpe_test.txt Expected Telemetry
Process-creation event showing cmd.exe running as NT AUTHORITY\SYSTEM with a non-SYSTEM initiating parent
Expected Detection
KQL/SPL escalation logic flags the low/medium-to-SYSTEM integrity transition
Queries the loaded afd.sys driver version to identify whether the host is patched against CVE-2026-68820, a reconnaissance behavior sometimes preceding exploitation.
Command
powershell -c "Get-Item C:\\Windows\\System32\\drivers\\afd.sys | Select-Object VersionInfo | Out-File C:\\Windows\\Temp\\afd_ver.txt" Cleanup
del C:\\Windows\\Temp\\afd_ver.txt Expected Telemetry
PowerShell process access to afd.sys and file write of driver version info
Expected Detection
Hunting query surfaces PowerShell inspection of afd.sys driver metadata
Uses NotMyFault in a disposable lab VM to generate a bugcheck, validating that the System event log / crash-dump detection path fires. Not run on production.
Command
notmyfault64.exe /accepteula /crash 0x139 Cleanup
del C:\\Windows\\MEMORY.DMP Expected Telemetry
System event log EventID 1001 bugcheck 0x139 and a MEMORY.DMP crash file
Expected Detection
KQL/SPL bugcheck-correlation branch matches the 0x139 kernel crash signal