The vulnerability exists in the FeuserController of the sf_register extension. The root cause is improper access control during the creation and editing of frontend users. Specifically, the getPropertyMappingConfiguration method was overly permissive. It used allowAllProperties(), which allowed any property from the incoming request to be mapped to the user object. Furthermore, it explicitly allowed modification of the usergroup property. An attacker could exploit this by sending a crafted request containing the usergroup parameter to assign a privileged user group to their account, thus escalating their privileges.
The fix involves two main changes in the FeuserController:
- In
getPropertyMappingConfiguration, the call to allowAllProperties() was replaced with allowProperties(), restricting the mappable properties to only those explicitly configured in the selected fields setting. The explicit allowance for the usergroup property was also removed.
- In
modifySettingsBeforeActionMethodValidators, a new check was added to throw an exception if usergroup is present in the selected fields, providing an additional layer of defense.
During an exploit, a profiler would likely show the execution of FeuserController::createAction or FeuserController::editAction, which would then call the vulnerable FeuserController::getPropertyMappingConfiguration method to process the malicious input.