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] [apex] apexcrudviolation not reported even if SOQL doesn't have permissions check on it #150

Open
praful-gupta opened this issue Dec 2, 2024 · 3 comments

Comments

@praful-gupta
Copy link

Rule: apexcrudviolation

a link to the rule documentation:
https://docs.pmd-code.org/pmd-doc-6.55.0/pmd_rules_apex_security.html#apexcrudviolation

Even if the SOQL doesn't have any permission check on running the code analyzer for class there is no apexcrudviolation returned.

Code Sample demonstrating the issue:

Screenshot 2024-12-02 at 22 43 57

Expected outcome:

PMD should report a violation at line 10, but doesn't. This is a false-negative.

Running PMD through: [CLI ] VS Code extension for Salesforce Code Analyzer

@jfeingold35
Copy link
Collaborator

@praful-gupta , can you reproduce this issue running the Code Analyzer directly against the file via the terminal? i.e., sf scanner run --engine pmd --target path/to/whatever/file?

@praful-gupta
Copy link
Author

praful-gupta commented Dec 2, 2024

@jfeingold35
I'm seeing this message, which is basically not giving apexcrudviolation error
Screenshot 2024-12-03 at 00 08 31

@jfeingold35
Copy link
Collaborator

Okay, so this is actually an issue with PMD, then, not with us.
I recommend logging the issue with PMD directly, which you can do at this link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants