Enviar #1061495: mahmoudai1 School Management System ecec9faaf2fb1a3c5cd096e063f8ef326d09cdfd SQL Injectioninformación

Títulomahmoudai1 School Management System ecec9faaf2fb1a3c5cd096e063f8ef326d09cdfd SQL Injection
DescripciónAn unauthenticated SQL injection vulnerability was found in the login handler of mahmoudai1 School Management System. The file loginServer.php forwards the POST parameter "id" to userModel::checkUserInDB() without sanitization. In modules/userModel.php line 353 the value is concatenated into the WHERE clause without surrounding quotes, which creates a numeric injection context. The guard at line 350 is ineffective. It evaluates strpos($id, "'") twice instead of checking $password, and it only blocks the single quote character, which a numeric injection does not require. A tautology followed by a MySQL comment sequence removes the password, accepted and isDeleted predicates, so an anonymous attacker reaches the authenticated branch without knowing any credential. The session then inherits the user_type of the first matching row of the users table, which may be an administrator. Steps to reproduce: 1. Deploy the application and import oopse.sql. At least one row must exist in the users table; the seed data satisfies this condition. 2. Send POST /login.php with the body: id=1 OR 1=1#&password=x&login=1 3. The response contains "Redirecting..." and a session is created. The password predicate has been commented out. The numeric context also provides a boolean oracle, because a successful and a failed authentication render different responses. Blind extraction example: id=1 AND (SELECT ASCII(SUBSTRING(password,1,1)) FROM users LIMIT 1)=36#&password=x&login=1 Note: line 371 assigns the raw payload string to $_SESSION['loggedId'], so pages that reuse this value in their own queries behave unpredictably. The authentication bypass itself and the blind extraction channel are both reliable. Suggested CVSS: AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N (8.2) Suggested fix: cast the id parameter to an integer or use a prepared statement with a bound parameter, and validate the password field rather than the id field.
Fuente⚠️ https://github.com/mahmoudai1/school-management-system/issues/1
Usuario
 LinJ (UID 102009)
Sumisión2026-10-28 10:10 (hace 28 días)
Moderación2026-11-25 18:40 (28 days later)
EstadoAceptado
Entrada de VulDB443968 [mahmoudai1 school-management-system hasta ecec9faaf2fb1a3c5cd096e063f8ef326d09cdfd Login loginServer.php userModel::checkUserInDB id inyección SQL]
Puntos20

Do you want to use VulDB in your project?

Use the official API to access entries easily!