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
There is no sense to use two doc pages for rules G201 and G202.
Both rules are really similar and they can be placed in one doc.
After all, why should we duplicate "The right way" section"
in a separate doc for rule G202?
Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
Copy file name to clipboardExpand all lines: docs/rules/g201-g202_sql_injection_via_format_string.md
+37-4Lines changed: 37 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,14 @@
1
1
---
2
-
id: g201
3
-
title: G201: SQL query construction using format string
2
+
id: g201-g202
3
+
title: G201/G202: SQL query construction using format string/string concatenation
4
4
---
5
5
6
6
[SQL injection](https://en.wikipedia.org/wiki/SQL_injection) is one of the top security issues developers make and the consequences of this can be severe.
7
7
Using the format string function in the fmt Golang package to dynamically create an SQL query can easily create a possibility for SQL injection. The reason is that the format string function doesn't escape special characters like ' and it's easy to add second SQL command in the format string.
8
8
9
-
## Example problematic code:
9
+
## Examples of problematic code:
10
+
11
+
### G201 - SQL query construction using format string
0 commit comments