Skip to content

Commit 99ed3c2

Browse files
committed
Convert ElazarlGoproxy::UserControlledRequestData to MaD
1 parent 2ec64a9 commit 99ed3c2

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

go/ql/lib/ext/github.com.elazarl.goproxy.model.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,10 @@ extensions:
55
data:
66
- ["github.com/elazarl/goproxy", "CertStorage", True, "Fetch", "", "", "Argument[receiver]", "ReturnValue[0]", "taint", "manual"]
77
- ["github.com/elazarl/goproxy", "CertStorage", True, "Fetch", "", "", "Argument[1]", "ReturnValue[0]", "taint", "manual"]
8+
9+
- addsTo:
10+
pack: codeql/go-all
11+
extensible: sourceModel
12+
data:
13+
- ["github.com/elazarl/goproxy", "ProxyCtx", True, "UserData", "", "", "", "remote", "manual"]
14+
- ["github.com/elazarl/goproxy", "ProxyCtx", True, "Charset", "", "", "ReturnValue", "remote", "manual"]

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

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,6 @@ module ElazarlGoproxy {
9595
}
9696
}
9797

98-
private class UserControlledRequestData extends RemoteFlowSource::Range {
99-
UserControlledRequestData() {
100-
exists(DataFlow::FieldReadNode frn | this = frn |
101-
// liberally consider ProxyCtx.UserData to be untrusted; it's a data field set by a request handler
102-
frn.getField().hasQualifiedName(packagePath(), "ProxyCtx", "UserData")
103-
)
104-
or
105-
exists(DataFlow::MethodCallNode call | this = call |
106-
call.getTarget().hasQualifiedName(packagePath(), "ProxyCtx", "Charset")
107-
)
108-
}
109-
}
110-
11198
private class ProxyLogFunction extends StringOps::Formatting::Range, Method {
11299
ProxyLogFunction() { this.hasQualifiedName(packagePath(), "ProxyCtx", ["Logf", "Warnf"]) }
113100

0 commit comments

Comments
 (0)