Sourcecodester Web-Based Pharmacy Product Management System Cross-Site Scripting Vulnerability

Vulnerability

A cross-site scripting (XSS) vulnerability has been identified in Sourcecodester Web-Based Pharmacy Product Management System version 1.0. The issue resides in the Supplier Name field of the Supplier module, specifically within the 'add-supplier.php' file. This vulnerability allows attackers to inject malicious scripts that could be executed in the context of the user's browser.

Impact

Exploitation of this vulnerability allows for cross-site scripting, where an attacker can inject malicious scripts that are executed in the context of the user's session. This could lead to session hijacking, credential theft, data exposure, or unauthorized actions performed as the victim.

Reproduction

To reproduce this vulnerability, navigate to the Supplier Name field in the 'add-supplier.php' file of the Pharmacy Product Management System. Inject a script payload, such as an SVG image with an 'onload' event, into the Supplier Name field. When the injected URL is opened, the script payload will execute, demonstrating the cross-site scripting vulnerability.

Remediation

To address this vulnerability, implement contextual encoding, validate and sanitize input, use secure cookie attributes, and avoid unsafe sinks that could allow script execution.

Added: Dec 2, 2025, 6:18 PM
Updated: Dec 2, 2025, 8:26 PM

Vulnerability Rating

Custom Algorithm
spread
0.0
impact
1.7
exploitability
7.7
remediation
0.0
relevance
1.3
threat
6.4
urgency
2.9
incentive
1.7

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