You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
src/lib/sql-import.ts:32-49 generateBatchInsert builds INSERT by concatenating escapeValue(value). Current escaping correct but surface for bugs wide: any future change to escapeValue that drops a transformation is direct SQL injection. Architecture should use parameterized queries via mysql_async exec_drop/exec_batch with bound params.
Generate malicious CSV cell: "x'); DROP TABLE users; --"
Round-trip through generateBatchInsert
Observe SQL contains literal containing '; DROP TABLE — single quote escapes correctly today, but escape table completeness is the security boundary
Expected
generateBatchInsert produces SQL with ? placeholders; values bound via mysql_async exec_batch.
Proposed fix
M: add execute_query_with_params(connection_id, sql, params: Vec) in Tauri command; route through mysql_async::Queryable::exec_drop(&mut conn, sql).bind(params). Refactor generateBatchInsert to return (sql_template_with_placeholders, values_per_row) tuples.
Acceptance
Malicious CSV cell round-trips through generateBatchInsert and produces SQL with single ? placeholder; integration test imports malicious CSV and asserts users table still present.
Activity