제출 #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)
제출2026. 10. 28. AM 10:10 (28 날 ago)
모더레이션2026. 11. 25. PM 06:40 (28 days later)
상태수락
VulDB 항목443968 [mahmoudai1 school-management-system 까지 ecec9faaf2fb1a3c5cd096e063f8ef326d09cdfd Login loginServer.php userModel::checkUserInDB id SQL 주입]
포인트들20

Are you interested in using VulDB?

Download the whitepaper to learn more about our service!