1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 23:52:50 -05:00

add proper URI validation to duo host (#1984)

This commit is contained in:
Kyle Spearrin
2022-05-09 12:00:05 -04:00
committed by GitHub
parent 43be1d3647
commit a5bfc0554b
2 changed files with 20 additions and 1 deletions

View File

@ -105,7 +105,7 @@ namespace Bit.Api.Models.Request
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
if (!Host.StartsWith("api-") || (!Host.EndsWith(".duosecurity.com") && !Host.EndsWith(".duofederal.com")))
if (!Core.Utilities.Duo.DuoApi.ValidHost(Host))
{
yield return new ValidationResult("Host is invalid.", new string[] { nameof(Host) });
}