Merge pull request #719 from christianlouis/jules-fix-database-index-quoting-4036216779366574643
🔒 fix: explicitly quote identifiers in CREATE INDEX for saved_searches
This commit is contained in:
@@ -271,6 +271,7 @@ def _ensure_indexes(engine: Any, inspector: Any) -> None:
|
|||||||
if table not in columns_by_table:
|
if table not in columns_by_table:
|
||||||
columns_by_table[table] = {col["name"] for col in inspector.get_columns(table)}
|
columns_by_table[table] = {col["name"] for col in inspector.get_columns(table)}
|
||||||
if column in columns_by_table[table]:
|
if column in columns_by_table[table]:
|
||||||
|
# SECURITY: Quoted identifiers to prevent SQL injection during index creation
|
||||||
quoted_idx = preparer.quote(idx_name)
|
quoted_idx = preparer.quote(idx_name)
|
||||||
quoted_table = preparer.quote(table)
|
quoted_table = preparer.quote(table)
|
||||||
quoted_col = preparer.quote(column)
|
quoted_col = preparer.quote(column)
|
||||||
|
|||||||
Reference in New Issue
Block a user