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

Check queries for prepared statements #136

Open
zoobot opened this issue Mar 20, 2023 · 1 comment
Open

Check queries for prepared statements #136

zoobot opened this issue Mar 20, 2023 · 1 comment
Assignees
Labels
backend enhancement New feature or request good first issue Good for newcomers

Comments

@zoobot
Copy link
Member

zoobot commented Mar 20, 2023

Use prepared statements to guard against sql injection.
Good call @tzinckgraf, thanks for bringing this up! I assigned you but feel free to unassign yourself if you'd rather have someone else work on it.

TODO for this issue: check queries to make sure they are PreparedStatements

https://vitaly-t.github.io/pg-promise/PreparedStatement.html

In our code prepared statements can be formatted like this. Note, name must be unique.

const query = {
    name: 'find-source',
    text: 'SELECT * FROM sources WHERE id_source_name =  $1',
    values: idSourceName,
  };
@zoobot zoobot added enhancement New feature or request good first issue Good for newcomers backend labels Mar 20, 2023
@zoobot
Copy link
Member Author

zoobot commented Mar 20, 2023

Do we want to break this up per route to make it easier for new people to jump in here and do them since it will require testing the app full stack and checking tests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend enhancement New feature or request good first issue Good for newcomers
Projects
Status: Todo
Development

No branches or pull requests

2 participants