We have an application that has a lot of forms for submitting data. The forms make heavy use of AJAX with JSON for posting information to the database. I'm concerned about events where a malicious user may try to call our Ajax interface by passing JSON structured data. The php script would not differentiate between our own server calling it or the call being made from outside. In theory, the malicious user can write content in our database without going through our web site. Is this a valid concern and if so, are there ways to tackle this?
2
-
1Force users to log in via PHP sessions. Enable SSL/TLS so no one can eavesdrop (Godaddy sometimes has specials on certificates for 10,20,30 dollars). If your server has a static IP address, make sure the script always checks the IP.kermit– kermit2013-06-08 00:57:48 +00:00Commented Jun 8, 2013 at 0:57
-
1Good tips, I am already checking the IP, but I'm worried about how easy it is to spoof IP addresses.Anshuman Biswas– Anshuman Biswas2013-06-08 02:20:40 +00:00Commented Jun 8, 2013 at 2:20
Add a comment
|
2 Answers
Yes, this is a valid concern. OWASP has some good guidelines here that you should read.
I would like to stress that you shouldn't rely on client logic.