FAQ-000179 - CSRF and DML Security Issues / DML Operations on Component Load

Current Status:VALID_RESPONSEErrorUnable to AnswerSuggests Case

Current FAQ

Question
Are DML operations in component initialization functions considered CSRF vulnerabilities?
Answer
Yes, DML operations in component initialization functions are considered CSRF vulnerabilities in the AppExchange Security Review. This is because such operations can be triggered automatically on page load, bypassing user interaction and the platform's default CSRF protection. It is recommended to avoid performing DML operations in methods that are automatically initiated and to implement user interaction, such as buttons, to mitigate this issue.
Enhancing FAQ...

Enhancing FAQ with AI recommendations...

AI Recommended Enhancement

Related Security Rules (click to view)
ApexCSRF
Question
Are DML operations in component initialization functions considered CSRF vulnerabilities?
Recommended Answer Update
Yes, DML operations in component initialization functions are considered CSRF vulnerabilities in the AppExchange Security Review. This is because such operations can be triggered automatically on page load, bypassing user interaction and the platform's default CSRF protection. It's recommended to avoid performing DML operations in methods that are automatically initiated and to implement user interaction, such as buttons, to mitigate this issue.
Reasoning
The FAQ is technically accurate and well-structured. The only change needed is replacing "It is recommended" with "It's recommended" to match the conversational tone guidelines that encourage using contractions. The content correctly identifies DML operations in initialization functions as CSRF vulnerabilities and provides clear guidance on mitigation strategies. The ApexCSRF rule is directly related because it detects CSRF vulnerabilities in Apex, specifically flagging methods that could be exploited by CSRF attacks. This FAQ explains exactly the type of vulnerability that the ApexCSRF rule (severity 1) is designed to detect - DML operations that can be triggered without proper user interaction, which bypass CSRF protections.
Reasoning References