CVE-2026-30557
Reflected XSS in SourceCodester Sales Inventory add_category.php
Publication date: 2026-03-30
Last updated on: 2026-04-06
Assigner: MITRE
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| ahsanriaz26gmailcom | sales_and_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
Can you explain this vulnerability to me?
CVE-2026-30557 is a Reflected Cross-Site Scripting (XSS) vulnerability found in the SourceCodester Sales and Inventory System version 1.0, specifically in the add_category.php file. The issue arises because the application does not properly sanitize the "msg" parameter received via a URL. This allows an attacker to craft a malicious URL containing arbitrary web scripts or HTML that, when accessed by a logged-in user, especially an administrator, executes the injected code in the user's browser.
For example, an attacker can send a URL like: http://127.0.0.1:8089/add_category.php?msg=%3Cimg%20src=%22x%22%20onerror=%22alert(808774)%22%3E which triggers a JavaScript alert when the administrator visits the link, demonstrating the execution of arbitrary scripts.
How can this vulnerability impact me? :
This vulnerability can have serious impacts, especially if the victim is an authenticated user with administrative privileges. By exploiting the XSS flaw, an attacker can execute arbitrary JavaScript in the context of the victim's session.
- Steal administrator session cookies, potentially hijacking the administrator's session.
- Perform privilege escalation by using the administrator's rights to manipulate the system unauthorizedly.
- Compromise the integrity and security of the sales and inventory system by injecting malicious scripts.
How can this vulnerability be detected on my network or system? Can you suggest some commands?
This vulnerability can be detected by testing the add_category.php page with a crafted URL that injects a script into the "msg" parameter. For example, sending a GET request with a payload such as <img src="x" onerror="alert(808774)"> in the msg parameter will trigger a JavaScript alert if the vulnerability is present.
A sample command to test this using curl would be:
- curl "http://127.0.0.1:8089/add_category.php?msg=%3Cimg%20src=%22x%22%20onerror=%22alert(808774)%22%3E" --cookie "session=your_admin_session_cookie"
This command sends a request with the malicious payload while including an authenticated session cookie, as the vulnerability requires the victim to be logged in. Observing a JavaScript alert or reflected script execution indicates the presence of the vulnerability.
What immediate steps should I take to mitigate this vulnerability?
Immediate mitigation steps include sanitizing and validating all user inputs, especially the "msg" parameter in add_category.php, to prevent injection of malicious scripts.
Additionally, restricting access to the vulnerable page to only trusted users and applying web application firewall (WAF) rules to detect and block suspicious input patterns can help reduce risk.
Ensuring users log out after their sessions and monitoring for unusual activity can also help mitigate exploitation.
How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:
The Reflected Cross-Site Scripting (XSS) vulnerability in the SourceCodester Sales and Inventory System 1.0 can lead to session hijacking and unauthorized privilege escalation by attackers. This can result in unauthorized access to sensitive data or administrative functions.
Such unauthorized access and potential data breaches could negatively impact compliance with common standards and regulations like GDPR and HIPAA, which require protection of personal and sensitive information against unauthorized access and attacks.
Therefore, this vulnerability poses a risk to maintaining the confidentiality and integrity of data, which are key requirements under these regulations.