Code-Projects Voting System Unrestricted File Upload Vulnerability
Vulnerability
A critical unrestricted file upload vulnerability has been identified in Code-Projects Voting System version 1.0. The issue resides in the file '/admin/candidates_add.php', where the application fails to properly validate the type and filename of files uploaded through the 'photo' parameter. This flaw allows remote attackers to upload malicious scripts, such as PHP web shells, which can be executed to gain control over the server.
Impact
Exploitation of this vulnerability allows for unrestricted file uploads, which can lead to remote code execution on the server.
Reproduction
To reproduce this vulnerability, upload a file through the 'photo' parameter in the '/admin/candidates_add.php' file. The uploaded file is not properly validated and can be a PHP script, such as a web shell. Once uploaded, the file can be accessed via the web server, and the script will be executed.
Remediation
It is recommended to implement proper file validation by checking the file's MIME type and ensuring only safe image formats are allowed. Additionally, uploaded files should be renamed to a random, unpredictable filename before being saved to the server.
Vulnerability Rating
Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.
