Document Navigation

Blocking Cross-Site Request Forgery (CSRF Token)

Imagine you accidentally click on a scam link disguised as a legitimate email in a new browser tab. This scam link will secretly send a command to your website in the background (such as "delete a product" or "change the administrator password"). Because your browser is logged in, traditional websites often mistakenly believe that this is the action you made, resulting in irreparable damage.

To completely sever this attack chain of forged requests, SX-Creval deployed a high-security defense mechanism across the entire site.

I. What is a CSRF Token?

To prevent the above situation from occurring, SX-Creval introduces a dynamic "Security Token (CSRF Token)" mechanism.

You can think of this token as a "one-time dynamic password". When the system generates a webpage containing forms (whether it's a front-end customer message board or a back-end content publishing page), the system will quietly insert a randomly generated, extremely complex encrypted password into the underlying code.

II. Mandatory Dual Verification Mechanism

When you (or your customer) click the "Submit" button, the data is sent to the server. At this point, SX-Creval performs extremely rigorous double-checking at the underlying level:

  1. Verify the dynamic password (CSRF token) : The system will check whether the sent data contains the "password" that was just assigned, and whether the password matches. Because hacker scam websites cannot guess the password on your webpage in advance, their forged requests will be instantly detected and blocked.
  2. Verify the request origin (Referer header) : The system will also check which URL the request originated from. If the request is found to be from an unfamiliar external website, rather than your own independent website domain, the system will directly classify it as an illegal operation and block it.

III. Comprehensive protection without blind spots

For users with some technical knowledge, modern websites offer more than just traditional forms; they also feature a large number of asynchronous interactions that don't require page refreshes.

SX-Creval's security mechanism provides comprehensive coverage: it globally enables a high-security Django CSRF defense middleware. This means that regardless of whether the frontend submits a form via a traditional click or initiates a partial, non-refreshing request via HTMX technology (such as clicking "Add to Inquiry"), the system will enforce this coded verification mechanism without exception.

IV. Its significance for your daily use

As a user of the system, you don't need to perform any security configurations in the background. This extremely robust defense mechanism acts like an invisible bulletproof glass, protecting your website by default and around the clock.

You can confidently perform any management operations in the backend without worrying about your website data being maliciously altered due to accidentally clicking external links. Every click and submission you make is entirely under your control.