Skip to content
vetkitChecksChangelogDocumentation

vetkit.csharp.sql-injection.quoted-value-splice

A SQL statement embeds a value inside quotes through string interpolation, concatenation or string.Format before it is executed. Any quote in the value breaks out of the literal, which is SQL injection.

Last updated:

Suite: Security

csharp

A SQL statement embeds a value inside quotes through string interpolation, concatenation or string.Format before it is executed. Any quote in the value breaks out of the literal, which is SQL injection.

Category: SECURITY · Engine rule severity: ERROR

How to fix it

Pass values as parameters (cmd.Parameters.AddWithValue("@name", name), Dapper's anonymous parameter object, EF Core FromSql/FromSqlInterpolated/ExecuteSql with an interpolated string) instead of building the statement text.

References

Source: packages/engine/rules/sast/csharp.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.