Skip to content

security(sql): validate SQL identifiers and queries to prevent injection#7699

Open
dfgvaetyj3456356-hash wants to merge 1 commit into
modin-project:mainfrom
dfgvaetyj3456356-hash:security/sql-injection-validation
Open

security(sql): validate SQL identifiers and queries to prevent injection#7699
dfgvaetyj3456356-hash wants to merge 1 commit into
modin-project:mainfrom
dfgvaetyj3456356-hash:security/sql-injection-validation

Conversation

@dfgvaetyj3456356-hash
Copy link
Copy Markdown

This PR applies a security fix to validate SQL identifiers and queries to prevent injection attacks.

- Add _validate_select_query() to ensure wrapped queries start with SELECT
  and do not contain comment markers or statement terminators
- Add _validate_sql_identifier() to ensure table names and partition columns
  contain only safe characters (alphanumeric + underscore)
- Apply validation in column_names_query, row_count_query, partition_query
- Apply validation in build_query_from_table and query_put_bounders
- Raise InvalidQueryException or ValueError on validation failure
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