| Title | PHPGurukul Employee Record Management System 1.3 Doubled Character XSS Manipulations |
|---|
| Description | Summary
PHPGurukul Employee Record Management System (ERMS) version 1.3 contains a stored cross-site scripting issue in the employee profile functionality and renders stored profile values without output encoding in the administrative employee list. The employee and administrator login endpoints are also vulnerable to SQL injection. This report documents a verified composite exploitation chain in which an attacker obtains an employee session through SQL injection login bypass, stores a JavaScript payload in the FirstName profile field via myprofile.php, and causes the payload to execute in the administrator origin when an administrator opens /admin/allemployees.php. Because the administrator PHPSESSID cookie lacks the HttpOnly attribute, the script can read document.cookie and the session token can be replayed from a separate HTTP client to access administrative functionality.
The stored XSS component corresponds to publicly disclosed CVE-2025-11112. The SQL injection precondition corresponds to publicly disclosed CVE-2025-5210. This request concerns the composite chain and, in particular, the independently fixable missing HttpOnly attribute on the administrator session cookie, which enables cross-client session replay and is not covered by either existing CVE.
Affected product and version
Vendor: PHPGurukul
Product: Employee Record Management System (ERMS)
Tested version: 1.3
Affected components: /myprofile.php (FirstName profile field), /admin/allemployees.php (administrative employee list), session cookie configuration, /loginerms.php and /admin/index.php (SQL injection precondition)
Attack chain and verification
Step 1: The attacker bypasses employee authentication by submitting a SQL injection payload in the Email parameter of POST /loginerms.php. The application returns HTTP 302 Found with Location: welcome.php. A control request with incorrect credentials returns HTTP 200 OK with Invalid Details, confirming the bypass.
Step 2: Using the obtained employee session, the attacker submits a profile update to POST /myprofile.php and places an HTML payload such as <img src=x onerror=alert(document.domain)> in the FirstName field. The application returns HTTP 200 OK with the message Your profile has been updated. All profile fields must be supplied because the update statement overwrites every column.
Step 3: When an administrator opens GET /admin/allemployees.php, the response contains the stored value byte-for-byte as <td><img src=x onerror=alert(document.domain)></td>. No htmlspecialchars or equivalent context-aware output encoding is applied. A full-text search of the response for <img returns no matches. The administrator browser therefore executes the onerror handler in the administrative origin.
Step 4: The administrator PHPSESSID cookie is not marked HttpOnly and is not bound to the browser client. The script executed in the administrator origin can read the session token through document.cookie. A plain HTTP client carrying the same PHPSESSID can then request GET /admin/welcome.php and receives HTTP 200 OK with administrative content, confirming cross-client replay.
Step 5: After verification, the profile was restored to its original value FirstName=Subhash. A database check for rows containing the less-than character in the affected table returned zero rows, and payload residual was zero.
Impact
An attacker who can obtain or create an employee session can persist a script payload in profile data. When an administrator views the employee list, the script executes under the administrator origin. The attacker can read the administrator session token and replay it from a separate HTTP client, resulting in administrative account compromise and privilege escalation.
Root cause
The application stores user-controlled profile fields without validating or sanitizing HTML in myprofile.php. The administrative employee list /admin/allemployees.php renders stored profile values without context-aware output encoding. Session cookies lack HttpOnly, Secure, and appropriate SameSite attributes, enabling JavaScript access and cross-client replay. The login endpoints /loginerms.php and /admin/index.php are vulnerable to SQL injection through string concatenation, allowing session acquisition as a precondition.
Suggested CWE and CVSS
CWE-79: Improper Neutralization of Input During Web Page Generation (Stored XSS)
CWE-89: SQL Injection (precondition, independently tracked as CVE-2025-5210)
CWE-1004: Sensitive Cookie Without HttpOnly Flag
For the standalone stored XSS, the NVD-assigned vector for CVE-2025-11112 is CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N (6.1 MEDIUM). For the composite chain involving CWE-79, CWE-89, and CWE-1004, a suggested vector is CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N. The PR:N value reflects that the SQL injection payload bypasses authentication without valid credentials. The C:H and I:H values apply to the composite chain because session token theft enables administrative takeover; they should not be attributed to the stored XSS alone.
Suggested remediation
Apply context-aware output encoding on all employee profile fields, especially in administrative list views. Use parameterized queries for all login and profile update SQL statements. Set session cookies with HttpOnly, Secure, and SameSite=Lax or Strict. Regenerate session IDs after login and privilege changes. Add a Content Security Policy without unsafe-inline as defense-in-depth. Enforce server-side validation and allow-list input for profile fields. Add audit logging for profile changes and administrative list access.
Testing note
Testing was performed in an authorized laboratory environment. Session identifiers are redacted in this description. Test data was restored after verification. |
|---|
| Source | ⚠️ https://gist.github.com/LMortalv/e1b2b3014e807dc649bbdbfb48598102 |
|---|
| User | Mortal_ (UID 102852) |
|---|
| Submission | 11/10/2026 15:58 (20 days ago) |
|---|
| Moderation | 11/30/2026 22:52 (20 days later) |
|---|
| Status | Duplicate |
|---|
| VulDB entry | 326193 [PHPGurukul Employee Record Management System 1.3 /myprofile.php First name cross site scripting] |
|---|
| Points | 0 |
|---|