FAQ-000226 - CSRF and DML Security Issues / Security Review and Documentation

Current Status:VALID_RESPONSEErrorUnable to AnswerSuggests Case

Current FAQ

Question
Are CSRF (Cross-Site Request Forgery) vulnerabilities considered critical findings that must be fixed?
Answer
Yes, CSRF vulnerabilities are considered critical findings in Salesforce and must be fixed. To mitigate the risk, you should: - Implement CSRF tokens. - Ensure user interaction is required for DML operations. - Mark the `confirmationTokenRequired` attribute as "True" for Visualforce pages.
Enhancing FAQ...

Enhancing FAQ with AI recommendations...

AI Recommended Enhancement

Related Security Rules (click to view)
ApexCSRFVfCsrf
Question
Are CSRF (Cross-Site Request Forgery) vulnerabilities considered critical findings that must be fixed?
Recommended Answer Update
Yes, CSRF vulnerabilities are considered critical findings in Salesforce and must be fixed. To mitigate the risk, you should: - Implement CSRF tokens. - Ensure user interaction is required for DML operations. - Mark the `confirmationTokenRequired` attribute as "true" for Visualforce pages.
Reasoning
The answer contains one minor formatting inconsistency where "True" is capitalized and quoted, while the standard convention for boolean attributes in Visualforce is lowercase "true". This small change improves technical accuracy and consistency with Salesforce documentation standards. The content is current and accurate - CSRF vulnerabilities are indeed critical findings that must be addressed, and the mitigation strategies listed (CSRF tokens, user interaction requirements, and confirmationTokenRequired attribute) are all valid approaches. Regarding the selected security rules: ApexCSRF is directly relevant because this FAQ discusses CSRF vulnerabilities generally, and this rule specifically detects CSRF issues in Apex code with severity 1 (critical). The FAQ's discussion of implementing CSRF tokens and ensuring user interaction for DML operations directly relates to what this rule checks for. VfCsrf is also directly relevant because the FAQ specifically mentions the `confirmationTokenRequired` attribute for Visualforce pages, which is exactly what this Visualforce-specific CSRF rule addresses with severity 2. Both rules align perfectly with the FAQ's core message that CSRF vulnerabilities are critical security findings that must be fixed.
Reasoning References