With the URL Structure like http://www.site.com/user/1, is it a security risk?
For example like here http://stackoverflow.com/users/edit/1
Isn’t this a security breach. How can I avoid this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Please explain why you think it is a security breach.
If you mean that a user can simply change the number to access another user’s edit page, yes they can. That can also be done with POST, the body can manually be altered (for example by creating a local html file that posts to your page, or by altering the body using a browser plugin).
You should however use a check on every page, to see whether the currently logged on user has the right to perform the action(s) that are performed on that page.
It can simply be done by:
However, while you have all flexibility you want, you might be repeating checks throughout pages. A solution to this would be using RBAC, where it would become like this: