1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 02:58:02 -06:00

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

View File

@@ -14313,10 +14313,12 @@ BOOL IsElevated()
// This function always loads a URL in a non-privileged mode // 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 // 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) void SafeOpenURL (LPCWSTR szUrl)
{ {
if (IsOSAtLeast (WIN_VISTA) && IsAdmin () && IsElevated()) if (IsOSAtLeast (WIN_VISTA) && IsAdmin () && IsElevated() && GetShellWindow())
{ {
WCHAR szRunDllPath[TC_MAX_PATH]; WCHAR szRunDllPath[TC_MAX_PATH];
WCHAR szUrlDllPath[TC_MAX_PATH]; WCHAR szUrlDllPath[TC_MAX_PATH];