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

How to sanitize input? #331

Open
jmburdette opened this issue Nov 10, 2020 · 2 comments
Open

How to sanitize input? #331

jmburdette opened this issue Nov 10, 2020 · 2 comments

Comments

@jmburdette
Copy link

Is your feature request related to a problem? Please describe.
Could a section on security be added to the readme? In particular how should the input be sanitized before being run against the backend database?

Describe the solution you'd like
Similarly to other backend recommendations, could a suggested way of sanitizing input be given for one of if not all of the query formats?

Describe alternatives you've considered
I'm considering transforming the jsonLogic format into an sql statement. Recursively building the sql while adding placeholders to the sql string and adding input variables to a list. Then passing in the sql string with placeholders and the list of parameters for the db client to sanitize and execute. Are there common libraries that will do this so I can avoid re-inventing the wheel?

@l4j3b
Copy link

l4j3b commented Jan 4, 2021

I would be interested in something like that. @jmburdette, did you find anything?

@jmburdette
Copy link
Author

I would be interested in something like that. @jmburdette, did you find anything?

I ended up using python's pyparsing library to split apart the sql into tokens. Using the db client's SQL string composition helpers I reassembled the sql into a sanitized string the db could execute safely.

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

No branches or pull requests

3 participants