CVE-2025-21304 Overview
CVE-2025-21304 is an elevation of privilege vulnerability in the Microsoft Desktop Window Manager (DWM) Core Library. The flaw stems from a use-after-free condition [CWE-416] in the DWM component that renders composited desktop graphics on Windows systems. A local, authenticated attacker who successfully exploits this weakness can elevate privileges to SYSTEM, giving them full control over the affected host.
The vulnerability affects multiple supported versions of Windows 10 and Windows Server, making it relevant across a broad enterprise footprint. Microsoft addressed the issue in the January 2025 Patch Tuesday release.
Critical Impact
Local attackers with low-privileged access can achieve SYSTEM-level code execution, resulting in full confidentiality, integrity, and availability compromise of the host.
Affected Products
- Microsoft Windows 10 (versions 1607, 1809, 21H2, 22H2)
- Microsoft Windows Server 2016
- Microsoft Windows Server 2019
Discovery Timeline
- 2025-01-14 - Microsoft releases security update for CVE-2025-21304
- 2025-01-14 - CVE-2025-21304 published to NVD
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2025-21304
Vulnerability Analysis
The Desktop Window Manager (DWM) is a Windows service that composites application windows into the final desktop image using Direct3D. Because DWM runs with elevated privileges and processes graphics objects supplied by user-mode processes, memory-safety issues in its core library provide a direct path to local privilege escalation.
CVE-2025-21304 is classified as a use-after-free vulnerability [CWE-416]. This class of flaw occurs when a program continues to reference a heap object after the underlying memory has been freed. An attacker who can influence the allocation and lifetime of DWM objects can reclaim the freed memory with controlled data and cause the reused pointer to reference attacker-influenced content.
Exploitation requires the attacker to already hold a low-privileged account on the target host, but does not require user interaction. Successful exploitation yields code execution in the context of the DWM process, which runs with SYSTEM-level privileges.
Root Cause
The root cause is the DWM Core Library failing to correctly manage the lifetime of an internal graphics object. A code path releases the object while another reference remains in use, and that stale reference is later dereferenced. When the freed slot is reallocated with attacker-controlled data, the subsequent use dereferences a pointer or virtual function table under attacker control.
Attack Vector
The attack vector is local. An attacker must execute code on the target host as an authenticated user, for example through a phishing payload, a compromised low-privilege service account, or an initial-access foothold obtained from another vulnerability. The attacker then interacts with DWM through the standard graphics APIs to trigger the vulnerable allocation and free sequence, groom the heap, and invoke the dangling reference. No verified public proof-of-concept code is available at this time. Refer to the Microsoft Security Update Guide entry for CVE-2025-21304 for vendor technical details.
Detection Methods for CVE-2025-21304
Indicators of Compromise
- Unexpected crashes or restarts of dwm.exe on affected systems, particularly when correlated with recent user logon activity or newly executed processes.
- Child processes spawned from dwm.exe, which is not typical behavior for the Desktop Window Manager.
- New services, scheduled tasks, or accounts created shortly after suspicious DWM activity, indicating post-exploitation persistence.
Detection Strategies
- Monitor Windows Error Reporting (WER) and application crash telemetry for faults in dwmcore.dll or dwm.exe with access-violation exceptions.
- Alert on process-creation events where the parent image is dwm.exe, since this pattern is uncommon under normal desktop compositing workloads.
- Correlate low-privileged user sessions with subsequent SYSTEM-context process launches on the same host within a short time window.
Monitoring Recommendations
- Enable and forward Sysmon Event IDs 1 (process creation), 7 (image loaded), and 10 (process access) for endpoints running affected Windows builds.
- Track patch state of Windows 10 and Windows Server 2016 and 2019 hosts using authenticated vulnerability scans to confirm the January 2025 cumulative update is installed.
- Review endpoint EDR telemetry for heap-spray or graphics-object-manipulation patterns preceding DWM crashes.
How to Mitigate CVE-2025-21304
Immediate Actions Required
- Apply the January 2025 Windows security updates from Microsoft to all affected Windows 10 and Windows Server 2016/2019 systems.
- Prioritize patching on multi-user hosts such as Remote Desktop Services servers and virtual desktop infrastructure, where local privilege escalation has the highest blast radius.
- Audit local accounts and restrict interactive logon rights to reduce the population of users who could stage a local attack.
Patch Information
Microsoft published the fix in the January 14, 2025 cumulative security updates for the affected Windows versions. Full patch details and update package identifiers are available in the Microsoft Security Update Guide for CVE-2025-21304. Installation of the corresponding monthly rollup or security-only update remediates the use-after-free condition in the DWM Core Library.
Workarounds
- No official vendor workaround is available; installing the security update is the supported remediation path.
- Reduce exposure by enforcing least-privilege on user accounts and blocking execution of unsigned or untrusted binaries via Windows Defender Application Control or AppLocker.
- Constrain lateral movement by segmenting management networks and requiring multi-factor authentication for any interactive access to affected hosts.
# Verify the January 2025 cumulative update is installed on an affected host
wmic qfe list brief /format:table
# PowerShell equivalent - list installed hotfixes sorted by install date
Get-HotFix | Sort-Object -Property InstalledOn -Descending | Select-Object -First 10
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

