Skip to content

Commit 4f0e17b

Browse files
committed
JS: Add step to a few other queries
1 parent d4b4d22 commit 4f0e17b

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

javascript/ql/lib/semmle/javascript/security/dataflow/ClientSideUrlRedirectQuery.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ class Configuration extends TaintTracking::Configuration {
4848
f instanceof DocumentUrl and
4949
g instanceof DocumentUrl and
5050
succ.(DataFlow::PropRead).accesses(pred, "href")
51+
or
52+
exists(HtmlSanitizerCall call |
53+
pred = call.getInput() and
54+
succ = call and
55+
f = g
56+
)
5157
}
5258

5359
override predicate isSanitizerGuard(TaintTracking::SanitizerGuardNode guard) {

javascript/ql/lib/semmle/javascript/security/dataflow/RequestForgeryCustomizations.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ module RequestForgery {
7272
succ = url and
7373
pred = url.getArgument(0)
7474
)
75+
or
76+
exists(HtmlSanitizerCall call |
77+
pred = call.getInput() and
78+
succ = call
79+
)
7580
}
7681

7782
private class SinkFromModel extends Sink {

javascript/ql/lib/semmle/javascript/security/dataflow/ServerSideUrlRedirectQuery.qll

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ class Configuration extends TaintTracking::Configuration {
3535
guard instanceof LocalUrlSanitizingGuard or
3636
guard instanceof HostnameSanitizerGuard
3737
}
38+
39+
override predicate isAdditionalTaintStep(DataFlow::Node pred, DataFlow::Node succ) {
40+
exists(HtmlSanitizerCall call |
41+
pred = call.getInput() and
42+
succ = call
43+
)
44+
}
3845
}
3946

4047
/**

javascript/ql/lib/semmle/javascript/security/dataflow/TaintedPathCustomizations.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,12 @@ module TaintedPath {
841841
dst = call and
842842
srclabel = dstlabel
843843
)
844+
or
845+
exists(HtmlSanitizerCall call |
846+
src = call.getInput() and
847+
dst = call and
848+
srclabel = dstlabel
849+
)
844850
}
845851

846852
/**

0 commit comments

Comments
 (0)