إرسال #1061495: mahmoudai1 School Management System ecec9faaf2fb1a3c5cd096e063f8ef326d09cdfd SQL Injectionالمعلومات

عنوانmahmoudai1 School Management System ecec9faaf2fb1a3c5cd096e063f8ef326d09cdfd SQL Injection
الوصفAn 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.
المصدر⚠️ https://github.com/mahmoudai1/school-management-system/issues/1
المستخدم
 LinJ (UID 102009)
ارسال28/10/2026 10:10 AM (28 أيام منذ)
الاعتدال25/11/2026 06:40 PM (28 days later)
الحالةتمت الموافقة
إدخال VulDB443968 [mahmoudai1 school-management-system حتى ecec9faaf2fb1a3c5cd096e063f8ef326d09cdfd Login loginServer.php userModel::checkUserInDB id حقن SQL]
النقاط20

Want to stay up to date on a daily basis?

Enable the mail alert feature now!