KB5058383: Windows Server 2016 Security Update (May 2025)
A local attacker can escalate to SYSTEM by exploiting a use-after-free in the Windows WinSock kernel driver — confirmed exploited in the wild as a zero-day.
An attacker with basic user privileges on the host — no admin rights needed — can issue crafted socket IOCTLs to trigger the use-after-free and escalate to SYSTEM. Because AFD is reachable from any unprivileged process, this is a reliable local-to-SYSTEM primitive that attackers chain after initial access (phishing, malware) to deploy ransomware or harvest credentials.
AFD.sys (the Ancillary Function Driver for WinSock) is the kernel-mode driver that backs Windows socket operations — it runs on every Windows host and is reachable from any process that uses sockets. A use-after-free flaw is triggered via crafted IOCTL calls or malformed WinSock interactions: a race condition in how AFD handles socket-descriptor metadata leaves stale pointers to reallocated buffers, which an attacker manipulates to corrupt kernel memory.
Probably yes if any of these apply:
Affected OS versions
Microsoft observed targeted attacks in healthcare and government in 2025 where the attacker, having gained a basic user foothold through phishing, used CVE-2025-32709 to escalate to SYSTEM via afd.sys, then deployed credential harvesters and ransomware. WinSock-driver EoPs are prized by intrusion operators because every process can reach the socket layer — the escalation works from the most constrained foothold.
Manual download
For air-gapped servers or out-of-band deployment. Microsoft Update Catalog returns every OS-version variant of this update.
↗ Microsoft Update CatalogKB5058383Manual remediation steps
Prerequisites
Estimated time
20–40 minutes per server (download + install + reboot)
Reboot required
Yes — install the cumulative update and reboot the server before the fix is active.
Steps
1. Confirm the server is missing the patch
Get-HotFix -Id KB5058383 -ErrorAction SilentlyContinue
2. Install the update — pick one channel
Windows Update / WSUS (preferred):
UsoClient ScanInstallWait
Manual download (offline / air-gapped):
3. Reboot
Restart-Computer -Force
Verification
Get-HotFix -Id KB5058383
[System.Environment]::OSVersion.Version
Rollback
wusa.exe /uninstall /kb:5058383 /quiet /norestart
Notes
No tested PowerShell script for this entry yet. We’re prioritising automation based on user demand.