To ensure proper CSRF protection beyond custom headers, implement the following mechanisms:
1. **Enable `confirmationTokenRequired`**: For Visualforce pages, set the `confirmationTokenRequired` metadata field to `true`. This ensures GET requests to the page require a CSRF token in the URL, making the page inaccessible if the token is omitted.
2. **Avoid State Changes on Page Load**: Avoid performing state changes or DML operations in Apex controllers during page instantiation. Trigger state changes through explicit user actions, like button clicks.
3. **Use Random Tokens**: Generate completely random CSRF tokens with sufficient entropy and include them in requests. Validate these tokens on the server side.
4. **Session-Based Tokens**: Use a single CSRF token per session to reduce risk, as an attacker would need to guess the token within the session window.
5. **Authentication by Tokens**: For redirections or sensitive actions, ensure user interaction and validate the redirection using authentication tokens.
6. **Custom Metadata for Sensitive Information**: Store sensitive information, such as tokens, in custom metadata objects in protected mode to enhance security.
7. **Follow Secure Coding Practices**: Adhere to secure coding guidelines, such as validating user inputs and avoiding vulnerabilities like open redirects.
These measures collectively enhance CSRF protection and mitigate associated risks.