From 41a7e08e43e1a0a277ae922f587dc05986899170 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 22 Oct 2018 19:06:26 +0200 Subject: Core/Bnet: Safeguard auth process against bad external db modifications --- src/server/bnetserver/Server/Session.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/bnetserver/Server/Session.cpp b/src/server/bnetserver/Server/Session.cpp index 55a6827854a..fd74128b458 100644 --- a/src/server/bnetserver/Server/Session.cpp +++ b/src/server/bnetserver/Server/Session.cpp @@ -245,11 +245,17 @@ uint32 Battlenet::Session::HandleLogon(authentication::v1::LogonRequest const* l uint32 Battlenet::Session::HandleVerifyWebCredentials(authentication::v1::VerifyWebCredentialsRequest const* verifyWebCredentialsRequest, std::function& continuation) { - return VerifyWebCredentials(verifyWebCredentialsRequest->web_credentials(), continuation); + if (verifyWebCredentialsRequest->has_web_credentials()) + return VerifyWebCredentials(verifyWebCredentialsRequest->web_credentials(), continuation); + + return ERROR_DENIED; } uint32 Battlenet::Session::VerifyWebCredentials(std::string const& webCredentials, std::function& continuation) { + if (webCredentials.empty()) + return ERROR_DENIED; + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_ACCOUNT_INFO); stmt->setString(0, webCredentials); -- cgit v1.2.3