From 738b70e57aab6fdd581b9249e72959727631a6db Mon Sep 17 00:00:00 2001 From: JustArchi Date: Mon, 11 Nov 2019 22:32:01 +0100 Subject: [PATCH] Do not record failed attempts on empty passwords --- .../IPC/Integration/ApiAuthenticationMiddleware.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ArchiSteamFarm/IPC/Integration/ApiAuthenticationMiddleware.cs b/ArchiSteamFarm/IPC/Integration/ApiAuthenticationMiddleware.cs index 54d6366cb..d71e3e00c 100644 --- a/ArchiSteamFarm/IPC/Integration/ApiAuthenticationMiddleware.cs +++ b/ArchiSteamFarm/IPC/Integration/ApiAuthenticationMiddleware.cs @@ -102,7 +102,13 @@ namespace ArchiSteamFarm.IPC.Integration { return HttpStatusCode.Unauthorized; } - bool authorized = passwords.First() == ASF.GlobalConfig.IPCPassword; + string inputPassword = passwords.FirstOrDefault(password => !string.IsNullOrEmpty(password)); + + if (string.IsNullOrEmpty(inputPassword)) { + return HttpStatusCode.Unauthorized; + } + + bool authorized = inputPassword == ASF.GlobalConfig.IPCPassword; await AuthorizationSemaphore.WaitAsync().ConfigureAwait(false);