CVE-2022-24750 (published 2022-03-10T21:15Z)

UltraVNC is a free and open source remote pc access software. A vulnerability has been found in versions prior to 1.3.8.0 in which the DSM plugin module, which allows a local authenticated user to achieve local privilege escalation (LPE) on a vulnerable system. The vulnerability has been fixed to allow loading of plugins from the installed directory. Affected users should upgrade their UltraVNC to 1.3.8.1. Users unable to upgrade should not install and run UltraVNC server as a service. It is advisable to create a scheduled task on a low privilege account to launch WinVNC.exe instead. There are no known workarounds if winvnc needs to be started as a service.

Severity: HIGH
CVSS v2 base score: 7.2 (AV:L/AC:L/Au:N/C:C/I:C/A:C)
CVSS v3 base score: 7.8, HIGH (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H)

Weakness information:
cwe_id: CWE-269
cwe_name: Improper Privilege Management
description: The product does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor.
extended_description: 
            
         
         

Fix information:
repo_url: https://github.com/ultravnc/UltraVNC
commit_details: repo_url: https://github.com/ultravnc/UltraVNC
author: ultravnc
author_date: 2022-03-06 22:12:36+01:00
msg: security fix
repository: repo_url: https://github.com/ultravnc/UltraVNC
repo_name: ultravnc/UltraVNC
description: UltraVNC Server, UltraVNC Viewer and UltraVNC SC | Official repository: https://github.com/ultravnc/UltraVNC
repo_language: C++
owner: ultravnc
file_changes: filename: vncproperties.cpp
change_type: ModificationType.MODIFY
diff: @@ -43,6 +43,7 @@
 #include "vncConnDialog.h"
 
 #include "Localization.h" // ACT : Add localization on messages
+#include "shlwapi.h"
 
 //extern HINSTANCE g_hInst;
 
@@ -719,7 +720,7 @@ vncProperties::DialogProc(HWND hwnd,
 
 			// Modif sf@2002
 			SendMessage(GetDlgItem(hwnd, IDC_PLUGIN_CHECK), BM_SETCHECK, _this->m_server->IsDSMPluginEnabled(), 0);
-			EnableWindow(GetDlgItem(hwnd, IDC_PLUGIN_BUTTON), _this->m_server->IsDSMPluginEnabled());
+			EnableWindow(GetDlgItem(hwnd, IDC_PLUGIN_BUTTON),  (_this->m_server->AuthClientCount() == 0 ? _this->m_server->IsDSMPluginEnabled(): false));
 
 			// Query window option - Taken from TightVNC advanced properties 
 			BOOL queryEnabled = (_this->m_server->QuerySetting() == 4);
@@ -1285,8 +1286,9 @@ vncProperties::DialogProc(HWND hwnd,
 		// sf@2002 - DSM Plugin
 		case IDC_PLUGIN_CHECK:
 			{
-				EnableWindow(GetDlgItem(hwnd, IDC_PLUGIN_BUTTON),
-					SendMessage(GetDlgItem(hwnd, IDC_PLUGIN_CHECK), BM_GETCHECK, 0, 0) == BST_CHECKED);
+				EnableWindow(GetDlgItem(hwnd, IDC_PLUGIN_BUTTON), _this->m_server->AuthClientCount() == 0 
+						? SendMessage(GetDlgItem(hwnd, IDC_PLUGIN_CHECK), BM_GETCHECK, 0, 0) == BST_CHECKED 
+						: BST_UNCHECKED);
 			}
 			return TRUE;
 			// Marscha@2004 - authSSP: moved MSLogon checkbox back to admin props page
@@ -1368,6 +1370,8 @@ vncProperties::DialogProc(HWND hwnd,
 				{
 					TCHAR szPlugin[MAX_PATH];
 					GetDlgItemText(hwnd, IDC_PLUGINS_COMBO, szPlugin, MAX_PATH);
+					PathStripPathA(szPlugin);
+
 					if (!_this->m_server->GetDSMPluginPointer()->IsLoaded())
 						_this->m_server->GetDSMPluginPointer()->LoadPlugin(szPlugin, false);
 					else

programming_language: C++