Ok, so today I had very good experience on my builded systems. Some guy "hacked" everything and said it was an ajax issue. This is what he said to me:
you are relying on AJAX
when I have access to user's browser I have access to all AJAX functions you wrote for him so I can do anything written in your javascript pretending to be that user
and this is absolutely hillarious - how could someone access to user scripts via ajax? Also I'm using node on server but can't realize where the problem is.. the example of ajax:
var transfer_data = {
id: jQuery(this).data('spin-id')
};
jQuery.ajax({
url: init_s.forms.provably.callback,
type: 'POST',
dataType: 'JSON',
data: transfer_data,
success: function (data) {
console.log(data);
if (data.type == 'failed') {
jQuery('#check_modal').modal('toggle');
} else {
// add data
}
}, error: function (e) {
console.log(e.message);
}
});
and the example of running node script:
socket.on('new_spin_entry', function (data) { ... });
socket.emit('new_spin_entry', {
entry_id: data.user_spin_data.id
});
so what the heck is this? how this is even possible?
P.S. I forgot to mention that he inserted alert in my script that was loaded in page. Not the server scripts, but scripts that was loaded to user
P.P.S.: this is what I'm able to see in console ATM system was down: