What this solution does
Web application vulnerabilities are architectural flaws that allow attackers to disrupt service operations or access users' personal data.
A primary category of such vulnerabilities is Cross-Site Request Forgery (CSRF). This attack exploits specific characteristics of the HTTP protocol: if a user's browser is induced to send a request to a vulnerable server, it will automatically include the user's current cookies in that request.
In a successful CSRF attack, a victim visiting a malicious site unknowingly triggers harmful actions on another server, such as transferring funds to an attacker's account. For this to occur, the user must be authenticated on the target server, and the request must not require any user confirmation that cannot be bypassed or forged by the attacking script.
The delement.csrf module enhances form protection across all editions of 1C-Bitrix. A short-lived CSRF token is generated for each form and verified upon submission. Unlike the standard bx_sessid check, this token is bound to a specific form and has a limited validity period, minimizing risks even if the token is intercepted.
The solution protects against cross-site request forgery. Even if an attacker uses the user's current cookies, they cannot access the required token to submit forms on the user's behalf.
Connecting a form from the Web Forms module
Enable form validation in the module settings.
Set a unique secret for code generation.
Specify the desired token lifetime in seconds.
Select the required form from the list.
Add an input field with the token to the form template using the DelementCsrfHelper::getCsrfInput method, passing the WEB_FORM_ID parameter.
Connecting to custom forms
Insert an input field with the token into your form. Generate the token using the DelementCsrfHelper::getCsrf method by passing a unique form identifier.
Add token validation in the form processing script using the DelementCsrfHelper::validateCsrf method, passing the same unique form identifier.
If “Form Protection” is required, General iT can help with installation, configuration and a technical check after integration.