javascript - jQuery security issue -
i'm feeling scared solution i'm using in 1 of app. basically, use snippet :
var username = ...; $.ajax({ type: "post", url: "getfeed.php", data: "username="+username, success: function(html) { // stuff } }); my question : hackable ? if use chrome/firefox/... build-in code editor , replace var username = ... var username = 'user1';, work ?
thanks
yes, javascript debugger able change variable whatever username want. javascript open user , can modified easily.
typically have login page authenticate user (often cookie based), , on every subsequent request (ajax or otherwise) able authenticate cookie , make sure user says is. require server side solution authentication.
Comments
Post a Comment