The vulnerability allows a low-privileged authenticated user of one company to create or update assets (like accessories, components, consumables, etc.) and assign them to a different company when Full Multiple Companies Support (FMCS) is enabled. This is a tenant isolation failure.
The root cause is a mass assignment vulnerability in the store and update methods of several API controllers. The code was using $model->fill($request->all()); which blindly assigns all parameters from the incoming API request to the database model. An attacker could include a company_id field in the JSON body of a POST or PATCH request to associate the created/updated object with any company.
The patch addresses this by adding the line $model->company_id = Company::getIdForCurrentUser($request->input('company_id')); after the fill() call. The Company::getIdForCurrentUser() method ensures that the company_id is set to the company of the currently authenticated user, unless the user is a superuser who is allowed to specify a different company. This change enforces tenant separation at the controller level, preventing users from creating or moving assets into companies they do not belong to.
The vulnerability was present in the store and update methods of AccessoriesController, ComponentsController, ConsumablesController, DepartmentsController, and LicensesController. During exploitation, a call to any of these API endpoints would result in the corresponding store or update function appearing in a runtime profile or stack trace.