Know every vulnerabilitybefore it knows you.
DevGuard continuously monitors your dependencies and alerts you when CVEs like this one affect your stack — with real-time threat intelligence built for developers.
GHSA-5q8v-j673-m5v4
No affected components available
Summary
The User management API endpoints (GET /api/v1/users and GET /api/v1/users/{id}) are accessible to any authenticated user without admin/owner role verification, exposing all users' email addresses, roles, and account status.
Affected Endpoints
- GET /api/v1/users (UserController::index, line 94) — Lists ALL users with full details. No role check.
- GET /api/v1/users/{id} (UserController::show, line 126) — Shows any user's details by ID. No role check.
Root Cause (1-of-N Inconsistency)
Other methods in the same controller properly check for the 'owner' role:
store()—UserStoreRequest::authorize()checksauth()->user()->hasRole('owner')✓destroy()— Explicitly checks$this->repository->hasRole($admin, 'owner')✓
But index() and show() have no role check at all. The route group at routes/api.php:734-747 has no admin middleware, only the global auth:api middleware.
Exposed Data
The UserTransformer (line 40-54) returns:
email— user's email addressrole— user's role (owner/demo)blocked— account blocked statusblocked_code— block reasoncreated_at/updated_at— timestamps
Impact
Any authenticated user can:
- Enumerate ALL user accounts in the instance
- Harvest email addresses for phishing/social engineering
- Identify admin/owner accounts by role
- Determine which accounts are blocked
Exploitation
# List all users
curl -H "Authorization: Bearer <any_user_token>" https://instance/api/v1/users
# View specific user details
curl -H "Authorization: Bearer <any_user_token>" https://instance/api/v1/users/1
Suggested Fix
Add owner role checks to index() and show(), or restrict the route group with admin middleware:
// Option 1: Add check in controller methods
public function show(User $user): JsonResponse
{
if (!$this->repository->hasRole(auth()->user(), 'owner') && auth()->user()->id !== $user->id) {
throw new FireflyException('200025: No access to function.');
}
// ...
}
// Option 2: Add middleware to route group
Route::group(['middleware' => ['admin'], ...], ...)
The vulnerability can be exploited over the network without needing physical access. It is easy for an attacker to exploit this vulnerability. An attacker needs basic access or low-level privileges. No user interaction is needed for the attacker to exploit this vulnerability.
Exploitation attempts have been detected. Elevated vigilance and prompt remediation are advised.
Probability that this vulnerability will be exploited in the wild within the next 30 days.
We did not find any exploit available. Neither in GitHub repositories nor in the Exploit-Database.
Browse More
Continuously monitor your dependencies and get alerted when vulnerabilities like this one affect your stack.
Checkout DevGuard