| 제목 | AdithyaYelloju Restaurant-Management-System 7f0e7e84255e8fcfd488e83f8f91451bbbff6b9c SQL Injection |
|---|
| 설명 | The affected components are `User/ord.php` and `User/ord_t.php`, two authenticated endpoints used to place food and table orders. Both endpoints interpolate user-controlled GET parameters directly into a SQL statement and then use the same row to construct an `INSERT` statement:
```php
// User/ord.php
$id=$_GET["id"];
$sql = "select * from menu where id='$id'";
$result=mysqli_query($conn,$sql);
...
$row = mysqli_fetch_array($result);
$total = $quantity * $row['price'];
$date = date("Y-m-d");
$sql = "insert into order_list values('','".$row['name']."',".$row['id'].",".$quantity.",'".$date."','".$ud['fname']."',".$ud['id'].",".$ud['phone'].",'".$ud['address']."','no',".$total.")";
mysqli_query($conn,$sql);
```
```php
// User/ord_t.php
$id=$_GET["name"];
$result=mysqli_query($conn,"select * from tables where name='$id'");
...
$sql = "insert into t_order values('','".$row['name']."',".$row['members'].",'".$date."','".$ud['fname']."',".$ud['id'].",".$ud['phone'].",'".$ud['address']."','pending..',".$row['price'].")";
mysqli_query($conn,$sql);
```
`User/ord.php` interpolates `$_GET["id"]` directly into the `select * from menu where id='$id'` query, allowing UNION-based data extraction (verified in the lab to retrieve `user()`). `User/ord_t.php` interpolates `$_GET["name"]` directly into the `select * from tables where name='$id'` query, and additionally echoes the resulting SQL on screen (`echo $sql;`) which discloses the injected fragment. Both endpoints have no anti-CSRF token and no input validation. The `$_SESSION['user']` check is missing on `User/ord.php` (see "Root Cause" below), so the endpoint is reachable by unauthenticated users.
|
|---|
| 원천 | ⚠️ https://github.com/AdithyaYelloju/Restaurant-Management-System/issues/6 |
|---|
| 사용자 | 100001001X (UID 100909) |
|---|
| 제출 | 2026. 09. 01. PM 01:27 (29 날 ago) |
|---|
| 모더레이션 | 2026. 09. 30. AM 10:09 (29 days later) |
|---|
| 상태 | 수락 |
|---|
| VulDB 항목 | 411923 [AdithyaYelloju Restaurant-Management-System 까지 7f0e7e84255e8fcfd488e83f8f91451bbbff6b9c Order Placement User/ord.php mysqli_query id/name SQL 주입] |
|---|
| 포인트들 | 20 |
|---|