Does javascript-Registration Code prevent cross-site submission?

Source: Internet
Author: User
If the verification code function is set on the user registration and login pages, can cross-site submission be prevented? If the verification code function is set on the user registration and login pages, can cross-site submission be prevented?

Reply content:

If the verification code function is set on the user registration and login pages, can cross-site submission be prevented?

You just need to submit your website too soon and then you can submit it across sites ~

Csrf (Cross-Site Request Forgery) is currently one of the most dangerous web attack methods, he forged a link to a website that you have logged on to and left a logon record in the cookie (which can be embedded in tags such as img a) to achieve a certain purpose, for example, if you have logged on to the Bank's online banking account, he forged your transfer link and asked you to click it to transfer your money (just for example ).
Defense methods include:

  1. Add verification operations for each key operation, such as verification code or text message verification.
  2. Each request links a random token,
  3. Protect your request parameters.

Of course, there are also bypass methods:

  1. The image verification code can be handled through human interaction or deciphering. The text message verification code is safer.
  2. Token must be random enough, otherwise it will be useless if it is guessed.
    At the same time, do not think that only the get method can have csrf or post. For details, refer to the relevant information.

If the verification code is incorrect, this site cannot be submitted. If the cross-site submitted js scripts are identified (though unlikely), you can submit them. Currently, it is useful. It is recommended to use it with a token.

Token and verification code can only resolve repeated submission and frequent operations by normal users, making it difficult to immune malicious behaviors. Today, various Mass Sending and common verification code recognition technologies are in full swing.

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.