The vulnerability is a combination of two weaknesses in Mattermost's file upload process for remote clusters. First, the sharedchannel.Service.onReceiveUploadCreate function failed to validate the type of upload, allowing a system administrator to initiate an upload of a file that is not an attachment. Second, the api4.createUpload function did not properly sanitize the filename, making it vulnerable to path traversal. An attacker with system admin privileges could exploit these two vulnerabilities in concert. By creating a remote upload session with a malicious filename containing path traversal sequences (e.g., ../..//tmp/pwned.txt) and a non-attachment upload type, the attacker could write a file to an arbitrary location on the Mattermost server's filesystem. The patches address these issues by adding the necessary validation and sanitization. The first patch ensures that only attachments can be uploaded through shared channels, and the second patch cleans the filename to prevent path traversal.