إرسال #800384: code-projects Chat System Using PHP 1.0 nsecure Direct Object Reference (IDOR) + SQL Injection + Weak Paالمعلومات

عنوانcode-projects Chat System Using PHP 1.0 nsecure Direct Object Reference (IDOR) + SQL Injection + Weak Pa
الوصفA chained vulnerability combining Insecure Direct Object Reference (IDOR), SQL Injection, broken password hashing logic, and plaintext password storage was discovered in the user account update functionality of Chat System Using PHP version 1.0, available at code-projects.org. IDOR — Account Takeover via Arbitrary id: The file update_user.php accepts $_POST['id'] as the target user identifier without any ownership validation. An authenticated low-privilege user can supply any id value — including id=1 (administrator) — to overwrite any user's name, username, and password: $id = $_POST['id']; // ← no check: $_POST['id'] == $_SESSION['id'] SQL Injection — Double Injection Points: Both the SELECT (to retrieve the current record) and the UPDATE (to save changes) queries concatenate unsanitized $_POST values directly: $uq = mysqli_query($conn, "select * from `user` where userid='$id'"); // SQLi #1 mysqli_query($conn, "update `user` set uname='$name', username='$username', password='$newpassword' where userid='$id'"); // SQLi #2 Broken Password Logic — Conditional Plaintext Storage: A critical flaw in the password update logic stores the password in plaintext if the submitted value matches the existing database value: if ($password == $uqrow['password']) { $newpassword = $password; // ← plaintext stored unconditionally } else { $newpassword = md5($password); // ← MD5 without salt (weak) } This means: if an attacker obtains a user's current password (via SQLi or session hijacking) and submits it unchanged, the database will now store it in plaintext for future comparisons — degrading security on every subsequent update cycle. MD5 without salt is trivially reversible via precomputed rainbow tables (e.g., CrackStation, hashes.com).
المصدر⚠️ https://gist.github.com/higordiego/84ae7f08f5c23debebf309de3920bda2
المستخدم
 c4ttr4ck (UID 75518)
ارسال08/04/2026 11:21 PM (19 أيام منذ)
الاعتدال26/04/2026 11:04 AM (17 days later)
الحالةتمت الموافقة
إدخال VulDB359678 [code-projects Chat System 1.0 MD5 Hash update_user.php كلمة المرور تشفير ضعيف]
النقاط20

Do you need the next level of professionalism?

Upgrade your account now!