SourceCodester Sales and Inventory System Reflected Cross-Site Scripting Vulnerability

Vulnerability

A reflected cross-site scripting vulnerability has been identified in SourceCodester Sales and Inventory System version 1.0. The issue resides in the add_stock.php file, specifically within the 'msg' parameter of GET requests. The application does not properly sanitize user input, allowing remote attackers to inject arbitrary web scripts or HTML. This vulnerability could be exploited to execute malicious scripts in the context of the user's browser.

Impact

Exploitation of this vulnerability allows for session hijacking, where an attacker can steal session cookies from an administrator. Additionally, it could lead to privilege escalation by allowing the attacker to perform actions on behalf of the admin.

Reproduction

To reproduce this vulnerability, deploy SourceCodester Sales and Inventory System 1.0 locally and log in as an administrator. Then, access the add_stock.php page and include a crafted URL that injects a script into the 'msg' parameter. For example, an image tag with an 'onerror' event could be used to execute a JavaScript alert.

Added: Mar 30, 2026, 4:22 PM
Updated: Mar 30, 2026, 4:22 PM

Vulnerability Rating

Custom Algorithm
spread
0.0
impact
5.4
exploitability
5.6
remediation
0.0
relevance
4.9
threat
6.4
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.