The vulnerability is a path traversal issue within the Mautic configuration settings, specifically concerning the 'image_path' parameter. An authenticated administrator with access to the configuration page could exploit this to access and read sensitive files on the server.
The investigation of the provided commits, 882c2c5be646e36f7b91e7c4b24f71aafa617cd5 and a310b1933de7cfefec03382a4d8c0d9dbbaa0600, points directly to the source of the vulnerability. The changes are centered in app/bundles/CoreBundle/Form/Type/ConfigType.php.
The core of the fix is the introduction of a new validation callback, validateImagePath, for the image_path field within the buildForm method of the ConfigType class. This new function explicitly checks for and disallows path traversal characters ('..'), ensures the path is restricted to the 'media/' directory, and verifies the directory's existence.
The absence of these checks in the vulnerable versions is what allowed the exploit. The buildForm function is the entry point for defining the form's structure and validation rules. By failing to include necessary validation for the image_path, it becomes the vulnerable function. When an attacker submits the malicious path, this function, as part of the form processing lifecycle in Symfony, would have allowed the invalid data to be processed and saved, leading to the vulnerability.