I'm using Symfony2 witch Sencha Ext JS as a frontend.
I found that my forms are vulnerable to XSS attacks. I'm aware, of that Symfony2 have mechanisms, that secure our data from this attacks, however this mechanisms are mostly using templates for this which i don't use.
I'm collecting plenty of data from fronted fields, that are passed to backend. I wish to fix this issue with as less effort as possible.
My goal is to secure my application before data gets to database. And there is 2 choices that I have on my mind.
First is to add strip_tag function on lifecycle event listeners, that listen data preFlush.
Second is to add strip_tags on entity level on selected vulnerable fields.
Both choices seems to me not sufficient, because of quantity of code.
Is there maybe a good idea to add some code in Sencha frontend? I'm not sure what to do.
Thanks for advices!