CVE-2026-30568
Reflected XSS in SourceCodester Inventory System view_purchase.php
Publication date: 2026-03-27
Last updated on: 2026-03-30
Assigner: MITRE
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| ahsanriaz26gmailcom | inventory_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
How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:
The vulnerability allows remote attackers to inject arbitrary scripts that can lead to session hijacking and privilege escalation by compromising administrator accounts.
Such unauthorized access and potential data breaches could result in non-compliance with standards and regulations like GDPR and HIPAA, which require protection of sensitive data and user privacy.
Specifically, if attackers leverage this vulnerability to access or manipulate personal or protected health information, it could violate data protection requirements and lead to regulatory penalties.
Can you explain this vulnerability to me?
CVE-2026-30568 is a Reflected Cross-Site Scripting (XSS) vulnerability found in SourceCodester Inventory System version 1.0, specifically in the view_purchase.php file.
The vulnerability occurs because the application accepts a "limit" parameter via a GET request and reflects it back to the user without proper sanitization or encoding.
This allows remote attackers to inject and execute arbitrary JavaScript code by crafting a malicious URL containing a script payload in the "limit" parameter.
The attack requires the victim to be an authenticated user, typically an administrator, since the vulnerable page requires login.
How can this vulnerability impact me? :
This vulnerability can lead to session hijacking, where attackers steal administrator session cookies.
It can also enable privilege escalation, allowing attackers to perform unauthorized actions within the system by leveraging the administrator's privileges.
How can this vulnerability be detected on my network or system? Can you suggest some commands?
This vulnerability can be detected by testing the "limit" parameter in the view_purchase.php page for reflected Cross-Site Scripting (XSS). An effective method is to craft a URL with a JavaScript payload in the "limit" parameter and observe if the script executes when accessed by an authenticated administrator.
For example, you can use the following URL to test the vulnerability:
- http://127.0.0.1:8089/view_purchase.php?limit=\"><script>alert(15623);</script>
If an alert box displaying "15623" appears upon visiting this URL while logged in as an administrator, the vulnerability is confirmed.
To detect this on your system or network, you can use tools like curl or wget to fetch the page with the crafted URL and inspect the response for the injected script. For example, using curl:
- curl -i "http://your-inventory-system/view_purchase.php?limit=\"><script>alert(15623);</script>"
Check the response HTML for the presence of the injected script tag. Additionally, manual testing by logging in as an administrator and visiting the crafted URL in a browser can confirm the vulnerability.
What immediate steps should I take to mitigate this vulnerability?
Immediate mitigation steps include sanitizing and validating the "limit" parameter input in the view_purchase.php file to prevent injection of arbitrary scripts.
Specifically, implement proper input validation to allow only expected values (e.g., numeric limits) and apply output encoding or escaping before reflecting the parameter back in the HTML response.
Additionally, restrict access to the vulnerable page to authenticated users only and consider applying Web Application Firewall (WAF) rules to detect and block malicious payloads targeting the "limit" parameter.
As a temporary measure, avoid clicking on suspicious or untrusted URLs containing the "limit" parameter until the vulnerability is patched.