Files
ECC/scripts
L4XB c2e1978876 fix(gateguard): match destructive SQL passed to a database client in a quoted argument
The DESTRUCTIVE_SQL_DD phrases (drop table, delete from, truncate) were
only ever tested against quote-stripped text, so a real invocation such
as `psql -c "drop table users"` or `mysql -e "delete from sessions"`,
which must quote the statement, was always allowed. Only the unquoted
spelling, which the shell would split into separate arguments, was
caught.

Keep the quote-stripped scan for the generic case (a commit message
that mentions "drop table" still passes), and additionally test the SQL
phrases against the unquoted argument text when the segment's
executable is a known database client (psql, mysql, mariadb, sqlite3,
duckdb, clickhouse-client, mongosh, ...). The check lives in the
quote-aware pass, so it also applies behind `sh -c` and in chained
segments.

Fixes #3024
2026-09-09 22:34:41 +02:00
..