SourceCodester Web-Based Pharmacy Product Management System Unrestricted File Upload Vulnerability

Vulnerability

A critical unrestricted file upload vulnerability has been identified in SourceCodester Web-Based Pharmacy Product Management System version 1.0. The issue resides in the 'edit-product.php' file, where the 'Avatar' argument is manipulated to allow unauthorized file uploads. This vulnerability can be exploited remotely, leading to potential remote code execution.

Impact

Exploitation of this vulnerability allows for unrestricted file uploads, which can be used to execute malicious scripts on the server, potentially leading to a full server compromise.

Reproduction

To reproduce this vulnerability, send a POST request to 'edit-product.php' with a file included in the 'Avatar' field. The file can be a PHP script disguised as an image, bypassing the MIME type checks. Once uploaded, the file can be executed as a script, for example, by accessing it through the web server and appending a command to be executed.

Remediation

Users are advised to implement strict file validation, ensuring that only files with allowed extensions are accepted and that uploaded files are not executable. Additionally, uploaded files should be stored in a way that prevents direct access via the web server.

Added: Jun 9, 2025, 7:46 PM
Updated: Jun 9, 2025, 7:46 PM

Vulnerability Rating

Custom Algorithm
spread
0.0
impact
7.5
exploitability
6.6
remediation
0.0
relevance
0.0
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.