So I'm working on an AJAX with PHP, mysql backend and I'm trying to ensure my practices are as secure as possible. In particular, I'm using JSON as my data interchange format. Basically, If I'm appending a bit of poorly formatted JS in front of my JSON string, checking if it's there and then removing it before parsing the JSON string, eliminating all script tags from the JSON strings to prevent an malicious code injection, and validating all of my data in and out using white listing methods, do I have myself covered in preventing XSS and CRSF? Are these methods all solid implementations or am I missing anything?
So I'm working on an AJAX with PHP, mysql backend and I'm trying to ensure my practices are as secure as possible. In particular, I'm using JSON as my data interchange format. Basically, If I'm appending a bit of poorly formatted JS in front of my JSON string, checking if it's there and then removing it before parsing the JSON string, eliminating all script tags from the JSON strings to prevent an malicious code injection, and validating all of my data in and out using white listing methods, do I have myself covered in preventing XSS and CRSF? Are these methods all solid implementations or am I missing anything?
Allow me to clairfy a couple facts. I am validating all input on both client and server. Using sessions to authenticate and form tokens to validate the user input. I'm also using SSL. My question is primarily concerned with XSS and CRSF in terms of JSON data formats. I apologize for confusion