Skip to content

Update documentation related to SQL injection with raw queries#5735

Merged
jharrell merged 12 commits into
prisma:mainfrom
joshbouncesecurity:raw-queries-update
Mar 26, 2024
Merged

Update documentation related to SQL injection with raw queries#5735
jharrell merged 12 commits into
prisma:mainfrom
joshbouncesecurity:raw-queries-update

Conversation

@joshbouncesecurity
Copy link
Copy Markdown
Contributor

Describe this PR

See discussion here;
https://discord.com/channels/937751382725886062/1218200207884288071

Basically, the docs make it seem like queryRaw and executeRaw are safe from SQL injection when it fact is possible to use them unsafely as well.

I have prepared an update to the documentation to reflect this.

Changes

  • I have moved the "parameterized queries" section into the "SQL Injection" section (only minor changes which you can see in this specific commit: 8575fc5
  • I have made SQL injection a top level section so that I can include navigation within it
  • I have provided example of how queryRaw and executeRaw are used safely in a simple case.
  • I have provided examples of how queryRaw and executeRaw can also be used unsafely.
  • I have provided examples of how queryRaw and executeRaw can be used safely in more complicated cases as well.

What issue does this fix?

N/A

Any other relevant information

I deliberately tried to make all examples compatible with the Prisma playground so you can verify them.

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 19, 2024

@joshbouncesecurity is attempting to deploy a commit to the Prisma Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown
Contributor

@jharrell jharrell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much @joshbouncesecurity !

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 26, 2024 3:09pm

Copy link
Copy Markdown
Contributor

@janpio janpio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

@jharrell jharrell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few notes from our internal review. Thank you again @joshbouncesecurity

@joshbouncesecurity joshbouncesecurity marked this pull request as draft March 25, 2024 19:20
joshbouncesecurity and others added 2 commits March 25, 2024 21:21
Co-authored-by: Jon Harrell <4829245+jharrell@users.noreply.github.com>
@joshbouncesecurity joshbouncesecurity marked this pull request as ready for review March 25, 2024 19:31
@joshbouncesecurity
Copy link
Copy Markdown
Contributor Author

joshbouncesecurity commented Mar 25, 2024

Thanks @janpio @jharrell I think I have made all the requested changes

@joshbouncesecurity
Copy link
Copy Markdown
Contributor Author

Hi @janpio I think I handled all your comments except this one which I think is better not changed.

You can see the specific updates here:
https://github.com/prisma/docs/pull/5735/files/6edc580fc29fcc95ffee52736cbd36122565dee1..228aa8354ab0112967a2ebb508802085ef2d4164

Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com>
@jharrell
Copy link
Copy Markdown
Contributor

Thank you again for all your help @joshbouncesecurity ! We really appreciate you working with us and a special thanks for your contribution 🙂

@joshbouncesecurity
Copy link
Copy Markdown
Contributor Author

You're welcome, I always like to see more detailed security documentation :)

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

Successfully merging this pull request may close these issues.

3 participants