-
-
Notifications
You must be signed in to change notification settings - Fork 660
fix: return an empty profile page when not found#2680
fix: return an empty profile page when not found #2680miketheman wants to merge 1 commit intopython:main from
Conversation
Signed-off-by: Mike Fiedler <miketheman@gmail.com>
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.
ewdurbin
commented
Dec 27, 2024
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.
ewdurbin
commented
Jan 2, 2025
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 /users/profile/detail and /users/profile/delete, then add a test_func matching the UserDeleteView to the UserDetail view that allows people to view their own details only.
Description
Return an identical empty page to prevent user enumeration.