Windows: use fix for CVE-2019-19501 only if standard Windows Shell is running since we rely on it for the implementation of the fix. If Windows Shell has been modified or is not running, then we can't really protect the user is such non standard environment

This commit is contained in:
Mounir IDRASSI 2020-08-02 18:03:50 +02:00
parent 7702095ed0
commit fb505b71f5
No known key found for this signature in database
GPG Key ID: 02C30AE90FAE4A6F
1 changed files with 4 additions and 2 deletions

View File

@ -14313,10 +14313,12 @@ BOOL IsElevated()
// This function always loads a URL in a non-privileged mode
// If current process has admin privileges, we execute the command "rundll32 url.dll,FileProtocolHandler URL" as non-elevated
// Use this security mechanism only starting from Windows Vista
// Use this security mechanism only starting from Windows Vista and only if we can get the window of the Shell's desktop since
// we rely on the Shell to be already running in a non-privileges mode. If the Shell is not running or if it has been modified,
// then we can't protect the user in such non standard environment
void SafeOpenURL (LPCWSTR szUrl)
{
if (IsOSAtLeast (WIN_VISTA) && IsAdmin () && IsElevated())
if (IsOSAtLeast (WIN_VISTA) && IsAdmin () && IsElevated() && GetShellWindow())
{
WCHAR szRunDllPath[TC_MAX_PATH];
WCHAR szUrlDllPath[TC_MAX_PATH];