| タイトル | SourceCodester Inventory System using PHP and MySQL 1.0 Cross Site Scripting |
|---|
| 説明 | 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. |
|---|
| ユーザー | kingkingqc (UID 102826) |
|---|
| 送信 | 2026年11月08日 09:41 (22 日 ago) |
|---|
| モデレーション | 2026年11月29日 21:14 (21 days later) |
|---|
| ステータス | 重複 |
|---|
| VulDBエントリ | 374578 [SourceCodester Inventory Management System 1.0 User Registration Endpoint /api/users_handler.php full_name クロスサイトスクリプティング] |
|---|
| ポイント | 0 |
|---|