Skip to content
vetkitChecksChangelogDocumentation

vetkit.rust.sql-injection.format-string

SQL text is built with format! and passed to a query API, so interpolated values can change the query (SQL injection).

Last updated:

Suite: Security

rust

SQL text is built with format! and passed to a query API, so interpolated values can change the query (SQL injection).

Category: SECURITY · Engine rule severity: ERROR

How to fix it

Keep the SQL text constant and bind values: sqlx::query("... WHERE id = $1").bind(id), rusqlite params![], tokio_postgres &[&id], or diesel's query builder; the sqlx::query! macros also check the SQL at compile time.

References

Source: packages/engine/rules/sast/rust.yml.

Generated from shipped rule definitions at build time. Matching is a review signal, not proof of exploitability. “generic” denotes text matching, not complete language or framework coverage. Runtime configuration and available tools affect whether a rule runs.