I have this method that is executed on page action:
....
public PageReference validatePage(){
Id someId;
MyObject__c myObj;
try{
someId = ApexPages.currentPage().getParameters().get('id');
myObj = [Select Id, field__c From MyObject__c Where Id = :someId Limit 1];
}catch(Exception e){
return Page.somePage;
}
....
//some conditions and if one evaluates true at some specified case, update a field on that record
myObj.field__c = 'Some value';
update myObj;
}
....
It GET's the param Id, then select the record with that Id, and then some if's elses are evaluated and if all Ok a field is updated.
The page that uses this method is only accessible by logged users in Salesforce.
How can I prevent Cross-Site Request Forgery in the Checkmarx report?