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

SQL Injection risks in Postgres meta queries #6666

Open
rdimaio opened this issue Apr 10, 2024 · 1 comment
Open

SQL Injection risks in Postgres meta queries #6666

rdimaio opened this issue Apr 10, 2024 · 1 comment
Assignees
Labels

Comments

@rdimaio
Copy link
Contributor

rdimaio commented Apr 10, 2024

Example problematic query:

statement = "SET search_path TO {};".format(db_schema)

From the psycopg2 docs (https://www.psycopg.org/docs/usage.html#the-problem-with-the-query-parameters):

Warning
Never, never, NEVER use Python string concatenation (+) or string parameters interpolation (%) to pass variables to a SQL query string. Not even at gunpoint.

Affected queries should be rewritten in the way proposed here https://stackoverflow.com/questions/45128902/psycopg2-and-sql-injection-security to prevent SQL injections.

@rdimaio rdimaio self-assigned this Apr 10, 2024
@rdimaio
Copy link
Contributor Author

rdimaio commented Apr 11, 2024

Blocked by #6669

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

No branches or pull requests

1 participant