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] InternalExecutionError #1402

Open
mohan-raheja opened this issue Mar 18, 2024 · 1 comment
Open

[BUG] InternalExecutionError #1402

mohan-raheja opened this issue Mar 18, 2024 · 1 comment
Labels
SFGE Issues related to the Salesforce Graph Engine

Comments

@mohan-raheja
Copy link

Description:
Encountered an InternalExecutionError while running the scanner run dfa command on the cp.cls class. The error suggests a problem with handling a null value within the Salesforce Graph Engine, specifically when attempting to invoke "com.salesforce.graph.symbols.apex.AbstractSanitizableValue.getDeclarationVertex()".

Documentation:
Attached is the log excerpt from ~/.sfdx-scanner/sfge.log showing the error detail. The error occurs when processing the cp.cls, particularly within the processData method.

php
Copy code
Error and stack trace: NullPointerException: Cannot invoke "com.salesforce.graph.symbols.apex.AbstractSanitizableValue.getDeclarationVertex()" because "sanitizableValue" is null: com.salesforce.graph.symbols.apex.system.SObjectAccessDecision.buildSanitizedValue(SObjectAccessDecision.java:138);com.salesforce.graph.symbols.apex.system.SObjectAccessDecision.executeMethod(SObjectAccessDecision.java:112);com.salesforce.graph.symbols.PathScopeVisitor.afterMethodCall(PathScopeVisitor.java:659);com.salesforce.graph.symbols.DefaultSymbolProviderVertexVisitor.afterMethodCall(DefaultSymbolProviderVertexVisitor.java:318);com.salesforce.graph.ops.expander.ApexPathExpander.handleMethodCall(ApexPathExpander.java:681);com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:532)
Steps To Reproduce:

Run sfdx scanner:run --target /path/to/cp.cls --format xml --engine dfa.
Observe the InternalExecutionError in the output.
Expected Behavior:
Expected the scanner to analyze the Apex class without internal errors, reporting any relevant security issues according to Salesforce best practices and rules.

Screenshots:
N/A

Desktop:

Operating System: macOS Ventura 13.5
Code Analyzer version: v3.16.0
Salesforce CLI version: @salesforce/cli/2.0.2
Additional Context:
The issue seems related to internal handling of the Salesforce Graph Engine, potentially a bug within the engine's processing of Apex code for security evaluation.

Workaround:
Currently, no workaround identified. The issue prevents a complete security assessment of the cp.cls file using the scanner run dfa command.

Urgency:
High. This issue blocks thorough security analysis of critical Salesforce Apex code, potentially delaying development workflows and security review processes.

@mohan-raheja
Copy link
Author

I'm getting this error, when I use stripinaccessible


            SObjectAccessDecision decision = Security.stripInaccessible(
                AccessType.READABLE,
                records
            );
            records = decision.getRecords();

@stephen-carter-at-sf stephen-carter-at-sf added the SFGE Issues related to the Salesforce Graph Engine label May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SFGE Issues related to the Salesforce Graph Engine
Projects
None yet
Development

No branches or pull requests

2 participants