Skip to content

How to properly prevent SQL injection? #1120

Answered by elprans
2br-2b asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, passing data in arguments is always safe.

This, on the other hand is NOT:

v = await conn.fetchrow(f"SELECT * FROM table WHERE username = '{user_provided_string}'")

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@2br-2b
Comment options

@elprans
Comment options

@2br-2b
Comment options

Answer selected by 2br-2b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants