From 06c9b123f9adf3fde1cf32ec79711ad217b81472 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 9 May 2022 16:00:00 -0400 Subject: [PATCH] ensure no path specific in duo host (#1985) --- src/Core/Utilities/DuoApi.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Core/Utilities/DuoApi.cs b/src/Core/Utilities/DuoApi.cs index 8c35578c6..4d473ae38 100644 --- a/src/Core/Utilities/DuoApi.cs +++ b/src/Core/Utilities/DuoApi.cs @@ -46,7 +46,8 @@ namespace Bit.Core.Utilities.Duo { if (Uri.TryCreate($"https://{host}", UriKind.Absolute, out var uri)) { - return uri.Host.StartsWith("api-") && + return (string.IsNullOrWhiteSpace(uri.PathAndQuery) || uri.PathAndQuery == "/") && + uri.Host.StartsWith("api-") && (uri.Host.EndsWith(".duosecurity.com") || uri.Host.EndsWith(".duofederal.com")); } return false;