Secure way to Delete a record in ASP.Net MVC

那年仲夏 提交于 2019-12-05 18:26:20

Short answer. That is not enough.

Antiforgery tokens just say that the person making the original page request is the person making the update.

The base authorize attribute just verifies that the user is logged in.

What you are looking for is data security. There's an example of this on microsoft's own site.

What you've stated in your last paragraph, a hacker can sign up for an account create their own list of products and given what you show them in the url could guess legitimate other records to edit

Say you have a url

https://example.com/product/edit/13

what is preventing the user/hacker from guessing at

https://example.com/product/edit/12 or https://example.com/product/edit/14

Without security at the data level that says what records a user can or can't access/update, you run into a situation where a malicious user could see or edit all kinds of information.

This is the exact scenario that FISERV found to expose other client information

from the article

Hermansen had signed up to get email alerts any time a new transaction posted to his account, and he noticed the site assigned his alert a specific “event number.” Working on a hunch that these event numbers might be assigned sequentially and that other records might be available if requested directly, Hermansen requested the same page again but first edited the site’s code in his browser so that his event number was decremented by one digit.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!