| Titre | SourceCodester Inventory System using PHP and MySQL 1.0 Cross Site Scripting |
|---|
| Description | Product: "Inventory System using PHP and MySQL" (aka InventoryX) v1.0, SourceCodester project ID 18722 by ganeshrkt2019 (2026-05-23). https://www.sourcecodester.com/php/18722/php-inventory-system.html
(Same-name old products on VulDB are different codebases; this targets project 18722 only.)
UNAUTHENTICATED Stored Cross-Site Scripting (CWE-79) hitting the most sensitive admin page. The unauthenticated registration API (api/users_handler.php:54, same ungated action=register as the privilege-escalation issue) stores full_name without any filtering. The value is rendered RAW on users.php (lines 31-33: echo $row['full_name'] / $row['username'], no htmlspecialchars) - and users.php is the User Management page protected by requireAdminVerification() (admin role + password re-verification), meaning the stored payload fires precisely inside the administrator's most privileged context: session/credential theft from the page that manages all accounts.
Verified end-to-end locally:
1) Unauthenticated: curl -X POST .../api/users_handler.php with action=register&username=xsstest&full_name=<img src=x onerror=alert(document.cookie)>&role=staff -> success, stored verbatim.
2) Administrator logs in, passes admin_verify.php (password re-check), opens users.php -> HTTP 200, 18926 bytes; page contains the RAW payload: <img src=x onerror=alert(document.cookie)> (verified by grep on the served HTML).
Impact: an anonymous visitor plants JavaScript that executes for the (re-verified) administrator on the user-management page - account takeover of the admin session.
Suggested fix: htmlspecialchars(..., ENT_QUOTES) on all users.php output; validate/sanitize full_name at the API.
References: https://www.sourcecodester.com/php/18722/php-inventory-system.html - no prior advisory for this product. |
|---|
| Utilisateur | kingkingqc (UID 102826) |
|---|
| Soumission | 08/11/2026 09:41 (il y a 22 jours) |
|---|
| Modérer | 29/11/2026 21:14 (21 days later) |
|---|
| Statut | Dupliqué |
|---|
| Entrée VulDB | 374578 [SourceCodester Inventory Management System 1.0 User Registration Endpoint /api/users_handler.php full_name cross site scripting] |
|---|
| Points | 0 |
|---|