This is poc for CVE-2023-36407, Hyper-V Elevation of Privilege Vulnerability.
CVE-2023-36407.mp4
- OOB Read/Write from/to Non-paged Pool via
winhvr.sys!WinHvGet/SetVpState
- Environment I used: Windows 11 22H2 x64
- Patch: kb5031354
- control code for
WinHvSetVpState
: 0x221268- if poc does not work, analyze
Vid.sys
to find out control code forWinHvSetVpState
and change it
- if poc does not work, analyze
Just build the project(Release/x64), then CVE-2023-36407.exe
will be generated.
- run
CVE-2023-36407.exe
in vulnerable Hyper-V Host(Root Partition) - Boom
CVE-2023-36407.exe
callsDeviceIoControl
that invokeswinhvr.sys!WinHvSetVpState
- In
WinHvSetVpState
,memcpy
copies data from input buffer(user-controlled) to Non-paged Pool memory- length of data to copy depends on input data's length
- The Non-paged Pool Memory is 0x1000 bytes size and there is no size check for input before calling
memcpy
- BOF in Non-paged Pool
- BSOD occurs because of the corruption