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

SQOL injection protection? #12

Open
deltamualpha opened this issue Oct 16, 2020 · 2 comments
Open

SQOL injection protection? #12

deltamualpha opened this issue Oct 16, 2020 · 2 comments

Comments

@deltamualpha
Copy link

Setting up usage of this library, one of my security helpers pinged that the library encourages the use of sprintf-style formatting for SQOL query construction. Is that secure? Does Salesforce provide something like prepared statements? Does this library have a way to do query construction in a safer way than just escape-and-hope?

@Russman12
Copy link

Russman12 commented Sep 9, 2021

SOQL, does not have the ability to perform DML against the database. This means that records cannot be modified via SOQL. This should take the majority of the risk out of injection attacks. Really, the only risk would be that someone is able to query some extra fields on a record.

SF does not provide anything like prepared statements. As of now, I believe this library does not integrate injection protection. Though as stated previously, this should be a relatively small problem. See the following Salesforce article relating to this exact subject: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_security_tips_soql_injection.htm

@brunogs
Copy link

brunogs commented Feb 23, 2022

Maybe it helps someone, I used this library to prevent injections: https://github.com/forcedotcom/go-soql

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

3 participants