Restrict `ShowUserController` by ID to users who can `viewUserList
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
## Bug Report
**Current Behavior**
`ShowUserController` currently only uses `viewDiscusions` (via `ScopeUserVisibility`) to restrict who can access user profiles (changed from `viewUserList` in flarum/framework#2305). This makes sense when accessing the profile by slug, but we should restrict it to `viewUserList` when accessing by ID to prevent enumeration.
**Environment**
- Flarum version: beta 15
**Possible Solution**
When not accessing by slug, a check for $user->can('viewUserList') should be done.
Contributor guide
Research direction
Start at ShowUserController and trace how ScopeUserVisibility handles profile lookup by slug versus ID. Verify the ID path checks viewUserList while slug access retains its existing restriction, then add or run focused coverage showing that users without this permission cannot enumerate profiles.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- authorization, backend, security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100