| Title | KusalkaSilva Learning-Management-System ffeb873f8803f1e9664384ff75000c7da45466d2 SQL Injection |
|---|
| Description | The affected components are `student_signup.php` and `teacher_signup.php` (repository root). Both files read the registration form values and interpolate them into a SELECT that is supposed to verify that the registering user already exists, and then into an UPDATE that (re)sets the password of the matched row:
```php
// student_signup.php
$query = mysql_query("select * from student where username='$username' and firstname='$firstname' and lastname='$lastname' and class_id = '$class_id'")or die(mysql_error());
$id = $row['student_id'];
if ($count > 0){
mysql_query("update student set password = '$password', status = 'Registered' where student_id = '$id'")or die(mysql_error());
$_SESSION['id']=$id;
echo 'true';
}
```
```php
// teacher_signup.php
$query = mysql_query("select * from teacher where firstname='$firstname' and lastname='$lastname' and department_id = '$department_id'")or die(mysql_error());
$id = $row['teacher_id'];
if ($count > 0){
mysql_query("update teacher set username='$username',password = '$password', teacher_status = 'Registered' where teacher_id = '$id'")or die(mysql_error());
$_SESSION['id']=$id;
echo 'true';
}
```
Injecting `' OR 1=1 -- -` into `firstname` makes the SELECT match an arbitrary existing row; the UPDATE then overwrites that account's password (and for teachers also the username) with the attacker's chosen values. Because these endpoints require no authentication and no CSRF token, an anonymous attacker can take over any student or teacher account whose row can be matched, then log in normally with the new password. The write primitive also allows mass password resets (for example `' OR '1'='1`) across the whole table.
|
|---|
| Source | ⚠️ https://github.com/KusalkaSilva/Learning-Management-System/issues/3 |
|---|
| User | vuldb2026 (UID 101467) |
|---|
| Submission | 09/20/2026 17:22 (16 days ago) |
|---|
| Moderation | 10/06/2026 07:49 (16 days later) |
|---|
| Status | Accepted |
|---|
| VulDB entry | 413894 [Kusalkasilva Learning-Management-System up to ffeb873f8803f1e9664384ff75000c7da45466d2 Student Registration Endpoint student_signup.php sql injection] |
|---|
| Points | 20 |
|---|