Skip to content
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

auth: make krb5login redirects safer #234

Merged
merged 2 commits into from
Dec 5, 2023

Conversation

lzaoral
Copy link
Contributor

@lzaoral lzaoral commented Dec 4, 2023

Originally, the krb5login page would allow redirects to any URLs, e.g.
to Google using http://$HOSTNAME/auth/krb5login/?next=//www.google.com.

This commit implements similar sanitization of REDIRECT_FIELD_NAME like Django does in its LoginView.

Related: https://github.com/django/django/blob/8fcb9f1f106cf60d953d88aeaa412cc625c60029/django/contrib/auth/views.py#L43C18-L43C18

@lzaoral lzaoral marked this pull request as draft December 4, 2023 11:43
Originally, the krb5login page would allow redirects to any URLs, e.g.
to Google using http://$HOSTNAME/auth/krb5login/?next=//www.google.com.

This commit implements similar sanitization of REDIRECT_FIELD_NAME like Django
does in its LoginView.

Related: https://github.com/django/django/blob/8fcb9f1f106cf60d953d88aeaa412cc625c60029/django/contrib/auth/views.py#L43C18-L43C18
@lzaoral lzaoral marked this pull request as ready for review December 4, 2023 15:31
@rohanpm rohanpm merged commit 86ee235 into release-engineering:master Dec 5, 2023
15 checks passed
@lzaoral lzaoral deleted the safe-krb5-redirects branch December 6, 2023 13:31
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.

2 participants