Missing Authorization Gate — bulkConfirm()
What is this vulnerability?
The bulkConfirm() method on TransactionController modifies the status of multiple transactions but contains no authorization check.
While the method validates that the transaction IDs exist in the database, it does not verify that the authenticated user has permission to confirm those transactions — or that those transactions belong to the project being accessed.
Recommended Fix
Add an authorization check before processing the request. Laravel's authorization gate should verify the user can perform bulk confirmations on this project:
public function bulkConfirm(Request $request, Project $project): JsonResponse { + $this->authorize('bulkConfirm', $project); + $validated = $request->validate([ 'transaction_ids' => 'required|array', 'transaction_ids.*' => 'uuid|exists:transactions,id', ]); + // Also scope to this project to prevent IDOR Transaction::whereIn('id', $validated['transaction_ids']) + ->where('project_id', $project->id) ->update(['status' => 'confirmed']);
Also add the corresponding policy method to app/Policies/ProjectPolicy.php:
public function bulkConfirm(User $user, Project $project): bool { return $project->organization_id === $user->organization_id && $user->hasRole(['ORG_ADMIN', 'PROJECT_MANAGER']); }
Related Resources
This is a true positive with high confidence. The pattern matches a classic missing authorization gate before a state-changing bulk operation. The surrounding code shows other methods properly use $this->authorize(), making this an oversight rather than intentional design.