While using Nessus for routine auditing, a customer discovered a case where their Nessus configuration caused a credentialed scan to crash a Windows 10 host. When Nessus performed a check that queries for a blank value in a user right, Windows would crash. During evaluation of the issue, Tenable engineers determined that this was not merely a one-off case that led to a local denial of service, rather it was a more severe vulnerability that can allow a remote unauthenticated attacker to crash the host, depending on the configuration.
The issue is in the LsapLookupSids()
function of the lsasrv.dll
library. Inside this function, LocalAlloc() is called to allocate a block of memory based on the number of SIDs passed to the function. When zero SIDs are passed to the function, LocalAlloc()
tries to allocate zero bytes, but it still returns a non-null buffer pointer, and the memory pointed by that pointer can contain non-zero bytes. Later, when the buffer is freed with LocalFree()
, dynamically allocated data structures associated with it are also freed. Below shows the function checks if a pointer at offset 4 of the buffer is null and attempts to free it if it is non-null. Because the pointer at offset 4 is non-null, pointing to a location that is not allocated by LocalAlloc()
, it passes the NULL pointer check, and the function tries to free both the buffer and the buffer at offset 4. Because LocalFree()
is passed with an invalid memory block (i.e., 0x80000), it eventually results in a null pointer dereference.
This can be reached remotely, and a reliable remote denial of service condition exists. Depending on the configuration of the Windows 10 host, this will either require authentication or allow an unauthenticated attacker to carry out the attack. If the following configuration options are set, an attack does not require authentication:
- Network access: Named pipes that can be accessed anonymously -> lsarpc
- Network access: Restrict anonymous access to Named Pipes and Shares -> Disabled
- HKLM\SYSTEM\CurrentControlSet\Control\Lsa\TurnOffAnonymousBlock (DWORD) -> 1
- Network Access: Allow anonymous SID/Name translation -> Enabled
If any of these configuration options are not present, then the attack would require authentication.
Tenable only performed a quick evaluation of this issue before reporting it to Microsoft. Once reported, the MSRC team did more digging and determined that in addition to a remote DoS, it could lead to local privilege escalation as well, as the issue "appears to be calling free on invalid memory hence resulting in local EOP".