html - Is there any way to freeze document.body.innerHTML in JavaScript? -


is there way freeze document.body.innerhtml in javascript attacker unable following:

<script>document.body.innerhtml = document.body.innerhtml.replace("http://www.example.com/" , "http://abc.org" ); </script>

also how freeze document.location? thanks!

no, can't lock contents of dom element javascript. suspect you're asking wrong question here. need plug whatever vulnerability attacker using run code in first place.

  • sanitize user inputs strip out tags
  • sanitize content inserted page db
  • disallow html tags in input application

these place start.


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -