DML operations on component load are considered a CSRF vulnerability in Salesforce because they bypass the platform's default CSRF protection. When these operations are triggered automatically during page initialization (e.g., in Visualforce pages, Lightning components, or Aura components), they execute without requiring user interaction. This makes them susceptible to unauthorized actions and could be exploited by malicious actors to execute unauthorized actions during an authenticated session.
To mitigate this risk:
- Trigger state changes or DML operations through explicit user actions, like button clicks.
- Enable CSRF protection mechanisms, such as the `confirmationTokenRequired` attribute.