php - Secure AJAX request to URI -
i know there have been lots of question ajax security. i've searched , read still unclear best approach is.
i have specific senario:
i have application build on top php mvc framework. i've turned presentation elements such "navigation menu" modular. navigation menu module has controller (sever side). controller uses model retrieving data database , responds php echo of data. can make http request controller using ajax because controller routed uri. believe call restful api. when user clicks link in navigation menu static content area update data retrieved ajax request. lets make different action in same controller capable of writing data database. having publicly available uri allows writing database bad. how 1 secure uri interface ajax can retrieve , write data, individuals malicious intent can harm?
you must treat ajax request treat request or post request. in other words never trust user. have server side control, ajax client side never trust "client side" makes request(check data, if data ok return response if not return response).
Comments
Post a Comment