-
Notifications
You must be signed in to change notification settings - Fork 614
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
fix: return an empty profile page when not found #2680
base: main
Are you sure you want to change the base?
fix: return an empty profile page when not found #2680
Conversation
Signed-off-by: Mike Fiedler <[email protected]>
try: | ||
return super().get_object(queryset) | ||
except Http404: | ||
return AnonymousUser() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would returning an anonymous user make it known that a user doesn't exist and the malicious actor could continue enumerating over usernames?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially, yes - since the HTML contents used to include the user's name in the <title>
tag - that's been removed in the template.
I examined the HTML output of an existing vs anonymous user to confirm that the only difference is in the actual URL requested - nothing else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I examined the HTML output of an existing vs anonymous user to confirm that the only difference is in the actual URL requested - nothing else.
non-blocking suggestion: If it's not too expensive in terms of effort, it would be good to add a test that does this.
I’m not positive we even need or use the public profile page. Removing unauthenticated access to this view entirely is likely the correct move. |
On a little closer review, I think we should probably do away with the slugged URLs: Lines 41 to 42 in 023121f
and replace them with |
Description
Return an identical empty page to prevent user enumeration.