Skip to content

auth: make krb5login redirects safer#234

Merged
rohanpm merged 2 commits into
release-engineering:masterfrom
lzaoral:safe-krb5-redirects
Dec 5, 2023
Merged

auth: make krb5login redirects safer#234
rohanpm merged 2 commits into
release-engineering:masterfrom
lzaoral:safe-krb5-redirects

Conversation

@lzaoral
Copy link
Copy Markdown
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 force-pushed the safe-krb5-redirects branch from 1ca76a7 to 92c8099 Compare December 4, 2023 15:28
@lzaoral lzaoral marked this pull request as ready for review December 4, 2023 15:31
Comment thread kobo/hub/views.py
@rohanpm rohanpm merged commit 86ee235 into release-engineering:master Dec 5, 2023
@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