Submeter #992654: KusalkaSilva Learning-Management-System ffeb873f8803f1e9664384ff75000c7da45466d2 SQL Injectioninformação

TítuloKusalkaSilva Learning-Management-System ffeb873f8803f1e9664384ff75000c7da45466d2 SQL Injection
DescriçãoThe affected component is `login.php` (repository root). The endpoint reads `$_POST['username']` and `$_POST['password']` and concatenates them directly into two authentication queries, one against the `student` table and one against the `teacher` table: ```php $username = $_POST['username']; $password = $_POST['password']; /* student */ $query = "SELECT * FROM student WHERE username='$username' AND password='$password'"; $result = mysql_query($query)or die(mysql_error()); ... /* teacher */ $query_teacher = mysql_query("SELECT * FROM teacher WHERE username='$username' AND password='$password'")or die(mysql_error()); ``` No authentication, escaping, or parameterization is applied. An unauthenticated attacker can inject `' OR 1=1 -- -` into `username` to make the WHERE clause always true; the first row of the `student` table is then loaded and `$_SESSION['id']` is set to that student's id, so the attacker is logged in as an arbitrary existing user without knowing any password. Because the raw database error is printed with `or die(mysql_error())`, the same endpoint also works as an error-based SQL injection primitive (e.g. `UPDATEXML`/`CONCAT` payloads leak arbitrary column values such as the stored plaintext passwords). Combined with the plaintext password storage of this application, a single unauthenticated request is enough to take over any student or teacher account.
Fonte⚠️ https://github.com/KusalkaSilva/Learning-Management-System/issues/1
Utilizador
 yinian328 (UID 101459)
Submissão20/09/2026 17h19 (há 16 dias)
Moderação06/10/2026 07h49 (16 days later)
EstadoAceite
Entrada VulDB413892 [Kusalkasilva Learning-Management-System até ffeb873f8803f1e9664384ff75000c7da45466d2 Login Endpoint login.php mysql_error username/password Injeção SQL]
Pontos20

Want to stay up to date on a daily basis?

Enable the mail alert feature now!