• Saleem Baba M D
  • 0 Points
  • Member since 2014

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
  • 3
Hi All,

I have a FLS issue when I scan the code in Checkmarx. I search on the communities to resolve this issue but I could not found the solution.

It is buring issue because one of my client purchase the checkmarx by paying the huge amount and i'm not able to find the solution to it. 

Before making any DML statements in the code, I'm checking whether the user have a permission to insert/update/delete or not.. please find below code and it would be helpful if someone suggest me what is the wrong I have done in the below code.

Savepoint sp = Database.setSavepoint();
    User u = new User();
    u=[SELECT Contact.email, Contact.firstName, Contact.lastName FROM User WHERE id=:userId];
        u.Contact.email = data.email;
        u.Contact.firstName = data.firstName;
        u.Contact.lastName = data.lastName;
        u.firstName = data.firstName;
        u.lastName = data.lastName;
        u.email = data.email;
    try {
            update u;
            update u.Contact;
     } catch (Exception e) {

Thanks in Advance.

Mohammed SaleemBaba

Last week, it was brought to my attention that security reviews and audits are now asking ISVs to check for Field Level Security (FLS) and Object CRUD permissions prior to any DML outside of standard controllers.  

This is a fairly radical change that impacts a lot of managed package applications across the board. I and others have several concerns about this change in the security review process:
  1. Why the sudden change in security review policy?  
    • None of the ISVs I have talked to were informed of the change prior to being either audited or submitting any apps for security review.  The only official documentation I can find on the change is a blurb in the Security Scanner help page here: http://security.force.com/security/tools/forcecom/scannerhelp.  
    • As ISVs, it would be greatly appreciated to have an official Security Review Guide, that is updated well in advance to when policy changes like this take place.  Some ISVs have several packages, others lots of customizations, and we all need time to prepare for the security review.
  2. Has the security scanner been updated to enforce this rule yet?
    1. I have not run an app through the Security Review process recently, so I am curious if this rule has been implemented already in the security scanner. (http://security.force.com/security/tools/forcecom/scanner)
  3. Why force FLS and CRUD checks on every DML transaction?
    • I am a fan of using standard controllers when necessary, but several apps, including one my company develops rely heavily on Custom Controllers.  In most cases where FLS comes into play, typically it's a simple fix of a profile permission or permission set that resolves the issue.  Instead, now, we have to implement FLS and CRUD checking prior to each DML transaction.  This adds complexity on top of existing DML calls.  
    • If need be, can the FLS and CRUD checking be done on a one-time run in an install script?
    • Does Salesforce have any plans of either adding FLS checking for custom controllers or adding methods to Apex for checking credentials similar to the Force.com EASPI library? (https://code.google.com/p/force-dot-com-esapi/)
Thanks, I look forward to hearing any feedback on this issue.

Hi Guys,


We got an error that our code not Enforced SF CRUD and FLS(http://wiki.developerforce.com/index.php?title=Enforcing_CRUD_And_FLS) from Checkmarx report. we could not found anything wrrong in the code. please help me to resolve this issue,

public class DefaultValues
public void SetDefaultValues()

if (Schema.sObjectType.Account.fields.Name.isCreateable() &&Schema.sObjectType.Account.fields.Description__c.isCreateable() && Schema.sObjectType.Account.fields.ObjectType__c.isCreateable() && Schema.sObjectType.Account.fields.EnabledStatus__c.isCreateable() )
List<Account> ListAccont=new List<Account>();
Account ObjAccountExact=new Account();
ObjAccountExact.Name='1st Pass - Strict';
ObjAccountExact.Description__c='Acct Name, Phone & City Exact';
insert ListAccont;