Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] ApexFlsViolationRule on dynamic queries with values passed in as parameter #1407

Closed
jaelee125 opened this issue Mar 20, 2024 · 3 comments
Labels
BUG P3 Rarely Malfunction SFGE Issues related to the Salesforce Graph Engine

Comments

@jaelee125
Copy link

ApexFlsViolationRule is flagged on this example code

public static List exampleMethod(String exampleParam) {
String dynamicQuery = 'SOME dynamic Query' + ' WHERE Name = :exampleParam';
return Database.query(String.escapeSingleQuotes(dynamicQuery), AccessLevel.USER_MODE);
}

However, if you do queryWithBinds and pass in a Map with exampleParam, ApexFlsViolationRule is not flagged.

@nwcm
Copy link

nwcm commented Apr 8, 2024

You may find return Database.query() rather than assigning to variable may cause this. I would expect any SOQL or DML applying USER_MODE not to hit ApexFlsViolationRule

@sagar-j-sfdc sagar-j-sfdc added the BUG P3 Rarely Malfunction label Apr 10, 2024
@jag-j jag-j added BUG P3 Rarely Malfunction and removed BUG P3 Rarely Malfunction labels Apr 12, 2024
Copy link

git2gus bot commented Apr 12, 2024

This issue has been linked to a new work item: W-15488279

@stephen-carter-at-sf stephen-carter-at-sf added the SFGE Issues related to the Salesforce Graph Engine label May 23, 2024
@stephen-carter-at-sf
Copy link
Collaborator

Ok, I verified that this seems to now be fixed with our latest-beta.

@jaelee125 Can you please install the following and try again:
sf plugins install @salesforce/sfdx-scanner@latest-beta

Will mark this as fixed for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG P3 Rarely Malfunction SFGE Issues related to the Salesforce Graph Engine
Projects
None yet
Development

No branches or pull requests

5 participants