Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Commit f0c0a89

Browse files
committed
Move OpenUrlRedirect customisation into the query's qll file
1 parent 62c6b0d commit f0c0a89

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

ql/src/semmle/go/frameworks/Revel.qll

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,6 @@ module Revel {
2929
}
3030
}
3131

32-
/**
33-
* Reinstate the usual field propagation rules for fields, which the OpenURLRedirect
34-
* query usually excludes, for fields of `Params` other than `Params.Fixed`.
35-
*/
36-
private class PropagateParamsFields extends OpenUrlRedirect::AdditionalStep {
37-
PropagateParamsFields() { this = "PropagateParamsFields" }
38-
39-
override predicate hasTaintStep(DataFlow::Node pred, DataFlow::Node succ) {
40-
exists(Field f, string field |
41-
f.hasQualifiedName(packagePath(), "Params", field) and
42-
field != "Fixed"
43-
|
44-
succ.(Read).readsField(pred, f)
45-
)
46-
}
47-
}
48-
4932
private class ParamsBind extends TaintTracking::FunctionModel, Method {
5033
ParamsBind() { this.hasQualifiedName(packagePath(), "Params", ["Bind", "BindJSON"]) }
5134

ql/src/semmle/go/security/OpenUrlRedirectCustomizations.qll

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,20 @@ private class UnsafeFieldReadSanitizer extends SafeUrlFlow::SanitizerEdge {
128128
)
129129
}
130130
}
131+
132+
/**
133+
* Reinstate the usual field propagation rules for fields, which the OpenURLRedirect
134+
* query usually excludes, for fields of `Params` other than `Params.Fixed`.
135+
*/
136+
private class PropagateParamsFields extends OpenUrlRedirect::AdditionalStep {
137+
PropagateParamsFields() { this = "PropagateParamsFields" }
138+
139+
override predicate hasTaintStep(DataFlow::Node pred, DataFlow::Node succ) {
140+
exists(Field f, string field |
141+
f.hasQualifiedName(Revel::packagePath(), "Params", field) and
142+
field != "Fixed"
143+
|
144+
succ.(Read).readsField(pred, f)
145+
)
146+
}
147+
}

0 commit comments

Comments
 (0)