[하루한줄] CVE-2020-17057 : Microsoft Windows Uninitialized Pointer EoP

URL

CVE-2020-17057 Microsoft Windows DirectComposition Uninitialized Pointer Privilege Escalation Vulnerability

Target

Microsoft Windows

Explain

Microsoft가 2년 전에 발견한 취약점을 패치함으로써 취약점의 세부 정보가 공개되었습니다. 해당 취약점은 Windows 커널 모드의 그래픽 구성 요소인 DirectComposition 에서 발생하는 초기화되지 않은 pool 메모리 참조입니다.

DirectComposition 은 리소스 생성/해제/속성 설정 등의 작업을 수행하는 NtDCompositionProcessChannelBatchBuffer syscall을 사용합니다.

DirectComposition::CInteractionTrackerMarshaler::SetBufferProperty 에서는 한 쌍의 리소스 객체를 처리합니다. 첫 번째 리소스 객체가 초기화되고 두 번째 리소스 객체 타입이 0x57이 아니라면 두 번째 리소스 객체가 초기화되지 않습니다.

이후 DirectComposition::CInteractionTrackerMarshaler::ReleaseManipulationReferences 에서 할당된 한 쌍의 리소스 객체를 해제하기 위해 별도의 검증 없이DirectComposition::CApplicationChannel::ReleaseResource 을 호출하는데, 이때 초기화되지 않은 두 번째 리소스 객체 포인터를 참조하게 되어 커널 크래시가 발생합니다.

이를 악용하면 리소스 객체 포인터 테이블을 spray 해 임의 객체를 해제하는 등 해제된 메모리를 조작할 수 있습니다.