Skip to content

fix: escape schema name in Postgres prequeries - #16

Open
sha174n wants to merge 1 commit into
masterfrom
fix/postgres-schema-sqli
Open

sha174n wants to merge 1 commit into
masterfrom
fix/postgres-schema-sqli

Conversation

@sha174n

@sha174n sha174n commented Apr 1, 2026

Copy link
Copy Markdown
Owner

Summary

This PR addresses a SQL Injection vulnerability (CWE-89) in the PostgreSQL engine spec.

Previously, the get_prequeries method used an f-string with double quotes to set the search_path, which was vulnerable to injection if the schema name contained double quotes.

Changes:

  • Modified PostgresEngineSpec.get_prequeries to use the dialect's identifier quoter for the schema name.
  • Added an integration test to verify that malicious schema names are correctly escaped.

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.

1 participant