A use after free vulnerability exists in the `NtGdiResetDC()` function of Win32k which can be leveraged by an attacker to escalate privileges to those of `NT AUTHORITY\SYSTEM`. The flaw exists due to the fact that this function calls `hdcOpenDCW()`, which performs a user mode callback. During this callback, attackers can call the `NtGdiResetDC()` function again with the same handle as before, which will result in the PDC object that is referenced by this handle being freed. The attacker can then replace the memory referenced by the handle with their own object, before passing execution back to the original `NtGdiResetDC()` call, which will now use the attacker's object without appropriate validation. This can then allow the attacker to manipulate the state of the kernel and, together with additional exploitation techniques, gain code execution as NT AUTHORITY\SYSTEM. This module has been tested to work on Windows 10 x64 RS1 (build 14393) and RS5 (build 17763), however previous versions of Windows 10 will likely also work.
Exploit database
Vulnerability
CVE-2021-40449
Win32k Elevation of Privilege Vulnerability
Vulnerability details
- Score
- 7.8
- Severity
- high
CVSS 3.1 · microsoft
Vector string
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H/E:F/RL:O/RC:CDescription
Win32k Elevation of Privilege Vulnerability
CVE ProgramExploit source choices
10 sourcesWin32k NtGdiResetDC Use After Free Local Privilege Elevation
2021-10-12cve_2021_40449.rb
ascotbe/kernelhub
:palm_tree:Linux、macOS、Windows Kernel privilege escalation vulnerability collection, with compilation environment, demo GIF map, vulnerability details, executable file (提权漏洞合集)
2020-08-091,837 files · 3,202 stars
al1ex/windowselevation
Windows Elevation(持续更新)
2021-03-291,045 files · 665 stars
ly4k/callbackhell
Exploit for CVE-2021-40449 - Win32k Elevation of Privilege Vulnerability (LPE)
2021-10-168 files · 484 stars
kalendsi/cve-2021-40449-exploit
windows 10 14393 LPE
2021-10-208 files · 108 stars
samueltulach/voidmap
Using CVE-2021-40449 to manual map kernel mode driver
2022-03-0416 files · 105 stars
kristal-g/cve-2021-40449_poc
Exploit for CVE-2021-40449
2021-11-0734 files · 55 stars
hakivvi/cve-2021-40449
LPE exploit for a UAF in Windows (CVE-2021-40449).
2021-10-257 files · 48 stars
bl0odz/cve-2021-40449-ntgdiresetdc-uaf
bl0odz/cve-2021-40449-ntgdiresetdc-uaf source repository
2022-02-206 files · 13 stars
cppxl/cve-2021-40449-poc
cppxl/cve-2021-40449-poc source repository
2021-11-121 file · 1 stars