| Title | amirhamza05 Student-Management-System 1.0 SQL Injection |
|---|
| Description | A SQL injection vulnerability exists throughout the application's database layer due to unsafe string concatenation. The database abstraction layer in `config/connect.php` builds INSERT, UPDATE, and SELECT statements by directly concatenating table names, column names, values, and WHERE conditions into SQL strings. All business handlers pass POST arrays to `sql_action()`, which dispatches to the vulnerable `Insert_sql()` and `Update_sql()` routines. No parameterized queries, escaping, or column whitelists are applied, and MySQL error messages are echoed directly to the client.
The vulnerable flow includes:
- `config/connect.php:123-130` — INSERT column names and values are fully concatenated
- `config/connect.php:133-147` — UPDATE column names, values, and WHERE clause are fully concatenated
- `config/connect.php:149-153` — the preceding read query is also concatenated
- `config/connect.php:157-225` — `sql_action()` centrally dispatches insert/update/delete operations
- `config/connect.php:223` — database errors are echoed directly to the client
- `student_action.php:18-84` — INSERT injection point via `insert_name`
- `student_action.php:86-156` — UPDATE injection point via `nick`
The generated SQL has the following shape:
```sql
UPDATE student SET id='900',name='<name>',nick='<nick>',father_name='<...>',... WHERE id=900
```
All placeholders come from raw POST values, and strings are interpolated directly, so any single field can close the string and rewrite the statement structure. Because `Update_sql()` also takes column names from the client-supplied array, an attacker can not only inject values but also control which columns are written. |
|---|
| Source | ⚠️ https://github.com/amirhamza05/Student-Management-System/issues/76 |
|---|
| User | Ropgod (UID 102411) |
|---|
| Submission | 10/24/2026 11:47 (1 month ago) |
|---|
| Moderation | 11/23/2026 19:31 (1 month later) |
|---|
| Status | Accepted |
|---|
| VulDB entry | 442504 [amirhamza05 Student-Management-System up to 449397e35d42e3779f14f0bfc654ab307103f7e3 Student Management config/connect.php sql_action sql injection] |
|---|
| Points | 20 |
|---|