| 标题 | 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 13時27分 (1 月前) |
|---|
| 管理 | 2026-09-30 10時09分 (29 days later) |
|---|
| 状态 | 已接受 |
|---|
| VulDB条目 | 411923 [AdithyaYelloju Restaurant-Management-System 直到 7f0e7e84255e8fcfd488e83f8f91451bbbff6b9c Order Placement User/ord.php mysqli_query id/name SQL注入] |
|---|
| 积分 | 20 |
|---|