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:
- Add verification operations for each key operation, such as verification code or text message verification.
- Each request links a random token,
- Protect your request parameters.
Of course, there are also bypass methods:
- The image verification code can be handled through human interaction or deciphering. The text message verification code is safer.
- 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.