Skip to content

Conversation

@Liteolika
Copy link
Contributor

Fixes https://github.com/ActiveLogin/ActiveLogin.Authentication/security/code-scanning/124

To fix the cross-site scripting vulnerability, we need to sanitize the returnUrl parameter before rendering it in the view. The best way to do this is to use the System.Net.WebUtility.HtmlEncode method to encode the returnUrl value. This will ensure that any potentially malicious scripts in the returnUrl are rendered as plain text and not executed by the browser.

We will make the following changes:

  1. Sanitize the returnUrl parameter in the AccountController before passing it to the view.
  2. Update the Login.cshtml view to use the sanitized returnUrl.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@Liteolika Liteolika marked this pull request as ready for review January 9, 2025 13:08
@elinohlsson elinohlsson added this to the 10.1.0 milestone Jan 16, 2025
@elinohlsson elinohlsson merged commit 277afac into main Jan 17, 2025
18 checks passed
@elinohlsson elinohlsson deleted the alert-autofix-124 branch January 17, 2025 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants