Skip to content

fix: migrate SQL data sources from Statement to PreparedStatement (CW…#136

Open
adamw7 wants to merge 1 commit into
mainfrom
fix/sql-injection-prepared-statement
Open

fix: migrate SQL data sources from Statement to PreparedStatement (CW…#136
adamw7 wants to merge 1 commit into
mainfrom
fix/sql-injection-prepared-statement

Conversation

@adamw7
Copy link
Copy Markdown
Owner

@adamw7 adamw7 commented Mar 22, 2026

…E-89)

  • Replace Statement.executeQuery(query) with PreparedStatement in both IterableSQLDataSource and InMemorySQLDataSource to prevent SQL injection
  • Add new constructors accepting Object... params for parameterized queries
  • Preserve backward-compatible (Connection, String) constructors
  • Add bindParameters() helper for setting PreparedStatement parameters
  • Downgrade query logging from INFO to DEBUG to avoid leaking sensitive data
  • Add happyPathWithParams test validating parameterized query execution

…E-89)

- Replace Statement.executeQuery(query) with PreparedStatement in both
  IterableSQLDataSource and InMemorySQLDataSource to prevent SQL injection
- Add new constructors accepting Object... params for parameterized queries
- Preserve backward-compatible (Connection, String) constructors
- Add bindParameters() helper for setting PreparedStatement parameters
- Downgrade query logging from INFO to DEBUG to avoid leaking sensitive data
- Add happyPathWithParams test validating parameterized query execution
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