flarum / flarum/issue-archive

Restrict `ShowUserController` by ID to users who can `viewUserList

Open
#157 1 comment 0 reactions 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.