Skip to content

Commit 4e67e43

Browse files
committed
Move model to TaintTracking::FunctionModel
1 parent fe88028 commit 4e67e43

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

go/ql/lib/ext/github.com.kanikanema.gorqlite.model.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,3 @@ extensions:
2222
extensible: summaryModel
2323
data:
2424
- ["group:gorqlite", "QueryResult", True, "Map", "", "", "Argument[receiver]", "ReturnValue[0]", "taint", "manual"]
25-
- ["group:gorqlite", "QueryResult", True, "Scan", "", "", "Argument[receiver]", "Argument[0]", "taint", "manual"]
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/**
2+
* Provides classes modeling security-relevant aspects of the `gorqlite` package.
3+
*/
4+
5+
import go
6+
7+
module Gorqlite {
8+
private string packagePath() {
9+
result = package(["github.com/rqlite/gorqlite", "github.com/raindog308/gorqlite", "github.com/kanikanema/gorqlite"], "")
10+
}
11+
12+
// These are expressed using TaintTracking::FunctionModel because varargs functions don't work with Models-as-Data sumamries yet.
13+
private class QueryResultScan extends SQL::Query::Range, TaintTracking::FunctionModel, Method {
14+
FunctionInput inp;
15+
FunctionOutput outp;
16+
17+
QueryResultScan() {
18+
// signature: func (qr *QueryResult) Scan(dest ...interface{}) error
19+
this.hasQualifiedName(packagePath(), "QueryResult", "Scan") and
20+
inp.isReceiver() and
21+
outp.isParameter(_)
22+
}
23+
24+
override predicate hasTaintFlow(FunctionInput input, FunctionOutput output) {
25+
input = inp and output = outp
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)