Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open redirect #975

Closed
ksg97031 opened this issue Sep 26, 2021 · 1 comment
Closed

Open redirect #975

ksg97031 opened this issue Sep 26, 2021 · 1 comment
Assignees

Comments

@ksg97031
Copy link
Contributor

This code prevent reflected xss attack but allow to redirect untrusted site.

redirect_url = request.GET.get("redirect", None)
if redirect_url is None or not redirect_url.startswith("/"):
raise Http404()

PoC
http://127.0.0.1:8000/grappelli/switch/user/2/?redirect=//example.com

@sehmaschine sehmaschine self-assigned this Sep 27, 2021
ksg97031 added a commit to ksg97031/django-grappelli that referenced this issue Sep 30, 2021
@sehmaschine
Copy link
Owner

@ksg97031 thanks. just released a new version.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants