Reputation:
First of all, I'm not sure if this is javascript injection. I have a code like this:
<a onclick="requestPage('/abc.php')" href="#" style="margin-left: 10px;">
<i class="fa fa-angle-double-right"></i> Add Member
</a>
There is a call as you can see "requestPage". There are many links like this and when they are clicked, they send a parameter to this function. Now, when you right click this element and see the code in the console, you can change it obviously and make it go to another page instead of the page that was meant to be sent.
Another problem is, when you open the console and put any javascript code in between script tags or in any function, it executes that.
How do I prevent all this?
Upvotes: 1
Views: 281
Reputation: 574
There is no way to prevent any kind Client-side changes to happen. The only place you have full control over is your Server Code.
But those client-side changes you speak of are only applying to one client, and not globally, which means that as as long as your server logic is secure you don't have to fear anything from that.
Maybe this will help you understanding: Wikipedia: Client/Server
Cheers!
Upvotes: 1