漏洞原理
- 當內核將當前令牌對象的 _AUTHZBASEP_SECURITY_ATTRIBUTES_INFORMATION 復制到用戶模式時,錯誤位于函數 AuthzBasepCopyoutInternalSecurityAttributes 內部,該模式的結構如下:
//0x30 bytes (sizeof)
struct _AUTHZBASEP_SECURITY_ATTRIBUTES_INFORMATION
{ULONG SecurityAttributeCount; //0x0struct _LIST_ENTRY SecurityAttributesList; //0x8ULONG WorkingSecurityAttributeCount; //0x18struct _LIST_ENTRY WorkingSecurityAttributesList; //0x20
};
- 執行復制 SecurityAttributesList 時,內核會將 SecurityAttribute 的結構列表直接設置到用戶提供的指針。之后,它調用 RtlCopyUnicodeString 和 AuthzBasepCopyoutInternalSecurityAttributeValues 函數以復制 SecurityAttribute 結構的名稱和值,從而導致此函數中的多個 TOCTOU。
- 在調用 [*] 之前,使用一個簡單的賽車線程來修改屬性名稱的 Buffer 指針,我可以輕松地存檔任意地址寫入,并控制固定值和大小。
影響范圍
windows_10_1507 | 最高(不包括) 10.0.10240.20680 |
---|---|
windows_10_1607 | 最高(不包括) 10.0.14393.7070 |
windows_10_1809 | 最高(不包括) 10.0.17763.5936 |
windows_10_21h2 | 最高(不包括) 10.0.19044.4529 |
windows_10_22h2 | 最高(不包括) 10.0.19045.4529 |
windows_11_21h2 | 最高(不包括) 10.0.22000.3019 |
windows_11_22h2 | 最多(不包括) 10.0.22621.3737 |
windows_11_23h2 | 最高(不包括) 10.0.22631.3737 |
windows_server_2016 | 最高(不包括) 10.0.14393.7070 |
windows_server_2019 | 最高(不包括) 10.0.17763.5936 |
windows_server_2022 | 最高(不包括) 10.0.20348.2522 |
windows_server_2022_23h2 | 最高(不包括) 10.0.25398.950 |
漏洞復現
文件來源:tykawaii98/CVE-2024-30088 (github.com)
用Visual Studio打開,直接生成解決方案
執行效果:
執行效果視頻:
CVE-2024-30088復現視頻
參考鏈接
tykawaii98/CVE-2024-30088 (github.com)
NVD - CVE-2024-30088 (nist.gov)