The vulnerability exists due to unrestricted file uploads in two separate parts of the Mautic application: the legacy editor and the GrapesJS builder. In both cases, the backend code responsible for handling file uploads failed to properly validate the types of files being uploaded. An attacker could upload a file with a dangerous extension (e.g., '.php'), which could lead to remote code execution if the server was configured to execute files from the upload directory.
The patch addresses this by introducing a centralized and stricter validation mechanism in the Mautic\CoreBundle\Helper\FileUploader class. A new validateImage method was added, which checks both the file's MIME type and its extension against a configurable allowlist. This new validation method is now called from both the legacy FileController::uploadAction and the GrapesJS FileManager::uploadFiles helper, ensuring that only allowed image files can be uploaded through either editor.