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 -

javascript - Preserving URL fragment through CAS sign-on -

asp.net mvc - Implementing normal user/pass, Twitter & Facebook auth -