In my previous blog post I mentioned the GetProcessHandleFromHwnd API. This was an API I didn’t know existed until I found a publicly disclosed UAC bypass using the Quick Assist UI Access application. This API looked interesting so I though

The GetProcessHandleFromHwnd API, a Windows function that allows an application to obtain a handle to the process owning a specific window handle (HWND), has undergone significant changes since its introduction, with its original documentation containing several inaccuracies. Initially believed to be a convenience function relying on window hooks, its implementation and security properties have evolved, particularly with its move into the Windows kernel.
The API's documentation states that callers with UIAccess can use window hooks to inject code into a target process and retrieve a handle. It also claims the function only succeeds when caller and target processes share the same user, and that it's a convenience function for obtaining a process handle from an HWND. However, research indicates these statements are not entirely accurate. Firstly, using window hooks requires the caller to have an integrity level equal to or greater than the target process, not just UIAccess. Secondly, the current implementation in Windows 11 is a kernel function that opens the process directly, bypassing the described hook mechanism. Lastly, bypasses utilizing this API have been demonstrated even when Administrator Protection is active, suggesting processes can be running under different user contexts.
The earliest version of GetProcessHandleFromHwnd was found in Vista, implemented within the oleacc.dll library. While documentation suggested XP support, the API was not present in XP SP3 builds. This initial version attempted to open the target process directly, but if that failed, it resorted to using a window hook. This hook mechanism involved loading oleacc.dll into the target process via SetWindowsHookEx and waiting for a custom window message, WM_OLEACC_HOOK. Upon receiving this message, the hook function would create a named shared memory section. It would then open a handle to the caller's process with limited rights, duplicate the current process's handle to the caller, and finally write the duplicated handle value into the shared memory. This allowed the caller to retrieve the handle. This implementation could fail if processes were running under different users, as the target process might not be able to open the caller for `PROCESS_DUP_HANDLE` access, and the shared memory's DACL would also prevent access by a different user. However, if the target process was running as an administrator, it would likely have the necessary access.
A minor modification occurred in Windows 7, where the hook function was moved from oleacc.dll to a separate binary, oleacchooks.dll. This DLL, exposed as ordinal 1, still exists on Windows 11, even though the API itself has since been integrated into the kernel.
The API's second major version emerged in Windows 10, version 1803, when it was moved into the Win32k kernel as NtUserGetProcessHandle, residing in win32kfull.sys. This kernel version differs significantly. It accepts an `ACCESS_MASK` parameter, allowing the caller to specify the desired access rights for the process handle, unlike the fixed access in the older version. The function validates the window handle, retrieves the associated thread's THREADINFO structure, and verifies that both the caller and the target window are on the same desktop.
Crucially, the kernel version includes checks for UIPI (User Interface Privilege Isolation) enforcement. If UIPI is enabled, it calls a `CheckAccess` method to determine if the caller has permission to access the target process. This check considers the integrity levels and AppContainer status of both processes. If the caller's integrity level is higher than the target's, access is granted. If it's lower, access is denied. If integrity levels are the same, it checks if both processes are within the same AppContainer sandbox. If UIPI is not enforced, it compares authentication IDs, requiring the caller to be in the same logon session. Finally, access is denied if the target thread belongs to a system process or CSRSS. If all checks pass, the function looks up the target process's KPROCESS pointer and uses ObOpenObjectByPointer to obtain a handle with the requested access rights.

JetBrains is urging Cadence users to revoke and rotate all credentials following a security incident last month in which unidentified threat actors exploited a recently disclosed critical vulnerability in TeamCity to breach its own environment. "Cadence users should immediately revoke or rotate all credentials and secrets that may have been used to run their Cadence executions," JetBrains said.
A weakness has been identified in Tenda CP3 27.5.57.101. This issue affects some unknown processing of the file Net/NetCheckPing.cpp. This manipulation of the argument interface_name/host causes os command injection. The attack can be initiated remotely.
A security flaw has been discovered in Tenda CP3 27.5.57.101. This vulnerability affects the function SystemAsh of the file Apis/system.c of the component Kylin. The manipulation of the argument AlarmVoiceURL results in os command injection. It is possible to launch the attack remotely.

OpenAI has announced a $1 billion commitment to provide subsidized access to its Daybreak AI cybersecurity tools for under-resourced critical infrastructure defenders. The initiative, named Daybreak for Frontline Defenders, will offer AI models, training, and technical support over the next six months, prioritizing water and wastewater utilities, electric grid operators, and local government entities. This move aims to equip organizations with limited budgets and staff against increasingly sophisticated cyber threats.

Attackers are exploiting a new unpatched vulnerability in Magento Open Source and Adobe Commerce that lets them run malicious code on an online store's server without logging in, Dutch e-commerce security company Sansec said in an advisory published on September 5. Sansec, which discovered the flaw and named it StyleSmuggler, said attacks started on September 4. "Sansec is publishing early
In BPF instructions that load/store a value from/to a scratch memory register the register index is an unsigned 32-bit integer and must not exceed 15, but libpcap BPF interpreter does not validate the value. In particular uncommon use cases a crafted filter program can cause the interpreter to try reading and writing the OS process memory in the 16GiB starting at the current stack frame on 64-bit architectures and in the entire address space on 32-bit architectures.