0
if (!(EMPYRAMDM__UploadedContact_Csv_Dup__c.sObjectType.getDescribe().isDeletable())) {
    system.debug('**Cannot Delete the Uploaded Contact CSV Duplicates');
} else {
    Database.delete (scope, false);
}

I am trying delete the records using database.delete. I had written the above CRUD check.

In Checkmarx scan, I got this issue:

This query looks for Delete operations that are performed without checking for isDeletable(). This may be a false positive if your code accesses only objects whose security is managed by your app and not the admin (for example OAuth states). It may also be a false positive if checks are performed outside of the dataflow in. References: CRUD Delete result path 1: Similarity Id: -1634949953 Object: scope in file: /classes/MDMDeleteCsvDupBatch.cls L 24: Database.delete (scope, false);

1
  • 1
    FLS = Field Level Security. FLS != CRUD.
    – Adrian Larson
    Apr 25 '17 at 13:09
2

This issue is false positive. The scanner rule is not getting it. However, you should change the logic to:-

if((EMPYRAMDM__UploadedContact_Csv_Dup__c.sObjectType.getDescribe().isDeletable())) 
{
       Database.delete (scope, false);            
}
else
{ 
     // Some error message or info
}

If this is an Appexchange application for security review, submit a document to security team explaining the issue is not genuine and has zero harm.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.