SQL Injection Vulnerability at Sourcecodester House Rental Management System
A vulnerability classified as critical has been found in SourceCodester Best House Rental Management System 1.0. Affected is an unknown function of the file payment_report.php. The manipulation of the argument month_of leads to sql injection. It is possible to launch the attack remotely. The exploit has been disclosed to the public and may be used. VDB-268794 is the identifier assigned to this vulnerability.
The part of this code that is vulnerable to SQL injection is the following SQL query, where the monthofparameterisdirectlyincludedintheSQLstatementwithoutanysanitizationoruseofpreparedstatements.Becausethe‘month_ofparameter is coming directly from userinput ($_GET[‘month_of’])`. An attacker could manipulate this input to include malicious SQL code.
Vulnerability Verification and Exploit
We can easily recreate this vulnerability using sqlmap as such:
Below is the payload that can be used to reproduce withouut sqlmap
month_of=2024-06' UNION ALL SELECT NULL,NULL,NULL,NULL,NULL,CONCAT(0x716b6b6271,0x7150726e686a6f7a51496176746f794e58766344546e746a77414663655079734a697847496f4557,0x716b7a6271),NULL-- -