Skip to content

security(mysql): replace string concatenation with parameterized queries in schema introspection (#241) - #247

Merged
ZhuchkaTriplesix merged 1 commit into
devfrom
issue/241-mysql-injection-fix
Jul 8, 2026
Merged

security(mysql): replace string concatenation with parameterized queries in schema introspection (#241)#247
ZhuchkaTriplesix merged 1 commit into
devfrom
issue/241-mysql-injection-fix

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

This PR resolves #241 by replacing string concatenation and manual escaping (_escapeSqlString) with parameterized queries (params in the execute method) for schema introspection methods (listViews, listColumnNames, listTables) in the MySQL database connection driver.

Changes

  • Updated listViews, listColumnNames, and listTables in lib/core/database/mysql_connection.dart to use colon-based named parameters (e.g. :schema, :database, :table).
  • Removed the private _escapeSqlString method since it is no longer used.
  • Added comprehensive unit tests in test/core/database/mysql_connection_test.dart to verify MysqlConnection behavior in non-connected states.
  • Updated CHANGELOG.md accordingly.

@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit dbd5f14 into dev Jul 8, 2026
4 checks passed
@ZhuchkaTriplesix ZhuchkaTriplesix self-assigned this Jul 12, 2026
@ZhuchkaTriplesix
ZhuchkaTriplesix deleted the issue/241-mysql-injection-fix branch July 26, 2026 14:38
ZhuchkaTriplesix added a commit that referenced this pull request Jul 27, 2026
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