Skip to content

Restrict access to view a user's bookmarks#162

Merged
wunc merged 8 commits intodevelopfrom
restrict-show-bookmarks
Dec 19, 2024
Merged

Restrict access to view a user's bookmarks#162
wunc merged 8 commits intodevelopfrom
restrict-show-bookmarks

Conversation

@betsyecastro
Copy link
Contributor

@betsyecastro betsyecastro commented Aug 21, 2024

To address vulnerability #2645780 – Low – [profiles.utdallas.edu] IDOR via "/users/[UserName]/boomarks" in the HackerOne report.

Allow access to view a user's bookmarks only if: the logged in user is the owners of the bookmarks.

@betsyecastro betsyecastro requested a review from wunc August 21, 2024 18:35
@betsyecastro betsyecastro self-assigned this Aug 21, 2024
@betsyecastro betsyecastro added the ⬇️ priority:low Low priority issue label Aug 21, 2024
@betsyecastro
Copy link
Contributor Author

betsyecastro commented Sep 4, 2024

The last commit implements the BookmarkPolicy to restrict access to showBookmarks view to users with roles: profiles_editor, school_profiles_editor, department_profiles_editor, or the bookmark's owner. Also, authorize the delete action in BookmarkButton before unbookmark() to ensure only the owner can perform the action.

@betsyecastro
Copy link
Contributor Author

The UserBookmark policy was changed to be implemented in the same way as the UserDelegation Policy. Additionally, authorization was added to the create bookmark ability in the bookmark() method as well as the delete bookmark ability in the unbookmark() method in the BookmarkButton Livewire component.

betsyecastro and others added 5 commits September 11, 2024 11:32
- lazy eager loading the bookmarks breaks the display change when unbookmarking. So, we should query fresh.
- Moves the bookmark finding logic to the User model
- Adds a bookmark `ofType` query scope
@wunc wunc merged commit dae998e into develop Dec 19, 2024
1 of 2 checks passed
@wunc wunc deleted the restrict-show-bookmarks branch December 19, 2024 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⬇️ priority:low Low priority issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants