Well to prevent that malicious user, Make sure you are using authentication and authorization to even be on that page. But just a suggestion.
Technique to avoid form resubmit
Hello everyone! I hope you are having the best possible time in this pandemic situation. I am dealing with the problem that it generates that users can make multiple clicks on links / buttons and that multiple requests are generated to the controller.
In my case, when a user clicks on a button, the controller makes a query to an external API and creates a record in the database with the corresponding information. So far I am simply avoiding this with javascript from the client side disabilng the elements once clicked . But if a malicious user disables javascript they can bypass that security barrier.
Today it occurred to me to solve it in the following way: What would happen if the vital elements to make calls to the controllers (links, forms, etc.) are generated through javascript when the user enters the site?
To give an example: If I need a form to create a user, I can create it through javascript. This way if a malicious user tries to create a user without javascript, they won't see the important forms and elements.
In this way, the important forms and elements will only be available if the user has javascript activated and, in this way, I make sure that the system I currently have to avoid form resubmit works.
What do you think of this way of trying to solve the problem?
Please or to participate in this conversation.