Preliminary understanding of CSRF cross-site forgery request attack

Source: Internet
Author: User
Tags csrf attack
  1. What is a cross-site forgery request attack?

    My own understanding: User A with browser access to a vulnerability site B, and a also visited the malicious website C, assuming that user A on the B site for a transaction, C site has a HTML fragment, then user A Browser will send a request to the B website Transaction link, because a has been logged in the B site, so b site processing of this request, but this request is not user A's own behavior sent, but B website can not determine whether the user is actively sent, so caused the attack! You can use this image to understand


    This figure is taken from HYDDD's blog hyddd's blog--"talking about the CSRF attack mode"

  2. How to protect?

    In server-side defense, the main practice is to set a pseudo-random number for each user's cookie on the server side

    1. Generates a pseudo-random number into a cookie, and then submits the number as a hidden field in the form to the HTML page after it is submitted for validation

    2. Set up verification codes for forms

    3. When the browser opens multiple different forms at the same time, the server creates multiple random numbers, and the random number corresponding to the last form overwrites the random number of the previous form, and only the last open form can be submitted, so you should avoid this situation. So the random number of each form should be stored in each separate place.

  3. Reference: HYDDD's blog--"talking about CSRF attack mode"


Preliminary understanding of CSRF cross-site forgery request attack

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.