
Detailed disclosure of a stored XSS vulnerability in VaahCMS via unsafe SVG file upload handling, including exploitation flow, affected endpoints, and mitigation strategies for security researchers.
A Stored Cross-Site Scripting (XSS) vulnerability was identified in the vaahcms, specifically within the interaction between the file upload logic in MediaController.php and the storeAvatar() method in UserBase.php, allowing a low-level registered user to upload a malicious SVG file containing embedded JavaScript. The vulnerability stems from file storage occurring before content or MIME-type validation, leaving malicious files on a predictable, publicly accessible path on the server.
The vulnerability arises from the upload() method in MediaController.php
$path = $request->file($input_file_name) ->storeAs($request->folder_path, $upload_file_name); allowing an attacker to specify the directory path, enabling them to place malicious files (like an XSS-laden SVG) directly into the public/ directory, making the payload immediately accessible via a web browser.
Successful exploitation allows an attacker to control the content and filename of a file written to a public storage path (/storage/media/YYYY/MM/<controlled-filename>.svg). If this publicly accessible SVG is subsequently rendered by a user's browser via an ``, <object>, or crafted link, the embedded script will execute, leading to persistent XSS.
POST /backend/vaah/manage/media/upload
/storage/media/YYYY/MM/<controlled-filename>.svg.{"success": false, "errors": ["Unable to decode input"]}).POC.svg).xss.svg)./storage/media/2025/08/xss.svg.
enshrined/svg-sanitize for PHP)Researcher: Thaw Phone Nyo
Date Disclosed: 2025/10/8