The vulnerability is a stored Cross-Site Scripting (XSS) issue originating from the 'System Settings' page. The root cause is the insufficient sanitization of user-provided data before it is saved to the database. This stored malicious data is then rendered on public-facing pages, executing in the browsers of visitors.
The analysis of the patch commit revealed two key functions in modules/Settings/Controllers/Settings.php that were responsible for processing and storing the vulnerable data:
-
Modules\Settings\Controllers\Settings::compInfosPost: This function handles the 'Company Information' form. The patch shows that several fields, most notably the 'Google Maps iframe' (cMap), were not properly sanitized. The fix involves adding stricter validation rules and explicitly removing JavaScript event handlers from the iframe input. This function is a runtime indicator when an attacker is injecting the payload.
-
Modules\Settings\Controllers\Settings::socialMediaPost: This function handles the 'Social Media' links. The patch shows the addition of strip_tags to the social media name field (smName), indicating that it was previously possible to store HTML and script content in this field.
While the patch does not include the public-facing views where the XSS payload would execute, the identified functions are the entry point for the malicious data. Therefore, they are critical indicators of the vulnerability being present and are the functions that would appear in a runtime profile during the injection phase of an exploit.