Soumettre #831551: mjperpinosa stumasy 1.0 RCE vulnerabilityinformation

Titremjperpinosa stumasy 1.0 RCE vulnerability
DescriptionThe profile image upload functionality suffers from the same flawed validation logic as the post attachment endpoint. The script attempts to verify the uploaded file by checking if the client‑supplied MIME type **or** the file extension is in a whitelist: ```php if (in_array($_FILES["type"], allowed_file_type) || in_array($image_extension, allowed_extension)) ··· Because an OR condition is used, an attacker can simply forge the Content-Type header to a value like image/png (whitelisted) while keeping a .php extension. The file is then saved to a web‑accessible directory with a randomised name, but the extension remains .php: ``` $image_extension = pathinfo($_FILES["name"], PATHINFO_EXTENSION); $unique_image_name = rand(...) . "." . $image_extension; move_uploaded_file(..., "../../../../documents/images/" . $unique_image_name); The server responds with the generated filename, allowing the attacker to immediately request the uploaded PHP script and achieve remote code execution. Steps to Reproduce Create a minimal PHP web shell (e.g., <?php echo 'RCE_OK'; ?>) and save it as avatar.php. Send a multipart POST request to change_profile_image.php with the file field pr_profile_image, forging the MIME type to image/png. The server responds with a randomised filename (e.g., 9540896652.php). Access the file under http://127.0.0.1:3000/documents/images/9540896652.php. The PHP code executes, proving RCE. ```
La source⚠️ https://github.com/mjperpinosa/stumasy/issues/3
Utilisateur j1nk1ng (UID 98141)
Soumission16/05/2026 14:58 (il y a 21 jours)
Modérer04/06/2026 07:14 (19 days later)
StatutAccepté
Entrée VulDB368255 [mjperpinosa stumasy change_profile_image.php pr_profile_image élévation de privilèges]
Points20

Do you want to use VulDB in your project?

Use the official API to access entries easily!