CVE DatabaseCVE-2025-21418
한국어 권고문 →
CVE-2025-214187.8/HIGHCISA KEVCWE-122

Windows Ancillary Function Driver (afd.sys) Elevation of Privilege Vulnerability (CVE-2025-21418) Technical Analysis and Mitigation Guide

⚡ Jump to Patch
Affected Vendors
microsoft
Affected Components
windows, windows_server
Published Date
2025-02-11
CVSS v3.1
7.8
HIGH
EPSS (30d)
2.1%
FIRST.org
CISA KEV
Exploited

Executive & SecOps Summary

SECOPS ASSESSMENT
Affected Scope

All supported versions of Windows 10, 11, and Windows Server utilizing the WinSock Ancillary Function Driver (afd.sys)

Impact

Local attackers can trigger kernel memory corruption (Heap-based Buffer Overflow) to execute arbitrary code with SYSTEM privileges

Mitigation

Immediately apply the Microsoft February 2025 Patch Tuesday cumulative updates and restrict unauthorized local execution privileges

Affected Products & Version Scope

Windows 10, Windows 11, and Windows Server 2016, 2019, 2022, 2025 running unpatched versions of afd.sys

Remediation & Live Workaround Commands

PATCH & WORKAROUND

1. Official Patch & Version Upgrade Commands

The primary remediation is to apply the latest cumulative security updates provided by Microsoft. You can force Windows Update using the following PowerShell commands:

powershell
# Install Windows Update module and apply all pending security patches
Install-Module PSWindowsUpdate -Force -SkipPublisherCheck
Get-WindowsUpdate -AcceptAll -Install -AutoReboot

2. Temporary Workaround & Hardening Configuration

If immediate patching is not feasible, restrict local execution capabilities. Implement AppLocker or Software Restriction Policies to prevent unauthorized binaries from executing, and limit local logon privileges to critical servers.

powershell
# Verify and restrict SeDebugPrivilege to prevent unauthorized process memory access
# (Navigate to secpol.msc -> Local Policies -> User Rights Assignment -> Debug programs)
whoami /priv | Select-String 'SeDebugPrivilege'

3. Log Audit & IoC Verification Commands

Verify the file version of afd.sys to ensure the patch has been successfully applied, and audit security logs for privilege escalation indicators.

powershell
# Check the file version of afd.sys to verify patch status
Get-Item -Path 'C:\Windows\System32\drivers\afd.sys' | Select-Object -Property Name, VersionInfo

# Audit Security Event Logs for suspicious SYSTEM logons (Event ID 4624)
Get-WinEvent -FilterHashtable @{LogName='Security'; ID=4624} -MaxEvents 50 | Where-Object {$_.Message -match 'SYSTEM'}
Interactive SecOps Remediation Checklist
0/4 (0%)
Recommended Security Control & Mitigation Partner
SentinelOne Singularity AI EDR
Due to active in-the-wild exploitation (CISA KEV), immediate deployment of the February 2025 Windows Security Updates is highly recommended.

Block Kernel Privilege Escalation & Ransomware Payloads Before You Can Reboot

Protect unpatched Windows, Linux, and macOS workloads against in-memory exploitation and lateral movement with autonomous EDR.

100% MITRE ATT&CK Detection · 1-Click Rollback

Technical Root Cause & Exploitation Mechanics

1. Vulnerability Overview & Root Cause

This vulnerability (CVE-2025-21418) is a heap-based buffer overflow (CWE-122) residing in afd.sys (Ancillary Function Driver), the core kernel-mode driver responsible for handling Windows Sockets (WinSock). The root cause lies in the insufficient validation of input buffer sizes passed from user-mode applications via specific Input/Output Control (IOCTL) requests. This lack of validation allows an attacker to overwrite adjacent memory allocations within the Kernel Pool.

2. Exploitation Mechanics & Attack Scenario

To exploit this vulnerability, an attacker must first establish local execution capabilities on the target system with low-privileged access. The attacker then crafts a malicious payload and transmits a specially designed IOCTL request to the \Device\Afd device object. By leveraging 'Pool Feng Shui' techniques to groom the kernel pool layout, the attacker corrupts adjacent kernel structures (such as process tokens or object headers). This corruption is manipulated to replace the current process's security token with the NT AUTHORITY\SYSTEM token, achieving full local privilege escalation (LPE).

3. Infrastructure & Business Impact

As CVE-2025-21418 is actively exploited in the wild and listed in CISA's Known Exploited Vulnerabilities (KEV) catalog, it poses an immediate threat to enterprise environments. If successfully exploited, it allows threat actors who have gained initial entry to elevate their privileges to SYSTEM, bypass endpoint security controls, perform lateral movement, and deploy ransomware or establish persistent backdoors across the infrastructure.

Official Vendor Advisories & References

Frequently Asked SecOps Questions (CVE-2025-21418)

FAQ

Q1. How critical is CVE-2025-21418 and is it actively exploited in the wild?

CVE-2025-21418 is rated CVSS 7.8 (HIGH) with a 30-day EPSS exploitation probability of 2.1%. It is listed in the CISA Known Exploited Vulnerabilities (KEV) catalog, requiring immediate emergency remediation.

Q2. Which vendors and products are affected by CVE-2025-21418?

Primary impacted vendors include microsoft across windows, windows_server. Scope summary: Windows 10, Windows 11, and Windows Server 2016, 2019, 2022, 2025 running unpatched versions of afd.sys

Q3. What temporary mitigations or workarounds exist for CVE-2025-21418 before patching?

[Mitigation] Immediately apply the Microsoft February 2025 Patch Tuesday cumulative updates and restrict unauthorized local execution privileges Follow the CLI remediation commands and interactive SecOps checklist on this page to restrict exposure prior to your maintenance window.

SECOPS WORKBENCH INTEGRATION

Generate an Internal Engineering Notice or CISO Report for CVE-2025-21418

Instantly format this advisory into an executive CISO summary or engineering patch ticket.

Generate Report →

🔗 Related Advisories in Similar Stack (microsoft)

View Category →
SecOps Advisory Dispatch & RSS Feed

Subscribe to Daily Vulnerability Briefings & KEV Alerts

Concise morning briefings for SecOps, DevSecOps, and SRE teams covering newly exploited CVEs and mitigation priorities.

Slack / Teams / RSS Feed:
PatchKO
CVE-2025-21418 Windows Ancillary Function Driver (afd.sys) Elevation of Privilege Vulnerability (CVE-2025-21418) Technical Analysis and Mitigation Guide (CVSS 7.8) - Patch & Workaround | CVE Pulse