The vulnerability lies in the backup management API of Microweber CMS, specifically in the BackupController.php file. The download and upload functions within this controller did not properly validate user-supplied input, leading to a local file inclusion vulnerability.
The download function allowed an authenticated user to download arbitrary files from the server because it lacked file extension validation. An attacker could craft a request to download sensitive files, such as configuration files or source code. The patch for this function introduced a whitelist of allowed file extensions (.zip and .json), preventing the download of other file types.
The upload function was also vulnerable because it failed to sanitize the src parameter, which specifies the file to be 'uploaded'. An attacker could use path traversal sequences (../) to point to any file on the filesystem. Depending on the web server's permissions, this could be used to move or delete arbitrary files. The patch for this function added multiple layers of protection: it strips path traversal sequences, normalizes the path, and verifies that the path is within the legitimate user files directory.
By exploiting these two vulnerabilities in tandem, an attacker could first use the upload endpoint to move a sensitive file into a web-accessible location and then use the download endpoint to retrieve it, resulting in a full local file inclusion.