The vulnerability is an Insecure Direct Object Reference (IDOR) in the Kimai API, specifically within the InvoiceController. The analysis of the patch commit a0601c8cb28fed1cca19051a8272425069ab758f reveals that two functions were missing critical authorization checks.
-
App\API\InvoiceController::getAction: This function is responsible for fetching a single invoice via GET /api/invoices/{id}. The vulnerability description correctly identifies that this function only performed a role-based check (view_invoice) and completely omitted a check to ensure the user had access to the specific customer associated with the invoice. The patch rectifies this by adding an #[IsGranted] attribute that enforces this customer-level access check, preventing users from accessing invoices outside of their authorized scope.
-
App\API\InvoiceController::cgetAction: This function handles the listing and filtering of invoices via GET /api/invoices. The patch shows a new access check being added when filtering by customer. Before the fix, a user could enumerate invoices belonging to customers they shouldn't have access to by passing the customer ID as a filter parameter. The added isGranted('access', $customer) check ensures that the user can only filter for invoices of customers they are permitted to see.
Both functions were vulnerable because they failed to properly enforce data isolation between different teams/customers, allowing any user with the ROLE_TEAMLEAD role to read sensitive financial data across the entire system.