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

Use Prepared statements instead of concatenating user-supplied values #25

Closed
bbertucc opened this issue Apr 20, 2022 · 5 comments
Closed
Labels
bountied https://bbertucc.notion.site/Bug-Bounties-37cb0c61fb2d4bb984a78cc6e4b4aa56 bug Something isn't working good first issue Good for newcomers
Milestone

Comments

@bbertucc
Copy link
Collaborator

According to w3..

  • Prepared statements reduce parsing time as the preparation on the query is done only once (although the statement is executed multiple times)
  • Bound parameters minimize bandwidth to the server as you need send only the parameters each time, and not the whole query
  • Prepared statements are very useful against SQL injections, because parameter values, which are transmitted later using a different protocol, need not be correctly escaped. If the original statement template is not derived from external input, SQL injection cannot occur.

Thanks @jrchamp!

@bbertucc bbertucc added the enhancement New feature or request label Apr 20, 2022
@jrchamp
Copy link
Contributor

jrchamp commented Apr 20, 2022

Glad it was helpful! The third piece about SQL injections is the key motivation for me. There are definitely performance benefits that are possible though when the prepared statement can be reused with multiple sets of inputs.

@bbertucc
Copy link
Collaborator Author

@ebertucc added a few more related docs:

I'm elevating this enhancement to a bug.

Fix coming!

@bbertucc bbertucc added the bug Something isn't working label Apr 21, 2022
@bbertucc bbertucc modified the milestones: MVP Two, MVP 1.2 Apr 26, 2022
@bbertucc bbertucc added good first issue Good for newcomers and removed enhancement New feature or request labels May 4, 2022
@bbertucc bbertucc added the bountied https://bbertucc.notion.site/Bug-Bounties-37cb0c61fb2d4bb984a78cc6e4b4aa56 label May 19, 2022
@bbertucc
Copy link
Collaborator Author

bbertucc commented May 19, 2022

I'm adding a bounty to resolve this issue, since I'm busy building new features:

$255.55 will be paid to you if your resolution to this issue is merged.

To participate:

  • Convert every SQL query in the main branch to prepared statements.
  • Submit a pull request w/ your Venmo user or link to a donation page.
  • $255.55 if your update is merged into main.

@bbertucc
Copy link
Collaborator Author

I'm happy to say this issue is closed! And Instant Message Freedom Inc. is receiving $255.55. Way to go @jrchamp!
Screen Shot 2022-05-25 at 2 17 09 PM

@bbertucc
Copy link
Collaborator Author

o since, Paypal tells me to increase the impact by sharing the link, I probably should share the donate link: https://paypal.com/donate/?hosted_button_id=ZDJ3L88KQQ5LS&source=url

bbertucc added a commit that referenced this issue Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bountied https://bbertucc.notion.site/Bug-Bounties-37cb0c61fb2d4bb984a78cc6e4b4aa56 bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants