If I understand you right... Imagine I spy on your Javascript inner-workings for a while. Imagine I am able to look for the following:
DeleteUserRecord()
UpdateUserRecord()
And in each, you're matching these IDs to the primary key in the database. For example, your code excutes this: DELETE [record] FROM [table] WHERE [id] = '1234'
, and your Javascript looks like this: DeleteUser(1234)
. What if I change it to 1
? What if I delete every single user? What if I delete the first user, who could presumably be the admin
?
Or what if I were allowed to update a single user's record, but I change the ID to 1
and make myself the admin
? UpdateUser(1)
instead of UpdateUser(1234)
Sounds like your code might be vulnerable to a direct object reference exploit.
All I need to do is tamper with your javascript request and you're TeH PwNz0rEd. Try reading this thread for a better explanation.