Skip to content

Commit 0163d5a

Browse files
committed
Add BigQuery to the SQL frameworks so that it
Can be used as a sink for SQL injection queries. Signed-off-by: Jordy Zomer <jordy@pwning.systems>
1 parent 0957113 commit 0163d5a

File tree

1 file changed

+16
-0
lines changed
  • go/ql/lib/semmle/go/frameworks

1 file changed

+16
-0
lines changed

go/ql/lib/semmle/go/frameworks/SQL.qll

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,28 @@ module SQL {
100100
}
101101
}
102102

103+
/** A string that might identify package `go/bigquery` */
104+
string gobigquery() { result = "cloud.google.com/go/bigquery.Client" }
105+
103106
/** A string that might identify package `go-pg/pg` or a specific version of it. */
104107
private string gopg() { result = package("github.com/go-pg/pg", "") }
105108

106109
/** A string that might identify package `go-pg/pg/orm` or a specific version of it. */
107110
private string gopgorm() { result = package("github.com/go-pg/pg", "orm") }
108111

112+
/**
113+
* A string argument to an api of `go/bigquery` that is directly interpreted as SQL
114+
* without taking syntactic structure in account
115+
*/
116+
class BigQueryString extends Range {
117+
BigQueryString() {
118+
exists(Function f |
119+
f.hasQualifiedName(gobigquery(), "Query") and
120+
this = f.getACall().getArgument(0)
121+
)
122+
}
123+
}
124+
109125
/**
110126
* A string argument to an API of `go-pg/pg` that is directly interpreted as SQL without
111127
* taking syntactic structure into account.

0 commit comments

Comments
 (0)