mirror of
https://github.com/bitwarden/server.git
synced 2025-07-03 00:52:49 -05:00
[PM-3561] Clean the return url of any whitespace (#3696)
* clean the return url of any whitespace * ReplaceWhiteSpace helper * tests for ReplaceWhiteSpace helper --------- Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
This commit is contained in:
@ -209,6 +209,8 @@ public class AccountController : Controller
|
||||
returnUrl = "~/";
|
||||
}
|
||||
|
||||
// Clean the returnUrl
|
||||
returnUrl = CoreHelpers.ReplaceWhiteSpace(returnUrl, string.Empty);
|
||||
if (!Url.IsLocalUrl(returnUrl) && !_interaction.IsValidReturnUrl(returnUrl))
|
||||
{
|
||||
throw new Exception(_i18nService.T("InvalidReturnUrl"));
|
||||
|
Reference in New Issue
Block a user