Is there any way to prevent xss attacks in magento? in my localhost i am just trying to check how to prevent xss attacks for example i am inserting a script when user register in magento, i am just shocked when inserting a whole script in the name field i am successfully registered my dashboard screenshot

after refreshing the page i got another screen
I just want to prevent the user that no one can do like that.
Please help me prevent that types of attacks.
Also, this may be a template problem. If your template doesn’t properly escape user input, you end up with garbage in your database. I’m running 1.4.1.1 as well, but the input fields are filtered as follows:
The htmlEscape() function is supposed to take care of the nasties. On some templates, it was missing from search fields and you could get a verifiable XSS problem using it.