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.systo find out control code forWinHvSetVpStateand 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.exein vulnerable Hyper-V Host(Root Partition) - Boom
CVE-2023-36407.execallsDeviceIoControlthat invokeswinhvr.sys!WinHvSetVpState- In
WinHvSetVpState,memcpycopies 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