How to avoid open-redirect vulnerability and safely redirect on successful login (HINT: ASP.NET MVC 2 default code is vulnerable)

前端 未结 4 2184
[愿得一人]
[愿得一人] 2021-02-04 03:06

Normally, when a site requires that you are logged in before you can access a certain page, you are taken to the login screen and after successfully authenticating yourself, you

4条回答
  •  梦毁少年i
    2021-02-04 03:38

    You could always keep a record of the previous page with TempData when the user is not authenticated and use that to redirect to the previous page instead of a url parameter.

提交回复
热议问题