-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Security: protect against open redirects #415
Comments
A straightforward way to implement this protection might be to move the usage of Django's That would embed and enforce the assumption that the E.g. where right now, say in a view, we might call session.update(request, origin=reverse("eligibility:start")) We change the if origin is not None:
logger.debug(f"Update session {_ORIGIN}")
request.session[_ORIGIN] = reverse(origin) And callers like: session.update(request, origin="eligibility:start") Though we have a few places where a direct URL is passed that would need to be updated, e.g. in the |
Looked through the app and we don't have any redirects coming from parameters, so not going to worry about this for now. |
The
origin
set insession.py
is used for history and (as of #414) redirection after login.benefits/benefits/core/session.py
Lines 237 to 239 in c8689c6
Currently, all cases where the
origin
are set are "trusted", but I could imagine a case where we take that path from a query parameter, leaving ourselves vulnerable to an open redirect vulnerability. We should validate the URL/path being passed.Info about open redirects:
The text was updated successfully, but these errors were encountered: