mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2025-07-06 07:44:57 +03:00
Fix Vulnerability: CVE-2023-27516 TALOS-2023-1754 and CVE-2023-32634 TALOS-2023-1755
SoftEther VPN CiRpcAccepted () authentication bypass vulnerability and SoftEther VPN CiRpcServerThread () MitM authentication bypass vulnerability https://www.softether.org/9-about/News/904-SEVPN202301 https://jvn.jp/en/jp/JVN64316789/
This commit is contained in:
committed by
Davide Beatrici
parent
f4bbe476be
commit
3b932f5fee
@ -5155,6 +5155,22 @@ void CiRpcAccepted(CLIENT *c, SOCK *s)
|
||||
retcode = 0;
|
||||
}
|
||||
|
||||
if (retcode == 0)
|
||||
{
|
||||
if (IsLocalHostIP(&s->RemoteIP) == false)
|
||||
{
|
||||
// If the RPC client is from network check whether the password is empty
|
||||
UCHAR empty_password_hash[20];
|
||||
Sha0(empty_password_hash, "", 0);
|
||||
if (Cmp(empty_password_hash, hashed_password, SHA1_SIZE) == 0 ||
|
||||
IsZero(hashed_password, SHA1_SIZE))
|
||||
{
|
||||
// Regard it as incorrect password
|
||||
retcode = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Lock(c->lock);
|
||||
{
|
||||
if (c->Config.AllowRemoteConfig == false)
|
||||
@ -5258,14 +5274,21 @@ void CiRpcServerThread(THREAD *thread, void *param)
|
||||
|
||||
// Open the port
|
||||
listener = NULL;
|
||||
for (i = CLIENT_CONFIG_PORT;i < (CLIENT_CONFIG_PORT + 5);i++)
|
||||
if (c->Config.DisableRpcDynamicPortListener == false)
|
||||
{
|
||||
listener = Listen(i);
|
||||
if (listener != NULL)
|
||||
for (i = CLIENT_CONFIG_PORT;i < (CLIENT_CONFIG_PORT + 5);i++)
|
||||
{
|
||||
break;
|
||||
listener = ListenEx(i, !c->Config.AllowRemoteConfig);
|
||||
if (listener != NULL)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
listener = ListenEx(CLIENT_CONFIG_PORT, !c->Config.AllowRemoteConfig);
|
||||
}
|
||||
|
||||
if (listener == NULL)
|
||||
{
|
||||
@ -9028,6 +9051,12 @@ void CiInitConfiguration(CLIENT *c)
|
||||
c->Config.UseKeepConnect = false; // Don't use the connection maintenance function by default in the Client
|
||||
// Eraser
|
||||
c->Eraser = NewEraser(c->Logger, 0);
|
||||
|
||||
#ifdef OS_WIN32
|
||||
c->Config.DisableRpcDynamicPortListener = false;
|
||||
#else // OS_WIN32
|
||||
c->Config.DisableRpcDynamicPortListener = true;
|
||||
#endif // OS_WIN32
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -9174,6 +9203,19 @@ void CiLoadClientConfig(CLIENT_CONFIG *c, FOLDER *f)
|
||||
c->AllowRemoteConfig = CfgGetBool(f, "AllowRemoteConfig");
|
||||
c->KeepConnectInterval = MAKESURE(CfgGetInt(f, "KeepConnectInterval"), KEEP_INTERVAL_MIN, KEEP_INTERVAL_MAX);
|
||||
c->NoChangeWcmNetworkSettingOnWindows8 = CfgGetBool(f, "NoChangeWcmNetworkSettingOnWindows8");
|
||||
|
||||
if (CfgIsItem(f, "DisableRpcDynamicPortListener"))
|
||||
{
|
||||
c->DisableRpcDynamicPortListener = CfgGetBool(f, "DisableRpcDynamicPortListener");
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef OS_WIN32
|
||||
c->DisableRpcDynamicPortListener = false;
|
||||
#else // OS_WIN32
|
||||
c->DisableRpcDynamicPortListener = true;
|
||||
#endif // OS_WIN32
|
||||
}
|
||||
}
|
||||
|
||||
// Read the client authentication data
|
||||
@ -9748,6 +9790,7 @@ void CiWriteClientConfig(FOLDER *cc, CLIENT_CONFIG *config)
|
||||
CfgAddBool(cc, "AllowRemoteConfig", config->AllowRemoteConfig);
|
||||
CfgAddInt(cc, "KeepConnectInterval", config->KeepConnectInterval);
|
||||
CfgAddBool(cc, "NoChangeWcmNetworkSettingOnWindows8", config->NoChangeWcmNetworkSettingOnWindows8);
|
||||
CfgAddBool(cc, "DisableRpcDynamicPortListener", config->DisableRpcDynamicPortListener);
|
||||
}
|
||||
|
||||
// Write the client authentication data
|
||||
|
@ -87,6 +87,7 @@ struct CLIENT_CONFIG
|
||||
UINT KeepConnectProtocol; // Protocol
|
||||
UINT KeepConnectInterval; // Interval
|
||||
bool NoChangeWcmNetworkSettingOnWindows8; // Don't change the WCM network settings on Windows 8
|
||||
bool DisableRpcDynamicPortListener;
|
||||
};
|
||||
|
||||
// Version acquisition
|
||||
|
Reference in New Issue
Block a user