CSRF Testing Form

CSRF Protection:

  • Cross-Site Request Forgery (CSRF) is an attack that tricks the user's browser into executing unwanted actions on another website where the user is authenticated. To protect against CSRF attacks, ChiA GoTHS uses the Gorilla CSRF middleware.
  • The Gorilla CSRF middleware generates a CSRF token for each user session. This token is stored as a hidden input field in the form, and the same token is also embedded in the page using HTMX. The token is automatically updated with each request to ensure security.
  • When you submit the form, HTMX includes the CSRF token in the request using the hx-include="[name='gorilla.csrf.Token']" directive on the body tag of the layout. This way, the server can verify the authenticity of the request and protect against potential CSRF attacks.