### #KernelExploitation #PrivilegeEscalation #WindowsVulnerability
Summary: A critical vulnerability in the ksthunk.sys driver of Windows allows local attackers to exploit an integer overflow for privilege escalation, demonstrated at the TyphoonPWN 2024 event. Despite Microsoft’s claims of resolution, the flaw remains exploitable in Windows 11 23H2.
Threat Actor: Advanced Threat Actors | Advanced Threat Actors
Victim: Microsoft Windows | Microsoft Windows
Key Point :
- The vulnerability arises from a lack of integer overflow validation in the CKSAutomationThunk::ThunkEnableEventIrp function.
- Attackers can manipulate memory to create gaps, allowing for arbitrary read and write capabilities.
- Exploitation can lead to token overwrite, granting SYSTEM privileges and full control over the affected machine.
- No CVE number or detailed patch information has been provided, highlighting the ongoing risk.
- This incident underscores the critical need for rigorous validation in kernel-level code to prevent such vulnerabilities.
An independent researcher has uncovered a critical vulnerability in the ksthunk.sys driver, a component of the Windows operating system responsible for facilitating 32-bit to 64-bit process communications. The flaw, which allows a local attacker to exploit an integer overflow for privilege escalation, has been successfully demonstrated and highlighted during the prestigious TyphoonPWN 2024 event, earning second place.
The vulnerability lies in the CKSAutomationThunk::ThunkEnableEventIrp function, which allocates buffers for managing input and output data within the kernel. The issue stems from a lack of integer overflow validation during buffer size alignment calculations. This oversight results in improperly sized allocations that trigger a heap overflow, enabling attackers to overwrite adjacent memory.
The SSD Secure Disclosure technical team explains: “At [1], there is no integer overflow validation while calculating outbuflen + 0x17. Therefore, outlen_adjust can be set to a small value, leading to an undersized allocation and eventual heap overflow during data copying at [4]”
The exploit leverages a series of steps to bypass kernel safeguards and achieve system-level privileges:
- Memory Manipulation: Attackers create gaps between named pipe objects in the kernel’s non-paged pool, making it easier to exploit the overflow.
- Arbitrary Memory Access: By corrupting adjacent named pipes, attackers gain arbitrary read and write capabilities.
- Token Overwrite: Exploiters modify the current process token to gain SYSTEM privileges, allowing complete control over the machine
Microsoft was notified of the vulnerability, but the vendor claimed it was a duplicate issue that had already been resolved. Despite these assurances, the researcher found the flaw to still be exploitable on Windows 11 23H2. No CVE number or detailed patch information has been provided to date.
This vulnerability exemplifies the risks associated with kernel-level flaws. The ability to escalate privileges via a driver underscores the importance of rigorous validation in kernel code. As SSD Secure Disclosure noted, the exploitability of this flaw “is not hard” due to the controllable allocation sizes and data involved, making it a potential tool for advanced threat actors.
To read the technical details and proof-of-concept (PoC) code, please visit the official advisory from SSD Disclosure.