CVE-2024-51222
Stored XSS in Phpgurukul Vehicle System /admin/profile.php
Publication date: 2026-03-23
Last updated on: 2026-03-24
Assigner: MITRE
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| phpgurukul | vehicle_record_management_system | 1.0 |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-79 | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
CVE-2024-51222 is a stored Cross-Site Scripting (XSS) vulnerability in the /admin/profile.php component of the Phpgurukul Vehicle Record Management System v1.0. It occurs because the application accepts user input in the Name parameter without any sanitization and stores it directly in the database. When the profile page is loaded, the stored malicious script is rendered without encoding, allowing attackers to execute arbitrary JavaScript in the browser of any user who visits the page.
Technically, the vulnerability arises because the $name variable is assigned directly from the POST parameter without sanitization and then echoed back without output encoding, enabling persistent XSS attacks.
How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:
I don't know
How can this vulnerability impact me? :
This vulnerability can have several serious impacts including:
- Persistent session hijacking by stealing admin session cookies.
- Privilege escalation by allowing attackers to perform admin actions through injected JavaScript.
- Information disclosure by exfiltrating sensitive admin data.
- Phishing or redirection to attacker-controlled websites.
- Denial of service by breaking the user interface.
How can this vulnerability be detected on my network or system? Can you suggest some commands?
[{'type': 'paragraph', 'content': 'This vulnerability can be detected by attempting to inject a crafted payload into the Name parameter on the /admin/profile.php page of the Vehicle Record Management System v1.0 and observing if the payload is executed when the profile page is loaded.'}, {'type': 'paragraph', 'content': 'A practical test involves logging into the admin panel, navigating to the profile page, and entering a payload such as "><script>alert(\'CVE-2024-51222\')</script>" into the Name field, then updating the profile. If a JavaScript alert fires on subsequent page loads, the vulnerability is present.'}, {'type': 'paragraph', 'content': 'To detect this via commands, you can use tools like curl or wget to send POST requests with the malicious payload and then inspect the response for the injected script.'}, {'type': 'list_item', 'content': 'Example curl command to test injection: curl -X POST -d "name=\\"><script>alert(\'CVE-2024-51222\')</script>&submit=Update" https://targetsite/admin/profile.php --cookie "PHPSESSID=your_session_id"'}, {'type': 'list_item', 'content': 'After sending the payload, use a browser or a tool like curl to GET the profile page and check if the script is present in the response HTML.'}] [1]
What immediate steps should I take to mitigate this vulnerability?
[{'type': 'paragraph', 'content': 'Immediate mitigation steps include applying proper output encoding and input sanitization to prevent execution of injected scripts.'}, {'type': 'list_item', 'content': "Apply output encoding when rendering the stored Name parameter, for example using PHP's htmlspecialchars function: echo htmlspecialchars($name, ENT_QUOTES, 'UTF-8');"}, {'type': 'list_item', 'content': "Sanitize input before storing it in the database, for example: $name = htmlspecialchars(trim($_POST['name']), ENT_QUOTES, 'UTF-8');"}, {'type': 'list_item', 'content': 'Implement a Content Security Policy (CSP) header to restrict the execution of unauthorized scripts.'}, {'type': 'list_item', 'content': 'Use prepared statements with parameterized queries consistently to prevent injection.'}, {'type': 'list_item', 'content': 'Restrict the Name field input to expected characters such as letters, spaces, and limited punctuation.'}] [1]