Lessons

CSFR protection of HTML forms

CSFR is a technology to prevent unauthorized submission of a form. Its essence is that a unique ID is generated for each form and user and is contained in the HTML code of the page. This ID is known only by the one who opened the HTML, therefore, it is inaccessible to the attacker. When submitting the form, this ID is verified on the server side. Thus, the attacker cannot send a request to the site on behalf of the user.

An example of how CSFR protection works:

<form action="." method="post">
    /* The _csrf field contains a special verification code that is unique for each page */
    <input type="hidden" name="_csrf" value="4B01Wfyq7mFSfPR-tSzZFTUJdocsowAfyFUSPYJ_EZiKLlIAqfCYE2AYkh3PfIFze19E4RSVSymPEiRT0A1ryA==">
    <input type="text" name="login">
    <input type="password" name="login">
    <input type="submit">
</form>

The CSFR attack is extremely popular. Implement CSFR protection on your project.

Detailed simple описание. Detailed technical description.

PRO subscription for working with the service

Promo
Checking 50 pages in the tool "Checking the page"
190 ₽
The subscription is activated for 10 days and is linked to a specific site.
PRO subscription
3,500 pages per week in tools "Checking the page" and "Full site scan".
1 580 ₽
The subscription is activated for 30 days and you can scan any site.
Wallet
Additional pages that are credited to a separate balance. For checking large sites.
200 ₽
Number of pages
An active PRO subscription is required.
We use cookies. By continuing to use the site, you agree to the processing of personal data in accordance with privacy policy. I agree