Csrf (Cross-Site Request Forgery)

Source: Internet
Author: User

Cause: I personally think that csrf is convenient in the case of Ajax, because it can be operated by your authenticated user if you do not know it, this is also known as browser hijacking. If you have passed the verification of a website, you will perform operations on the website as your role. For example, if you are an administrator, you can add other users to the Management Group, however, if someone constructs a link to add an administrator and is clicked by the Administrator, the corresponding operation will also be performed.

Solution:

Add a verification code or session token when modifying the information (ASP. NET provides an automatic defense method, that is, use the page attribute viewstateuserkey. Set the value in the page_init method: This. viewstateuserkey = session. sessionid ).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.